From 5ed0ab6a1567e2a59921e0d6b9e2db6def3042d7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 15 Jan 2026 23:21:21 +0000 Subject: [PATCH 1/3] feat: add instances client library docs: add instances description PiperOrigin-RevId: 856756379 Source-Link: https://github.com/googleapis/googleapis/commit/a79ccb6aba44d1285d11840033956a0bced351a2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/fc9fbefb74a42bca8b0780205b5a625cf24d5b0e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJ1bi8uT3dsQm90LnlhbWwiLCJoIjoiZmM5ZmJlZmI3NGE0MmJjYThiMDc4MDIwNWI1YTYyNWNmMjRkNWIwZSJ9 --- .../google-cloud-run/.eslintignore | 7 + .../google-cloud-run/.eslintrc.json | 3 + .../google-cloud-run/.gitattributes | 4 + owl-bot-staging/google-cloud-run/.gitignore | 14 + owl-bot-staging/google-cloud-run/.jsdoc.js | 55 + owl-bot-staging/google-cloud-run/.mocharc.js | 33 + owl-bot-staging/google-cloud-run/.nycrc | 24 + .../google-cloud-run/.prettierignore | 6 + .../google-cloud-run/.prettierrc.js | 22 + .../google-cloud-run/CODE_OF_CONDUCT.md | 94 + .../google-cloud-run/CONTRIBUTING.md | 76 + owl-bot-staging/google-cloud-run/LICENSE | 202 + owl-bot-staging/google-cloud-run/README.md | 155 + .../protos/google/cloud/run/v2/build.proto | 175 + .../google/cloud/run/v2/condition.proto | 221 + .../cloud/run/v2/container_status.proto | 35 + .../google/cloud/run/v2/execution.proto | 316 + .../cloud/run/v2/execution_template.proto | 73 + .../protos/google/cloud/run/v2/instance.proto | 434 + .../google/cloud/run/v2/instance_split.proto | 67 + .../protos/google/cloud/run/v2/job.proto | 540 + .../protos/google/cloud/run/v2/k8s.min.proto | 483 + .../protos/google/cloud/run/v2/revision.proto | 331 + .../cloud/run/v2/revision_template.proto | 131 + .../protos/google/cloud/run/v2/service.proto | 520 + .../protos/google/cloud/run/v2/status.proto | 28 + .../protos/google/cloud/run/v2/task.proto | 291 + .../google/cloud/run/v2/task_template.proto | 80 + .../google/cloud/run/v2/traffic_target.proto | 77 + .../google/cloud/run/v2/vendor_settings.proto | 285 + .../google/cloud/run/v2/worker_pool.proto | 492 + .../v2/worker_pool_revision_template.proto | 109 + .../google-cloud-run/protos/protos.d.ts | 22927 ++++++ .../google-cloud-run/protos/protos.js | 61975 ++++++++++++++++ .../google-cloud-run/protos/protos.json | 7802 ++ .../generated/v2/builds.submit_build.js | 114 + .../v2/executions.cancel_execution.js | 75 + .../v2/executions.delete_execution.js | 75 + .../generated/v2/executions.get_execution.js | 64 + .../v2/executions.list_executions.js | 79 + .../generated/v2/instances.create_instance.js | 77 + .../generated/v2/instances.delete_instance.js | 71 + .../generated/v2/instances.get_instance.js | 60 + .../generated/v2/instances.list_instances.js | 79 + .../generated/v2/instances.start_instance.js | 75 + .../generated/v2/instances.stop_instance.js | 75 + .../samples/generated/v2/jobs.create_job.js | 80 + .../samples/generated/v2/jobs.delete_job.js | 74 + .../generated/v2/jobs.get_iam_policy.js | 67 + .../samples/generated/v2/jobs.get_job.js | 63 + .../samples/generated/v2/jobs.list_jobs.js | 78 + .../samples/generated/v2/jobs.run_job.js | 79 + .../generated/v2/jobs.set_iam_policy.js | 77 + .../generated/v2/jobs.test_iam_permissions.js | 70 + .../samples/generated/v2/jobs.update_job.js | 73 + .../generated/v2/revisions.delete_revision.js | 74 + .../generated/v2/revisions.get_revision.js | 63 + .../generated/v2/revisions.list_revisions.js | 79 + .../generated/v2/services.create_service.js | 81 + .../generated/v2/services.delete_service.js | 74 + .../generated/v2/services.get_iam_policy.js | 67 + .../generated/v2/services.get_service.js | 63 + .../generated/v2/services.list_services.js | 79 + .../generated/v2/services.set_iam_policy.js | 77 + .../v2/services.test_iam_permissions.js | 70 + .../generated/v2/services.update_service.js | 77 + .../snippet_metadata_google.cloud.run.v2.json | 1995 + .../samples/generated/v2/tasks.get_task.js | 63 + .../samples/generated/v2/tasks.list_tasks.js | 79 + .../v2/worker_pools.create_worker_pool.js | 83 + .../v2/worker_pools.delete_worker_pool.js | 75 + .../v2/worker_pools.get_iam_policy.js | 67 + .../v2/worker_pools.get_worker_pool.js | 64 + .../v2/worker_pools.list_worker_pools.js | 79 + .../v2/worker_pools.set_iam_policy.js | 77 + .../v2/worker_pools.test_iam_permissions.js | 70 + .../v2/worker_pools.update_worker_pool.js | 87 + owl-bot-staging/google-cloud-run/src/index.ts | 41 + .../google-cloud-run/src/v2/builds_client.ts | 974 + .../src/v2/builds_client_config.json | 30 + .../src/v2/builds_proto_list.json | 21 + .../src/v2/executions_client.ts | 1722 + .../src/v2/executions_client_config.json | 42 + .../src/v2/executions_proto_list.json | 21 + .../src/v2/gapic_metadata.json | 559 + .../google-cloud-run/src/v2/index.ts | 26 + .../src/v2/instances_client.ts | 2090 + .../src/v2/instances_client_config.json | 50 + .../src/v2/instances_proto_list.json | 21 + .../google-cloud-run/src/v2/jobs_client.ts | 2361 + .../src/v2/jobs_client_config.json | 62 + .../src/v2/jobs_proto_list.json | 21 + .../src/v2/revisions_client.ts | 1716 + .../src/v2/revisions_client_config.json | 38 + .../src/v2/revisions_proto_list.json | 21 + .../src/v2/services_client.ts | 2232 + .../src/v2/services_client_config.json | 75 + .../src/v2/services_proto_list.json | 21 + .../google-cloud-run/src/v2/tasks_client.ts | 1293 + .../src/v2/tasks_client_config.json | 34 + .../src/v2/tasks_proto_list.json | 21 + .../src/v2/worker_pools_client.ts | 2243 + .../src/v2/worker_pools_client_config.json | 58 + .../src/v2/worker_pools_proto_list.json | 21 + .../system-test/fixtures/sample/src/index.js | 34 + .../system-test/fixtures/sample/src/index.ts | 74 + .../google-cloud-run/system-test/install.ts | 49 + .../google-cloud-run/test/gapic_builds_v2.ts | 865 + .../test/gapic_executions_v2.ts | 1784 + .../test/gapic_instances_v2.ts | 2127 + .../google-cloud-run/test/gapic_jobs_v2.ts | 2393 + .../test/gapic_revisions_v2.ts | 1669 + .../test/gapic_services_v2.ts | 2243 + .../google-cloud-run/test/gapic_tasks_v2.ts | 1259 + .../test/gapic_worker_pools_v2.ts | 2243 + .../google-cloud-run/tsconfig.json | 22 + .../google-cloud-run/webpack.config.js | 64 + 117 files changed, 133775 insertions(+) create mode 100644 owl-bot-staging/google-cloud-run/.eslintignore create mode 100644 owl-bot-staging/google-cloud-run/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-run/.gitattributes create mode 100644 owl-bot-staging/google-cloud-run/.gitignore create mode 100644 owl-bot-staging/google-cloud-run/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-run/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-run/.nycrc create mode 100644 owl-bot-staging/google-cloud-run/.prettierignore create mode 100644 owl-bot-staging/google-cloud-run/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-cloud-run/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-cloud-run/LICENSE create mode 100644 owl-bot-staging/google-cloud-run/README.md create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/container_status.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto create mode 100644 owl-bot-staging/google-cloud-run/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-run/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-run/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.cancel_execution.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.delete_execution.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.get_execution.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.list_executions.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/instances.create_instance.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/instances.delete_instance.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/instances.get_instance.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/instances.list_instances.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/instances.start_instance.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/instances.stop_instance.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.create_job.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.delete_job.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_job.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.list_jobs.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.run_job.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.update_job.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.delete_revision.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.get_revision.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.list_revisions.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.create_service.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.delete_service.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_service.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.list_services.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.set_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.update_service.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.list_tasks.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js create mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js create mode 100644 owl-bot-staging/google-cloud-run/src/index.ts create mode 100644 owl-bot-staging/google-cloud-run/src/v2/builds_client.ts create mode 100644 owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/executions_client.ts create mode 100644 owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/index.ts create mode 100644 owl-bot-staging/google-cloud-run/src/v2/instances_client.ts create mode 100644 owl-bot-staging/google-cloud-run/src/v2/instances_client_config.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/instances_proto_list.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts create mode 100644 owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts create mode 100644 owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/services_client.ts create mode 100644 owl-bot-staging/google-cloud-run/src/v2/services_client_config.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts create mode 100644 owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts create mode 100644 owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json create mode 100644 owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json create mode 100644 owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-run/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-run/test/gapic_builds_v2.ts create mode 100644 owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts create mode 100644 owl-bot-staging/google-cloud-run/test/gapic_instances_v2.ts create mode 100644 owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts create mode 100644 owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts create mode 100644 owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts create mode 100644 owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts create mode 100644 owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts create mode 100644 owl-bot-staging/google-cloud-run/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-run/webpack.config.js diff --git a/owl-bot-staging/google-cloud-run/.eslintignore b/owl-bot-staging/google-cloud-run/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-run/.eslintrc.json b/owl-bot-staging/google-cloud-run/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-run/.gitattributes b/owl-bot-staging/google-cloud-run/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-run/.gitignore b/owl-bot-staging/google-cloud-run/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-run/.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-run/.jsdoc.js b/owl-bot-staging/google-cloud-run/.jsdoc.js new file mode 100644 index 00000000000..d1458969c83 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/run', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-run/.mocharc.js b/owl-bot-staging/google-cloud-run/.mocharc.js new file mode 100644 index 00000000000..5eb34e86c87 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-run/.nycrc b/owl-bot-staging/google-cloud-run/.nycrc new file mode 100644 index 00000000000..81a95fc94b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/.prettierignore b/owl-bot-staging/google-cloud-run/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/owl-bot-staging/google-cloud-run/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-cloud-run/.prettierrc.js b/owl-bot-staging/google-cloud-run/.prettierrc.js new file mode 100644 index 00000000000..7649ee3c254 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/CONTRIBUTING.md b/owl-bot-staging/google-cloud-run/CONTRIBUTING.md new file mode 100644 index 00000000000..5368c76a957 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Run API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=run.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/LICENSE b/owl-bot-staging/google-cloud-run/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-run/README.md b/owl-bot-staging/google-cloud-run/README.md new file mode 100644 index 00000000000..5e764dd1d71 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/README.md @@ -0,0 +1,155 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Cloud Run Admin API: Nodejs Client][homepage] + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority + +[![npm version](https://img.shields.io/npm/v/@google-cloud/run.svg)](https://www.npmjs.org/package/@google-cloud/run) + +Cloud Run Admin API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Cloud Run Admin API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/run/latest) + + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Run Admin API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/run +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | +| --------------------------- | --------------------------------- | +| submit build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/builds.submit_build.js) | +| cancel execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js) | +| delete execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js) | +| get execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js) | +| list executions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js) | +| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.create_instance.js) | +| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.delete_instance.js) | +| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.get_instance.js) | +| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.list_instances.js) | +| start instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.start_instance.js) | +| stop instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.stop_instance.js) | +| create job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.create_job.js) | +| delete job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.delete_job.js) | +| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js) | +| get job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.get_job.js) | +| list jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.list_jobs.js) | +| run job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.run_job.js) | +| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js) | +| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js) | +| update job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.update_job.js) | +| delete revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/revisions.delete_revision.js) | +| get revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/revisions.get_revision.js) | +| list revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/revisions.list_revisions.js) | +| create service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.create_service.js) | +| delete service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.delete_service.js) | +| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.get_iam_policy.js) | +| get service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.get_service.js) | +| list services | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.list_services.js) | +| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.set_iam_policy.js) | +| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js) | +| update service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.update_service.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json) | +| get task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/tasks.get_task.js) | +| list tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/tasks.list_tasks.js) | +| create worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js) | +| delete worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js) | +| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js) | +| get worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js) | +| list worker pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js) | +| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js) | +| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js) | +| update worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js) | + + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/run@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=run.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto new file mode 100644 index 00000000000..d2eb5f6566e --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto @@ -0,0 +1,175 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/launch_stage.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "BuildProto"; +option java_package = "com.google.cloud.run.v2"; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/BuildWorkerPool" + pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" +}; + +// Cloud Run Build Control Plane API +service Builds { + option (google.api.default_host) = "run.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Submits a build in a given project. + rpc SubmitBuild(SubmitBuildRequest) returns (SubmitBuildResponse) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/builds:submit" + body: "*" + }; + } +} + +// Request message for submitting a Build. +message SubmitBuildRequest { + // Build the source using Docker. This means the source has a Dockerfile. + message DockerBuild {} + + // Build the source using Buildpacks. + message BuildpacksBuild { + // The runtime name, e.g. 'go113'. Leave blank for generic builds. + string runtime = 1 [deprecated = true]; + + // Optional. Name of the function target if the source is a function source. + // Required for function builds. + string function_target = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. cache_image_uri is the GCR/AR URL where the cache image will be + // stored. cache_image_uri is optional and omitting it will disable caching. + // This URL must be stable across builds. It is used to derive a + // build-specific temporary URL by substituting the tag with the build ID. + // The build will clean up the temporary image on a best-effort basis. + string cache_image_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The base image to use for the build. + string base_image = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-provided build-time environment variables. + map environment_variables = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether or not the application container will be enrolled in + // automatic base image updates. When true, the application will be built on + // a scratch base image, so the base layers can be appended at run time. + bool enable_automatic_updates = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. project_descriptor stores the path to the project descriptor + // file. When empty, it means that there is no project descriptor file in + // the source. + string project_descriptor = 7 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The project and location to build in. Location must be a region, + // e.g., 'us-central1' or 'global' if the global builder is to be used. + // Format: + // `projects/{project}/locations/{location}` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Location of source. + oneof source { + // Required. Source for the build. + StorageSource storage_source = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Artifact Registry URI to store the built image. + string image_uri = 3 [(google.api.field_behavior) = REQUIRED]; + + // Build type must be one of the following. + oneof build_type { + // Build the source using Buildpacks. + BuildpacksBuild buildpack_build = 4; + + // Build the source using Docker. This means the source has a Dockerfile. + DockerBuild docker_build = 5; + } + + // Optional. The service account to use for the build. If not set, the default + // Cloud Build service account for the project will be used. + string service_account = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Name of the Cloud Build Custom Worker Pool that should be used to + // build the function. The format of this field is + // `projects/{project}/locations/{region}/workerPools/{workerPool}` where + // `{project}` and `{region}` are the project id and region respectively where + // the worker pool is defined and `{workerPool}` is the short name of the + // worker pool. + string worker_pool = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/BuildWorkerPool" + } + ]; + + // Optional. Additional tags to annotate the build. + repeated string tags = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The machine type from default pool to use for the build. If left + // blank, cloudbuild will use a sensible default. Currently only E2_HIGHCPU_8 + // is supported. If worker_pool is set, this field will be ignored. + string machine_type = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The release track of the client that initiated the build request. + google.api.LaunchStage release_track = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The client that initiated the build request. + string client = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for submitting a Build. +message SubmitBuildResponse { + // Cloud Build operation to be polled via CloudBuild API. + google.longrunning.Operation build_operation = 1; + + // URI of the base builder image in Artifact Registry being used in the build. + // Used to opt into automatic base image updates. + string base_image_uri = 2; + + // Warning message for the base image. + string base_image_warning = 3; +} + +// Location of the source in an archive file in Google Cloud Storage. +message StorageSource { + // Required. Google Cloud Storage bucket containing the source (see + // [Bucket Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Google Cloud Storage object containing the source. + // + // This object must be a gzipped archive file (`.tar.gz`) containing source to + // build. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Google Cloud Storage generation for the object. If the generation + // is omitted, the latest generation will be used. + int64 generation = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto new file mode 100644 index 00000000000..b7b5b10d15e --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto @@ -0,0 +1,221 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "ConditionProto"; +option java_package = "com.google.cloud.run.v2"; + +// Defines a status condition for a resource. +message Condition { + // Represents the possible Condition states. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // Transient state: Reconciliation has not started yet. + CONDITION_PENDING = 1; + + // Transient state: reconciliation is still in progress. + CONDITION_RECONCILING = 2; + + // Terminal state: Reconciliation did not succeed. + CONDITION_FAILED = 3; + + // Terminal state: Reconciliation completed successfully. + CONDITION_SUCCEEDED = 4; + } + + // Represents the severity of the condition failures. + enum Severity { + // Unspecified severity + SEVERITY_UNSPECIFIED = 0; + + // Error severity. + ERROR = 1; + + // Warning severity. + WARNING = 2; + + // Info severity. + INFO = 3; + } + + // Reasons common to all types of conditions. + enum CommonReason { + // Default value. + COMMON_REASON_UNDEFINED = 0; + + // Reason unknown. Further details will be in message. + UNKNOWN = 1; + + // Revision creation process failed. + REVISION_FAILED = 3; + + // Timed out waiting for completion. + PROGRESS_DEADLINE_EXCEEDED = 4; + + // The container image path is incorrect. + CONTAINER_MISSING = 6; + + // Insufficient permissions on the container image. + CONTAINER_PERMISSION_DENIED = 7; + + // Container image is not authorized by policy. + CONTAINER_IMAGE_UNAUTHORIZED = 8; + + // Container image policy authorization check failed. + CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9; + + // Insufficient permissions on encryption key. + ENCRYPTION_KEY_PERMISSION_DENIED = 10; + + // Permission check on encryption key failed. + ENCRYPTION_KEY_CHECK_FAILED = 11; + + // At least one Access check on secrets failed. + SECRETS_ACCESS_CHECK_FAILED = 12; + + // Waiting for operation to complete. + WAITING_FOR_OPERATION = 13; + + // System will retry immediately. + IMMEDIATE_RETRY = 14; + + // System will retry later; current attempt failed. + POSTPONED_RETRY = 15; + + // An internal error occurred. Further information may be in the message. + INTERNAL = 16; + + // User-provided VPC network was not found. + VPC_NETWORK_NOT_FOUND = 17; + } + + // Reasons specific to Revision resource. + enum RevisionReason { + // Default value. + REVISION_REASON_UNDEFINED = 0; + + // Revision in Pending state. + PENDING = 1; + + // Revision is in Reserve state. + RESERVE = 2; + + // Revision is Retired. + RETIRED = 3; + + // Revision is being retired. + RETIRING = 4; + + // Revision is being recreated. + RECREATING = 5; + + // There was a health check error. + HEALTH_CHECK_CONTAINER_ERROR = 6; + + // Health check failed due to user error from customized path of the + // container. System will retry. + CUSTOMIZED_PATH_RESPONSE_PENDING = 7; + + // A revision with min_instance_count > 0 was created and is reserved, but + // it was not configured to serve traffic, so it's not live. This can also + // happen momentarily during traffic migration. + MIN_INSTANCES_NOT_PROVISIONED = 8; + + // The maximum allowed number of active revisions has been reached. + ACTIVE_REVISION_LIMIT_REACHED = 9; + + // There was no deployment defined. + // This value is no longer used, but Services created in older versions of + // the API might contain this value. + NO_DEPLOYMENT = 10; + + // A revision's container has no port specified since the revision is of a + // manually scaled service with 0 instance count + HEALTH_CHECK_SKIPPED = 11; + + // A revision with min_instance_count > 0 was created and is waiting for + // enough instances to begin a traffic migration. + MIN_INSTANCES_WARMING = 12; + } + + // Reasons specific to Execution resource. + enum ExecutionReason { + // Default value. + EXECUTION_REASON_UNDEFINED = 0; + + // Internal system error getting execution status. System will retry. + JOB_STATUS_SERVICE_POLLING_ERROR = 1; + + // A task reached its retry limit and the last attempt failed due to the + // user container exiting with a non-zero exit code. + NON_ZERO_EXIT_CODE = 2; + + // The execution was cancelled by users. + CANCELLED = 3; + + // The execution is in the process of being cancelled. + CANCELLING = 4; + + // The execution was deleted. + DELETED = 5; + + // A delayed execution is waiting for a start time. + DELAYED_START_PENDING = 6; + } + + // type is used to communicate the status of the reconciliation process. + // See also: + // https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting + // Types common to all resources include: + // * "Ready": True when the Resource is ready. + string type = 1; + + // State of the condition. + State state = 2; + + // Human readable message indicating details about the current status. + string message = 3; + + // Last time the condition transitioned from one status to another. + google.protobuf.Timestamp last_transition_time = 4; + + // How to interpret failures of this condition, one of Error, Warning, Info + Severity severity = 5; + + // The reason for this condition. Depending on the condition type, + // it will populate one of these fields. + // Successful conditions cannot have a reason. + oneof reasons { + // Output only. A common (service-level) reason for this condition. + CommonReason reason = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A reason for the revision condition. + RevisionReason revision_reason = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A reason for the execution condition. + ExecutionReason execution_reason = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/container_status.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/container_status.proto new file mode 100644 index 00000000000..6043fa698dc --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/container_status.proto @@ -0,0 +1,35 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "ContainerStatusProto"; +option java_package = "com.google.cloud.run.v2"; + +// ContainerStatus holds the information of container name and image digest +// value. +message ContainerStatus { + // The name of the container, if specified. + string name = 1; + + // ImageDigest holds the resolved digest for the image specified and resolved + // during the creation of Revision. This field holds the digest value + // regardless of whether a tag or digest was originally specified in the + // Container object. + string image_digest = 2; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto new file mode 100644 index 00000000000..a181fb1bd26 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto @@ -0,0 +1,316 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/launch_stage.proto"; +import "google/api/resource.proto"; +import "google/cloud/run/v2/condition.proto"; +import "google/cloud/run/v2/task_template.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "ExecutionProto"; +option java_package = "com.google.cloud.run.v2"; + +// Cloud Run Execution Control Plane API. +service Executions { + option (google.api.default_host) = "run.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets information about an Execution. + rpc GetExecution(GetExecutionRequest) returns (Execution) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Executions from a Job. Results are sorted by creation time, + // descending. + rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*/jobs/*}/executions" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes an Execution. + rpc DeleteExecution(DeleteExecutionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Execution" + metadata_type: "Execution" + }; + } + + // Cancels an Execution. + rpc CancelExecution(CancelExecutionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Execution" + metadata_type: "Execution" + }; + } +} + +// Request message for obtaining a Execution by its full name. +message GetExecutionRequest { + // Required. The full name of the Execution. + // Format: + // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + // where `{project}` can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } + ]; +} + +// Request message for retrieving a list of Executions. +message ListExecutionsRequest { + // Required. The Execution from which the Executions should be listed. + // To list all Executions across Jobs, use "-" instead of Job name. + // Format: `projects/{project}/locations/{location}/jobs/{job}`, where + // `{project}` can be project id or number. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "run.googleapis.com/Execution" + } + ]; + + // Maximum number of Executions to return in this call. + int32 page_size = 2; + + // A page token received from a previous call to ListExecutions. + // All other parameters must match. + string page_token = 3; + + // If true, returns deleted (but unexpired) resources along with active ones. + bool show_deleted = 4; +} + +// Response message containing a list of Executions. +message ListExecutionsResponse { + // The resulting list of Executions. + repeated Execution executions = 1; + + // A token indicating there are more items than page_size. Use it in the next + // ListExecutions request to continue. + string next_page_token = 2; +} + +// Request message for deleting an Execution. +message DeleteExecutionRequest { + // Required. The name of the Execution to delete. + // Format: + // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + // where `{project}` can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } + ]; + + // Indicates that the request should be validated without actually + // deleting any resources. + bool validate_only = 2; + + // A system-generated fingerprint for this version of the resource. + // This may be used to detect modification conflict during updates. + string etag = 3; +} + +// Request message for deleting an Execution. +message CancelExecutionRequest { + // Required. The name of the Execution to cancel. + // Format: + // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + // where `{project}` can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } + ]; + + // Indicates that the request should be validated without actually + // cancelling any resources. + bool validate_only = 2; + + // A system-generated fingerprint for this version of the resource. + // This may be used to detect modification conflict during updates. + string etag = 3; +} + +// Execution represents the configuration of a single execution. A execution an +// immutable resource that references a container image which is run to +// completion. +message Execution { + option (google.api.resource) = { + type: "run.googleapis.com/Execution" + pattern: "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}" + style: DECLARATIVE_FRIENDLY + }; + + // Output only. The unique name of this Execution. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server assigned unique identifier for the Execution. The value + // is a UUID4 string and guaranteed to remain unchanged until the resource is + // deleted. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the authenticated creator. + string creator = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A number that monotonically increases every time the user + // modifies the desired state. + int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unstructured key value map that can be used to organize and + // categorize objects. User-provided labels are shared with Google's billing + // system, so they can be used to filter, or break down billing charges by + // team, component, environment, state, etc. For more information, visit + // https://cloud.google.com/resource-manager/docs/creating-managing-labels or + // https://cloud.google.com/run/docs/configuring/labels + map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unstructured key value map that may + // be set by external tools to store and arbitrary metadata. + // They are not queryable and should be preserved + // when modifying objects. + map annotations = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents time when the execution was acknowledged by the + // execution controller. It is not guaranteed to be set in happens-before + // order across separate operations. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents time when the execution started to run. + // It is not guaranteed to be set in happens-before order across separate + // operations. + google.protobuf.Timestamp start_time = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents time when the execution was completed. It is not + // guaranteed to be set in happens-before order across separate operations. + google.protobuf.Timestamp completion_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a deleted resource, the deletion time. It is only + // populated as a response to a Delete request. + google.protobuf.Timestamp delete_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a deleted resource, the time after which it will be + // permamently deleted. It is only populated as a response to a Delete + // request. + google.protobuf.Timestamp expire_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The least stable launch stage needed to create this resource, as defined by + // [Google Cloud Platform Launch + // Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + // `ALPHA`, `BETA`, and `GA`. + // + // Note that this value might not be what was used + // as input. For example, if ALPHA was provided as input in the parent + // resource, but only BETA and GA-level features are were, this field will be + // BETA. + google.api.LaunchStage launch_stage = 11; + + // Output only. The name of the parent Job. + string job = 12 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "run.googleapis.com/Job" } + ]; + + // Output only. Specifies the maximum desired number of tasks the execution + // should run at any given time. Must be <= task_count. The actual number of + // tasks running in steady state will be less than this number when + // ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when + // the work left to do is less than max parallelism. + int32 parallelism = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Specifies the desired number of tasks the execution should + // run. Setting to 1 means that parallelism is limited to 1 and the success of + // that task signals the success of the execution. + int32 task_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The template used to create tasks for this execution. + TaskTemplate template = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether the resource's reconciliation is still in + // progress. See comments in `Job.reconciling` for additional information on + // reconciliation process in Cloud Run. + bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Condition of this Execution, containing its readiness + // status, and detailed error information in case it did not reach the desired + // state. + repeated Condition conditions = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The generation of this Execution. See comments in + // `reconciling` for additional information on reconciliation process in Cloud + // Run. + int64 observed_generation = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of actively running tasks. + int32 running_count = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of tasks which reached phase Succeeded. + int32 succeeded_count = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of tasks which reached phase Failed. + int32 failed_count = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of tasks which reached phase Cancelled. + int32 cancelled_count = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of tasks which have retried at least once. + int32 retried_count = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. URI where logs for this execution can be found in Cloud + // Console. + string log_uri = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto new file mode 100644 index 00000000000..5a57620efd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/field_behavior.proto"; +import "google/cloud/run/v2/task_template.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "ExecutionTemplateProto"; +option java_package = "com.google.cloud.run.v2"; + +// ExecutionTemplate describes the data an execution should have when created +// from a template. +message ExecutionTemplate { + // Unstructured key value map that can be used to organize and categorize + // objects. + // User-provided labels are shared with Google's billing system, so they can + // be used to filter, or break down billing charges by team, component, + // environment, state, etc. For more information, visit + // https://cloud.google.com/resource-manager/docs/creating-managing-labels or + // https://cloud.google.com/run/docs/configuring/labels. + // + //

Cloud Run API v2 does not support labels with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected. All system labels in v1 now have a + // corresponding field in v2 ExecutionTemplate. + map labels = 1; + + // Unstructured key value map that may be set by external tools to store and + // arbitrary metadata. They are not queryable and should be preserved + // when modifying objects. + // + //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected. All system annotations in v1 now + // have a corresponding field in v2 ExecutionTemplate. + // + //

This field follows Kubernetes annotations' namespacing, limits, and + // rules. + map annotations = 2; + + // Optional. Specifies the maximum desired number of tasks the execution + // should run at given time. When the job is run, if this field is 0 or unset, + // the maximum possible value will be used for that execution. The actual + // number of tasks running in steady state will be less than this number when + // there are fewer tasks waiting to be completed remaining, i.e. when the work + // left to do is less than max parallelism. + int32 parallelism = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Specifies the desired number of tasks the execution should run. + // Setting to 1 means that parallelism is limited to 1 and the success of + // that task signals the success of the execution. Defaults to 1. + int32 task_count = 4; + + // Required. Describes the task(s) that will be created when executing an + // execution. + TaskTemplate template = 5 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance.proto new file mode 100644 index 00000000000..f8b88cd57e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance.proto @@ -0,0 +1,434 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/launch_stage.proto"; +import "google/api/resource.proto"; +import "google/api/routing.proto"; +import "google/cloud/run/v2/condition.proto"; +import "google/cloud/run/v2/container_status.proto"; +import "google/cloud/run/v2/k8s.min.proto"; +import "google/cloud/run/v2/vendor_settings.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.run.v2"; + +// The Cloud Run Instances API allows you to manage Cloud Run Instances. +service Instances { + option (google.api.default_host) = "run.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates an Instance. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + }; + option (google.api.method_signature) = "parent,instance"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "Instance" + }; + } + + // Deletes a Instance + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "Instance" + }; + } + + // Gets a Instance + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists Instances. Results are sorted by creation time, descending. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/instances" + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Stops an Instance. + rpc StopInstance(StopInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/instances/*}:stop" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "Instance" + }; + } + + // Starts an Instance. + rpc StartInstance(StartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/instances/*}:start" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "Instance" + }; + } +} + +message CreateInstanceRequest { + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "run.googleapis.com/Instance" + } + ]; + + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The unique identifier for the Instance. It must begin with + // letter, and cannot end with hyphen; must contain fewer than 50 characters. + // The name of the instance becomes {parent}/instances/{instance_id}. + string instance_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Indicates that the request should be validated and default values + // populated, without persisting the request or creating any resources. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +message GetInstanceRequest { + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Instance" } + ]; +} + +message DeleteInstanceRequest { + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Instance" } + ]; + + // Optional. Indicates that the request should be validated without actually + // deleting any resources. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for retrieving a list of Instances. +message ListInstancesRequest { + // Required. The location and project to list resources on. + // Format: projects/{project}/locations/{location}, where {project} can be + // project id or number. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "run.googleapis.com/Instance" + } + ]; + + // Optional. Maximum number of Instances to return in this call. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token received from a previous call to ListInstances. + // All other parameters must match. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, returns deleted (but unexpired) resources along with + // active ones. + bool show_deleted = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message containing a list of Instances. +message ListInstancesResponse { + // The resulting list of Instances. + repeated Instance instances = 1; + + // A token indicating there are more items than page_size. Use it in the next + // ListInstances request to continue. + string next_page_token = 2; +} + +// Request message for deleting an Instance. +message StopInstanceRequest { + // Required. The name of the Instance to stop. + // Format: + // `projects/{project}/locations/{location}/instances/{instance}`, + // where `{project}` can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Instance" } + ]; + + // Optional. Indicates that the request should be validated without actually + // stopping any resources. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A system-generated fingerprint for this version of the resource. + // This may be used to detect modification conflict during updates. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for starting an Instance. +message StartInstanceRequest { + // Required. The name of the Instance to stop. + // Format: + // `projects/{project}/locations/{location}/instances/{instance}`, + // where `{project}` can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Instance" } + ]; + + // Optional. Indicates that the request should be validated without actually + // stopping any resources. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A system-generated fingerprint for this version of the resource. + // This may be used to detect modification conflict during updates. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Cloud Run Instance represents a single group of containers running in a +// region. +message Instance { + option (google.api.resource) = { + type: "run.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + plural: "instances" + singular: "instance" + }; + + // The fully qualified name of this Instance. In CreateInstanceRequest, this + // field is ignored, and instead composed from CreateInstanceRequest.parent + // and CreateInstanceRequest.instance_id. + // + // Format: + // projects/{project}/locations/{location}/instances/{instance_id} + string name = 1; + + // User-provided description of the Instance. This field currently has a + // 512-character limit. + string description = 3; + + // Output only. Server assigned unique identifier for the trigger. The value + // is a UUID4 string and guaranteed to remain unchanged until the resource is + // deleted. + string uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A number that monotonically increases every time the user + // modifies the desired state. + // Please note that unlike v1, this is an int64 value. As with most Google + // APIs, its JSON representation will be a `string` instead of an `integer`. + int64 generation = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + map labels = 6; + + map annotations = 7; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The deletion time. + google.protobuf.Timestamp delete_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a deleted resource, the time after which it will be + // permamently deleted. + google.protobuf.Timestamp expire_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the authenticated creator. + string creator = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the last authenticated modifier. + string last_modifier = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Arbitrary identifier for the API client. + string client = 14; + + // Arbitrary version identifier for the API client. + string client_version = 15; + + // The launch stage as defined by [Google Cloud Platform + // Launch Stages](https://cloud.google.com/terms/launch-stages). + // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + // is assumed. + // Set the launch stage to a preview stage on input to allow use of preview + // features in that stage. On read (or output), describes whether the + // resource uses preview features. + //

+ // For example, if ALPHA is provided as input, but only BETA and GA-level + // features are used, this field will be BETA on output. + google.api.LaunchStage launch_stage = 16; + + // Settings for the Binary Authorization feature. + BinaryAuthorization binary_authorization = 17; + + // Optional. VPC Access configuration to use for this Revision. For more + // information, visit + // https://cloud.google.com/run/docs/configuring/connecting-vpc. + VpcAccess vpc_access = 18 [(google.api.field_behavior) = OPTIONAL]; + + string service_account = 19; + + // Required. Holds the single container that defines the unit of execution for + // this Instance. + repeated Container containers = 20 [(google.api.field_behavior) = REQUIRED]; + + // A list of Volumes to make available to containers. + repeated Volume volumes = 21; + + // A reference to a customer managed encryption key (CMEK) to use to encrypt + // this container image. For more information, go to + // https://cloud.google.com/run/docs/securing/using-cmek + string encryption_key = 22 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // The action to take if the encryption key is revoked. + EncryptionKeyRevocationAction encryption_key_revocation_action = 24; + + // If encryption_key_revocation_action is SHUTDOWN, the duration before + // shutting down all instances. The minimum increment is 1 hour. + google.protobuf.Duration encryption_key_shutdown_duration = 25; + + // Optional. The node selector for the instance. + NodeSelector node_selector = 26 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True if GPU zonal redundancy is disabled on this instance. + optional bool gpu_zonal_redundancy_disabled = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Provides the ingress settings for this Instance. On output, + // returns the currently observed ingress settings, or + // INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. + IngressTraffic ingress = 28 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Disables IAM permission check for run.routes.invoke for callers + // of this Instance. For more information, visit + // https://cloud.google.com/run/docs/securing/managing-access#invoker_check. + bool invoker_iam_disabled = 29 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. IAP settings on the Instance. + bool iap_enabled = 30 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The generation of this Instance currently serving traffic. See + // comments in `reconciling` for additional information on reconciliation + // process in Cloud Run. Please note that unlike v1, this is an int64 value. + // As with most Google APIs, its JSON representation will be a `string` + // instead of an `integer`. + int64 observed_generation = 40 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Google Console URI to obtain logs for the Instance. + string log_uri = 41 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Condition of this Instance, containing its readiness + // status, and detailed error information in case it did not reach a serving + // state. See comments in `reconciling` for additional information on + // reconciliation process in Cloud Run. + Condition terminal_condition = 42 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Conditions of all other associated sub-resources. They + // contain additional diagnostics information in case the Instance does not + // reach its Serving state. See comments in `reconciling` for additional + // information on reconciliation process in Cloud Run. + repeated Condition conditions = 43 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Status information for each of the specified containers. The + // status includes the resolved digest for specified images. + repeated ContainerStatus container_statuses = 44 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 46 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. All URLs serving traffic for this Instance. + repeated string urls = 45 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Returns true if the Instance is currently being acted upon by + // the system to bring it into the desired state. + // + // When a new Instance is created, or an existing one is updated, Cloud Run + // will asynchronously perform all necessary steps to bring the Instance to + // the desired serving state. This process is called reconciliation. While + // reconciliation is in process, `observed_generation` will have a transient + // value that might mismatch the intended state. + // Once reconciliation is over (and this field is false), there are two + // possible outcomes: reconciliation succeeded and the serving state matches + // the Instance, or there was an error, and reconciliation failed. This state + // can be found in `terminal_condition.state`. + bool reconciling = 98 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 99 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto new file mode 100644 index 00000000000..bfce369f857 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "InstanceSplitProto"; +option java_package = "com.google.cloud.run.v2"; + +// Holds a single instance split entry for the Worker. Allocations can be done +// to a specific Revision name, or pointing to the latest Ready Revision. +message InstanceSplit { + // The allocation type for this instance split. + InstanceSplitAllocationType type = 1; + + // Revision to which to assign this portion of instances, if split allocation + // is by revision. + string revision = 2 [ + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Specifies percent of the instance split to this Revision. + // This defaults to zero if unspecified. + int32 percent = 3; +} + +// Represents the observed state of a single `InstanceSplit` entry. +message InstanceSplitStatus { + // The allocation type for this instance split. + InstanceSplitAllocationType type = 1; + + // Revision to which this instance split is assigned. + string revision = 2 [ + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Specifies percent of the instance split to this Revision. + int32 percent = 3; +} + +// The type of instance split allocation. +enum InstanceSplitAllocationType { + // Unspecified instance allocation type. + INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED = 0; + + // Allocates instances to the Service's latest ready Revision. + INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST = 1; + + // Allocates instances to a Revision by name. + INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION = 2; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto new file mode 100644 index 00000000000..ad54a7268cb --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto @@ -0,0 +1,540 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/launch_stage.proto"; +import "google/api/resource.proto"; +import "google/api/routing.proto"; +import "google/cloud/run/v2/condition.proto"; +import "google/cloud/run/v2/execution.proto"; +import "google/cloud/run/v2/execution_template.proto"; +import "google/cloud/run/v2/k8s.min.proto"; +import "google/cloud/run/v2/vendor_settings.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "JobProto"; +option java_package = "com.google.cloud.run.v2"; + +// Cloud Run Job Control Plane API. +service Jobs { + option (google.api.default_host) = "run.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a Job. + rpc CreateJob(CreateJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/jobs" + body: "job" + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + }; + option (google.api.method_signature) = "parent,job,job_id"; + option (google.longrunning.operation_info) = { + response_type: "Job" + metadata_type: "Job" + }; + } + + // Gets information about a Job. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists Jobs. Results are sorted by creation time, descending. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/jobs" + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a Job. + rpc UpdateJob(UpdateJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{job.name=projects/*/locations/*/jobs/*}" + body: "job" + }; + option (google.api.routing) = { + routing_parameters { + field: "job.name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "job"; + option (google.longrunning.operation_info) = { + response_type: "Job" + metadata_type: "Job" + }; + } + + // Deletes a Job. + rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Job" + metadata_type: "Job" + }; + } + + // Triggers creation of a new Execution of this Job. + rpc RunJob(RunJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/locations/*/jobs/*}:run" + body: "*" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Execution" + metadata_type: "Execution" + }; + } + + // Gets the IAM Access Control policy currently in effect for the given Job. + // This result does not include any inherited policies. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + get: "/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy" + }; + } + + // Sets the IAM Access control policy for the specified Job. Overwrites + // any existing policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy" + body: "*" + }; + } + + // Returns permissions that a caller has on the specified Project. + // + // There are no permissions required for making this API call. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions" + body: "*" + }; + } +} + +// Request message for creating a Job. +message CreateJobRequest { + // Required. The location and project in which this Job should be created. + // Format: projects/{project}/locations/{location}, where {project} can be + // project id or number. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "run.googleapis.com/Job" } + ]; + + // Required. The Job instance to create. + Job job = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The unique identifier for the Job. The name of the job becomes + // {parent}/jobs/{job_id}. + string job_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Indicates that the request should be validated and default values + // populated, without persisting the request or creating any resources. + bool validate_only = 4; +} + +// Request message for obtaining a Job by its full name. +message GetJobRequest { + // Required. The full name of the Job. + // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + // can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Job" } + ]; +} + +// Request message for updating a Job. +message UpdateJobRequest { + // Required. The Job to be updated. + Job job = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates that the request should be validated and default values + // populated, without persisting the request or updating any resources. + bool validate_only = 3; + + // Optional. If set to true, and if the Job does not exist, it will create a + // new one. Caller must have both create and update permissions for this call + // if this is set to true. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for retrieving a list of Jobs. +message ListJobsRequest { + // Required. The location and project to list resources on. + // Format: projects/{project}/locations/{location}, where {project} can be + // project id or number. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "run.googleapis.com/Job" } + ]; + + // Maximum number of Jobs to return in this call. + int32 page_size = 2; + + // A page token received from a previous call to ListJobs. + // All other parameters must match. + string page_token = 3; + + // If true, returns deleted (but unexpired) resources along with active ones. + bool show_deleted = 4; +} + +// Response message containing a list of Jobs. +message ListJobsResponse { + // The resulting list of Jobs. + repeated Job jobs = 1; + + // A token indicating there are more items than page_size. Use it in the next + // ListJobs request to continue. + string next_page_token = 2; +} + +// Request message to delete a Job by its full name. +message DeleteJobRequest { + // Required. The full name of the Job. + // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + // can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Job" } + ]; + + // Indicates that the request should be validated without actually + // deleting any resources. + bool validate_only = 3; + + // A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 4; +} + +// Request message to create a new Execution of a Job. +message RunJobRequest { + // RunJob Overrides that contains Execution fields to be overridden. + message Overrides { + // Per-container override specification. + message ContainerOverride { + // The name of the container specified as a DNS_LABEL. + string name = 1; + + // Optional. Arguments to the entrypoint. Will replace existing args for + // override. + repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; + + // List of environment variables to set in the container. Will be merged + // with existing env for override. + repeated EnvVar env = 3; + + // Optional. True if the intention is to clear out existing args list. + bool clear_args = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Per container override specification. + repeated ContainerOverride container_overrides = 1; + + // Optional. The desired number of tasks the execution should run. Will + // replace existing task_count value. + int32 task_count = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Duration in seconds the task may be active before the system will + // actively try to mark it failed and kill associated containers. Will + // replace existing timeout_seconds value. + google.protobuf.Duration timeout = 4; + } + + // Required. The full name of the Job. + // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + // can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Job" } + ]; + + // Indicates that the request should be validated without actually + // deleting any resources. + bool validate_only = 2; + + // A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 3; + + // Overrides specification for a given execution of a job. If provided, + // overrides will be applied to update the execution or task spec. + Overrides overrides = 4; +} + +// Job represents the configuration of a single job, which references a +// container image that is run to completion. +message Job { + option (google.api.resource) = { + type: "run.googleapis.com/Job" + pattern: "projects/{project}/locations/{location}/jobs/{job}" + style: DECLARATIVE_FRIENDLY + }; + + // The fully qualified name of this Job. + // + // Format: + // projects/{project}/locations/{location}/jobs/{job} + string name = 1; + + // Output only. Server assigned unique identifier for the Execution. The value + // is a UUID4 string and guaranteed to remain unchanged until the resource is + // deleted. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A number that monotonically increases every time the user + // modifies the desired state. + int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Unstructured key value map that can be used to organize and categorize + // objects. + // User-provided labels are shared with Google's billing system, so they can + // be used to filter, or break down billing charges by team, component, + // environment, state, etc. For more information, visit + // https://cloud.google.com/resource-manager/docs/creating-managing-labels or + // https://cloud.google.com/run/docs/configuring/labels. + // + //

Cloud Run API v2 does not support labels with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected. All system labels in v1 now have a + // corresponding field in v2 Job. + map labels = 4; + + // Unstructured key value map that may + // be set by external tools to store and arbitrary metadata. + // They are not queryable and should be preserved + // when modifying objects. + // + //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected on new resources. All system + // annotations in v1 now have a corresponding field in v2 Job. + // + //

This field follows Kubernetes annotations' namespacing, limits, and + // rules. + map annotations = 5; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The deletion time. It is only populated as a response to a + // Delete request. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a deleted resource, the time after which it will be + // permamently deleted. + google.protobuf.Timestamp expire_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the authenticated creator. + string creator = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the last authenticated modifier. + string last_modifier = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Arbitrary identifier for the API client. + string client = 12; + + // Arbitrary version identifier for the API client. + string client_version = 13; + + // The launch stage as defined by [Google Cloud Platform + // Launch Stages](https://cloud.google.com/terms/launch-stages). + // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + // is assumed. + // Set the launch stage to a preview stage on input to allow use of preview + // features in that stage. On read (or output), describes whether the resource + // uses preview features. + // + // For example, if ALPHA is provided as input, but only BETA and GA-level + // features are used, this field will be BETA on output. + google.api.LaunchStage launch_stage = 14; + + // Settings for the Binary Authorization feature. + BinaryAuthorization binary_authorization = 15; + + // Required. The template used to create executions for this Job. + ExecutionTemplate template = 16 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The generation of this Job. See comments in `reconciling` for + // additional information on reconciliation process in Cloud Run. + int64 observed_generation = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Condition of this Job, containing its readiness status, + // and detailed error information in case it did not reach the desired state. + Condition terminal_condition = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Conditions of all other associated sub-resources. They + // contain additional diagnostics information in case the Job does not reach + // its desired state. See comments in `reconciling` for additional information + // on reconciliation process in Cloud Run. + repeated Condition conditions = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of executions created for this job. + int32 execution_count = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the last created execution. + ExecutionReference latest_created_execution = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Returns true if the Job is currently being acted upon by the + // system to bring it into the desired state. + // + // When a new Job is created, or an existing one is updated, Cloud Run + // will asynchronously perform all necessary steps to bring the Job to the + // desired state. This process is called reconciliation. + // While reconciliation is in process, `observed_generation` and + // `latest_succeeded_execution`, will have transient values that might + // mismatch the intended state: Once reconciliation is over (and this field is + // false), there are two possible outcomes: reconciliation succeeded and the + // state matches the Job, or there was an error, and reconciliation failed. + // This state can be found in `terminal_condition.state`. + // + // If reconciliation succeeded, the following fields will match: + // `observed_generation` and `generation`, `latest_succeeded_execution` and + // `latest_created_execution`. + // + // If reconciliation failed, `observed_generation` and + // `latest_succeeded_execution` will have the state of the last succeeded + // execution or empty for newly created Job. Additional information on the + // failure can be found in `terminal_condition` and `conditions`. + bool reconciling = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; + + oneof create_execution { + // A unique string used as a suffix creating a new execution. The Job will + // become ready when the execution is successfully started. + // The sum of job name and token length must be fewer than 63 characters. + string start_execution_token = 26; + + // A unique string used as a suffix for creating a new execution. The Job + // will become ready when the execution is successfully completed. + // The sum of job name and token length must be fewer than 63 characters. + string run_execution_token = 27; + } + + // Optional. A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 99 [(google.api.field_behavior) = OPTIONAL]; +} + +// Reference to an Execution. Use /Executions.GetExecution with the given name +// to get full execution including the latest status. +message ExecutionReference { + // Possible execution completion status. + enum CompletionStatus { + // The default value. This value is used if the state is omitted. + COMPLETION_STATUS_UNSPECIFIED = 0; + + // Job execution has succeeded. + EXECUTION_SUCCEEDED = 1; + + // Job execution has failed. + EXECUTION_FAILED = 2; + + // Job execution is running normally. + EXECUTION_RUNNING = 3; + + // Waiting for backing resources to be provisioned. + EXECUTION_PENDING = 4; + + // Job execution has been cancelled by the user. + EXECUTION_CANCELLED = 5; + } + + // Name of the execution. + string name = 1 [ + (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } + ]; + + // Creation timestamp of the execution. + google.protobuf.Timestamp create_time = 2; + + // Creation timestamp of the execution. + google.protobuf.Timestamp completion_time = 3; + + // The deletion time of the execution. It is only + // populated as a response to a Delete request. + google.protobuf.Timestamp delete_time = 5; + + // Status for the execution completion. + CompletionStatus completion_status = 4; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto new file mode 100644 index 00000000000..0fe03f27aac --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto @@ -0,0 +1,483 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "K8sMinProto"; +option java_package = "com.google.cloud.run.v2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/Secret" + pattern: "projects/{project}/secrets/{secret}" +}; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{version}" +}; +option (google.api.resource_definition) = { + type: "vpcaccess.googleapis.com/Connector" + pattern: "projects/{project}/locations/{location}/connectors/{connector}" +}; + +// A single application container. +// This specifies both the container to run, the command to run in the container +// and the arguments to supply to it. +// Note that additional arguments can be supplied by the system to the container +// at runtime. +message Container { + // Name of the container specified as a DNS_LABEL (RFC 1123). + string name = 1; + + // Required. Name of the container image in Dockerhub, Google Artifact + // Registry, or Google Container Registry. If the host is not provided, + // Dockerhub is assumed. + string image = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Location of the source. + SourceCode source_code = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Entrypoint array. Not executed within a shell. + // The docker image's ENTRYPOINT is used if this is not provided. + repeated string command = 3; + + // Arguments to the entrypoint. + // The docker image's CMD is used if this is not provided. + repeated string args = 4; + + // List of environment variables to set in the container. + repeated EnvVar env = 5; + + // Compute Resource requirements by this container. + ResourceRequirements resources = 6; + + // List of ports to expose from the container. Only a single port can be + // specified. The specified ports must be listening on all interfaces + // (0.0.0.0) within the container to be accessible. + // + // If omitted, a port number will be chosen and passed to the container + // through the PORT environment variable for the container to listen on. + repeated ContainerPort ports = 7; + + // Volume to mount into the container's filesystem. + repeated VolumeMount volume_mounts = 8; + + // Container's working directory. + // If not specified, the container runtime's default will be used, which + // might be configured in the container image. + string working_dir = 9; + + // Periodic probe of container liveness. + // Container will be restarted if the probe fails. + Probe liveness_probe = 10; + + // Startup probe of application within the container. + // All other probes are disabled if a startup probe is provided, until it + // succeeds. Container will not be added to service endpoints if the probe + // fails. + Probe startup_probe = 11; + + // Readiness probe to be used for health checks. + Probe readiness_probe = 14; + + // Names of the containers that must start before this container. + repeated string depends_on = 12; + + // Base image for this container. Only supported for services. If set, it + // indicates that the service is enrolled into automatic base image update. + string base_image_uri = 13; + + // Output only. The build info of the container image. + BuildInfo build_info = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ResourceRequirements describes the compute resource requirements. +message ResourceRequirements { + // Only `memory`, `cpu` and `nvidia.com/gpu` keys in the map are supported. + // + //

Notes: + // * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 + // CPU requires at least 2Gi of memory. For more information, go to + // https://cloud.google.com/run/docs/configuring/cpu. + // * For supported 'memory' values and syntax, go to + // https://cloud.google.com/run/docs/configuring/memory-limits + // * The only supported 'nvidia.com/gpu' value is '1'. + map limits = 1; + + // Determines whether CPU is only allocated during requests (true by default). + // However, if ResourceRequirements is set, the caller must explicitly + // set this field to true to preserve the default behavior. + bool cpu_idle = 2; + + // Determines whether CPU should be boosted on startup of a new container + // instance above the requested CPU threshold, this can help reduce cold-start + // latency. + bool startup_cpu_boost = 3; +} + +// EnvVar represents an environment variable present in a Container. +message EnvVar { + // Required. Name of the environment variable. Must not exceed 32768 + // characters. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + oneof values { + // Literal value of the environment variable. + // Defaults to "", and the maximum length is 32768 bytes. + // Variable references are not supported in Cloud Run. + string value = 2; + + // Source for the environment variable's value. + EnvVarSource value_source = 3; + } +} + +// EnvVarSource represents a source for the value of an EnvVar. +message EnvVarSource { + // Selects a secret and a specific version from Cloud Secret Manager. + SecretKeySelector secret_key_ref = 1; +} + +// SecretEnvVarSource represents a source for the value of an EnvVar. +message SecretKeySelector { + // Required. The name of the secret in Cloud Secret Manager. + // Format: {secret_name} if the secret is in the same project. + // projects/{project}/secrets/{secret_name} if the secret is + // in a different project. + string secret = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/Secret" + } + ]; + + // The Cloud Secret Manager secret version. + // Can be 'latest' for the latest version, an integer for a specific version, + // or a version alias. + string version = 2 [(google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + }]; +} + +// ContainerPort represents a network port in a single container. +message ContainerPort { + // If specified, used to specify which protocol to use. + // Allowed values are "http1" and "h2c". + string name = 1; + + // Port number the container listens on. + // This must be a valid TCP port number, 0 < container_port < 65536. + int32 container_port = 3; +} + +// VolumeMount describes a mounting of a Volume within a container. +message VolumeMount { + // Required. This must match the Name of a Volume. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Path within the container at which the volume should be mounted. + // Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must + // otherwise be `/cloudsql`. All instances defined in the Volume will be + // available as `/cloudsql/[instance]`. For more information on Cloud SQL + // volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run + string mount_path = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Path within the volume from which the container's volume should + // be mounted. Defaults to "" (volume's root). + string sub_path = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Volume represents a named volume in a container. +message Volume { + // Required. Volume's name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + oneof volume_type { + // Secret represents a secret that should populate this volume. + SecretVolumeSource secret = 2; + + // For Cloud SQL volumes, contains the specific instances that should be + // mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for + // more information on how to connect Cloud SQL and Cloud Run. + CloudSqlInstance cloud_sql_instance = 3; + + // Ephemeral storage used as a shared volume. + EmptyDirVolumeSource empty_dir = 4; + + // For NFS Voumes, contains the path to the nfs Volume + NFSVolumeSource nfs = 5; + + // Persistent storage backed by a Google Cloud Storage bucket. + GCSVolumeSource gcs = 6; + } +} + +// The secret's value will be presented as the content of a file whose +// name is defined in the item path. If no items are defined, the name of +// the file is the secret. +message SecretVolumeSource { + // Required. The name of the secret in Cloud Secret Manager. + // Format: {secret} if the secret is in the same project. + // projects/{project}/secrets/{secret} if the secret is + // in a different project. + string secret = 1 [(google.api.field_behavior) = REQUIRED]; + + // If unspecified, the volume will expose a file whose name is the + // secret, relative to VolumeMount.mount_path + VolumeMount.sub_path. + // If specified, the key will be used as the version to fetch from Cloud + // Secret Manager and the path will be the name of the file exposed in the + // volume. When items are defined, they must specify a path and a version. + repeated VersionToPath items = 2; + + // Integer representation of mode bits to use on created files by default. + // Must be a value between 0000 and 0777 (octal), defaulting to 0444. + // Directories within the path are not affected by this setting. + // + // Notes + // + // * Internally, a umask of 0222 will be applied to any non-zero value. + // * This is an integer representation of the mode bits. So, the octal + // integer value should look exactly as the chmod numeric notation with a + // leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + // or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + // 493 (base-10). + // * This might be in conflict with other options that affect the + // file mode, like fsGroup, and the result can be other mode bits set. + // + // This might be in conflict with other options that affect the + // file mode, like fsGroup, and as a result, other mode bits could be set. + int32 default_mode = 3; +} + +// VersionToPath maps a specific version of a secret to a relative file to mount +// to, relative to VolumeMount's mount_path. +message VersionToPath { + // Required. The relative path of the secret in the container. + string path = 1 [(google.api.field_behavior) = REQUIRED]; + + // The Cloud Secret Manager secret version. + // Can be 'latest' for the latest value, or an integer or a secret alias for a + // specific version. + string version = 2; + + // Integer octal mode bits to use on this file, must be a value between + // 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be + // used. + // + // Notes + // + // * Internally, a umask of 0222 will be applied to any non-zero value. + // * This is an integer representation of the mode bits. So, the octal + // integer value should look exactly as the chmod numeric notation with a + // leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) + // or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or + // 493 (base-10). + // * This might be in conflict with other options that affect the + // file mode, like fsGroup, and the result can be other mode bits set. + int32 mode = 3; +} + +// Represents a set of Cloud SQL instances. Each one will be available under +// /cloudsql/[instance]. Visit +// https://cloud.google.com/sql/docs/mysql/connect-run for more information on +// how to connect Cloud SQL and Cloud Run. +message CloudSqlInstance { + // The Cloud SQL instance connection names, as can be found in + // https://console.cloud.google.com/sql/instances. Visit + // https://cloud.google.com/sql/docs/mysql/connect-run for more information on + // how to connect Cloud SQL and Cloud Run. Format: + // {project}:{location}:{instance} + repeated string instances = 1; +} + +// In memory (tmpfs) ephemeral storage. +// It is ephemeral in the sense that when the sandbox is taken down, the data is +// destroyed with it (it does not persist across sandbox runs). +message EmptyDirVolumeSource { + // The different types of medium supported for EmptyDir. + enum Medium { + // When not specified, falls back to the default implementation which + // is currently in memory (this may change over time). + MEDIUM_UNSPECIFIED = 0; + + // Explicitly set the EmptyDir to be in memory. Uses tmpfs. + MEMORY = 1; + } + + // The medium on which the data is stored. Acceptable values today is only + // MEMORY or none. When none, the default will currently be backed by memory + // but could change over time. +optional + Medium medium = 1; + + // Limit on the storage usable by this EmptyDir volume. + // The size limit is also applicable for memory medium. + // The maximum usage on memory medium EmptyDir would be the minimum value + // between the SizeLimit specified here and the sum of memory limits of all + // containers. The default is nil which means that the limit is undefined. + // More info: + // https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. + // Info in Kubernetes: + // https://kubernetes.io/docs/concepts/storage/volumes/#emptydir + string size_limit = 2; +} + +// Represents an NFS mount. +message NFSVolumeSource { + // Hostname or IP address of the NFS server + string server = 1; + + // Path that is exported by the NFS server. + string path = 2; + + // If true, the volume will be mounted as read only for all mounts. + bool read_only = 3; +} + +// Represents a volume backed by a Cloud Storage bucket using Cloud Storage +// FUSE. +message GCSVolumeSource { + // Cloud Storage Bucket name. + string bucket = 1; + + // If true, the volume will be mounted as read only for all mounts. + bool read_only = 2; + + // A list of additional flags to pass to the gcsfuse CLI. + // Options should be specified without the leading "--". + repeated string mount_options = 3; +} + +// Probe describes a health check to be performed against a container to +// determine whether it is alive or ready to receive traffic. +message Probe { + // Optional. Number of seconds after the container has started before the + // probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum + // value for liveness probe is 3600. Maximum value for startup probe is 240. + int32 initial_delay_seconds = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of seconds after which the probe times out. + // Defaults to 1 second. Minimum value is 1. Maximum value is 3600. + // Must be smaller than period_seconds. + int32 timeout_seconds = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. How often (in seconds) to perform the probe. + // Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe + // is 3600. Maximum value for startup probe is 240. + // Must be greater or equal than timeout_seconds. + int32 period_seconds = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum consecutive failures for the probe to be considered + // failed after having succeeded. Defaults to 3. Minimum value is 1. + int32 failure_threshold = 4 [(google.api.field_behavior) = OPTIONAL]; + + oneof probe_type { + // Optional. HTTPGet specifies the http request to perform. + // Exactly one of httpGet, tcpSocket, or grpc must be specified. + HTTPGetAction http_get = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. TCPSocket specifies an action involving a TCP port. + // Exactly one of httpGet, tcpSocket, or grpc must be specified. + TCPSocketAction tcp_socket = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. GRPC specifies an action involving a gRPC port. + // Exactly one of httpGet, tcpSocket, or grpc must be specified. + GRPCAction grpc = 7 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// HTTPGetAction describes an action based on HTTP Get requests. +message HTTPGetAction { + // Optional. Path to access on the HTTP server. Defaults to '/'. + string path = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Custom headers to set in the request. HTTP allows repeated + // headers. + repeated HTTPHeader http_headers = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Port number to access on the container. Must be in the range 1 to + // 65535. If not specified, defaults to the exposed port of the container, + // which is the value of container.ports[0].containerPort. + int32 port = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// HTTPHeader describes a custom header to be used in HTTP probes +message HTTPHeader { + // Required. The header field name + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The header field value + string value = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// TCPSocketAction describes an action based on opening a socket +message TCPSocketAction { + // Optional. Port number to access on the container. Must be in the range 1 to + // 65535. If not specified, defaults to the exposed port of the container, + // which is the value of container.ports[0].containerPort. + int32 port = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// GRPCAction describes an action involving a GRPC port. +message GRPCAction { + // Optional. Port number of the gRPC service. Number must be in the range 1 to + // 65535. If not specified, defaults to the exposed port of the container, + // which is the value of container.ports[0].containerPort. + int32 port = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service is the name of the service to place in the gRPC + // HealthCheckRequest (see + // https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this + // is not specified, the default behavior is defined by gRPC. + string service = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Build information of the image. +message BuildInfo { + // Output only. Entry point of the function when the image is a Cloud Run + // function. + string function_target = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Source code location of the image. + string source_location = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Source type for the container. +message SourceCode { + // Cloud Storage source. + message CloudStorageSource { + // Required. The Cloud Storage bucket name. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Cloud Storage object name. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The Cloud Storage object generation. + int64 generation = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // The source type. + oneof source_type { + // The source is a Cloud Storage bucket. + CloudStorageSource cloud_storage_source = 1; + } +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto new file mode 100644 index 00000000000..8b75df33929 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto @@ -0,0 +1,331 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/launch_stage.proto"; +import "google/api/resource.proto"; +import "google/api/routing.proto"; +import "google/cloud/run/v2/condition.proto"; +import "google/cloud/run/v2/k8s.min.proto"; +import "google/cloud/run/v2/status.proto"; +import "google/cloud/run/v2/vendor_settings.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "RevisionProto"; +option java_package = "com.google.cloud.run.v2"; + +// Cloud Run Revision Control Plane API. +service Revisions { + option (google.api.default_host) = "run.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets information about a Revision. + rpc GetRevision(GetRevisionRequest) returns (Revision) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/services/*/revisions/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists Revisions from a given Service, or from a given location. Results + // are sorted by creation time, descending. + rpc ListRevisions(ListRevisionsRequest) returns (ListRevisionsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*/services/*}/revisions" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/workerPools/*}/revisions" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a Revision. + rpc DeleteRevision(DeleteRevisionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/services/*/revisions/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" + } + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Revision" + metadata_type: "Revision" + }; + } +} + +// Request message for obtaining a Revision by its full name. +message GetRevisionRequest { + // Required. The full name of the Revision. + // Format: + // projects/{project}/locations/{location}/services/{service}/revisions/{revision} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; +} + +// Request message for retrieving a list of Revisions. +message ListRevisionsRequest { + // Required. The Service from which the Revisions should be listed. + // To list all Revisions across Services, use "-" instead of Service name. + // Format: + // projects/{project}/locations/{location}/services/{service} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "run.googleapis.com/Revision" + } + ]; + + // Maximum number of revisions to return in this call. + int32 page_size = 2; + + // A page token received from a previous call to ListRevisions. + // All other parameters must match. + string page_token = 3; + + // If true, returns deleted (but unexpired) resources along with active ones. + bool show_deleted = 4; +} + +// Response message containing a list of Revisions. +message ListRevisionsResponse { + // The resulting list of Revisions. + repeated Revision revisions = 1; + + // A token indicating there are more items than page_size. Use it in the next + // ListRevisions request to continue. + string next_page_token = 2; +} + +// Request message for deleting a retired Revision. +// Revision lifecycle is usually managed by making changes to the parent +// Service. Only retired revisions can be deleted with this API. +message DeleteRevisionRequest { + // Required. The name of the Revision to delete. + // Format: + // projects/{project}/locations/{location}/services/{service}/revisions/{revision} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Indicates that the request should be validated without actually + // deleting any resources. + bool validate_only = 2; + + // A system-generated fingerprint for this version of the + // resource. This may be used to detect modification conflict during updates. + string etag = 3; +} + +// A Revision is an immutable snapshot of code and configuration. A Revision +// references a container image. Revisions are only created by updates to its +// parent Service. +message Revision { + option (google.api.resource) = { + type: "run.googleapis.com/Revision" + pattern: "projects/{project}/locations/{location}/services/{service}/revisions/{revision}" + style: DECLARATIVE_FRIENDLY + }; + + // Output only. The unique name of this Revision. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server assigned unique identifier for the Revision. The value + // is a UUID4 string and guaranteed to remain unchanged until the resource is + // deleted. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A number that monotonically increases every time the user + // modifies the desired state. + int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unstructured key value map that can be used to organize and + // categorize objects. User-provided labels are shared with Google's billing + // system, so they can be used to filter, or break down billing charges by + // team, component, environment, state, etc. For more information, visit + // https://cloud.google.com/resource-manager/docs/creating-managing-labels or + // https://cloud.google.com/run/docs/configuring/labels. + map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unstructured key value map that may + // be set by external tools to store and arbitrary metadata. + // They are not queryable and should be preserved + // when modifying objects. + map annotations = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a deleted resource, the deletion time. It is only + // populated as a response to a Delete request. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a deleted resource, the time after which it will be + // permamently deleted. It is only populated as a response to a Delete + // request. + google.protobuf.Timestamp expire_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The least stable launch stage needed to create this resource, as defined by + // [Google Cloud Platform Launch + // Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports + // `ALPHA`, `BETA`, and `GA`. + // + // Note that this value might not be what was used + // as input. For example, if ALPHA was provided as input in the parent + // resource, but only BETA and GA-level features are were, this field will be + // BETA. + google.api.LaunchStage launch_stage = 10; + + // Output only. The name of the parent service. + string service = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "run.googleapis.com/Service" } + ]; + + // Scaling settings for this revision. + RevisionScaling scaling = 12; + + // VPC Access configuration for this Revision. For more information, visit + // https://cloud.google.com/run/docs/configuring/connecting-vpc. + VpcAccess vpc_access = 13; + + // Sets the maximum number of requests that each serving instance can receive. + int32 max_instance_request_concurrency = 34; + + // Max allowed time for an instance to respond to a request. + google.protobuf.Duration timeout = 15; + + // Email address of the IAM service account associated with the revision of + // the service. The service account represents the identity of the running + // revision, and determines what permissions the revision has. + string service_account = 16; + + // Holds the single container that defines the unit of execution for this + // Revision. + repeated Container containers = 17; + + // A list of Volumes to make available to containers. + repeated Volume volumes = 18; + + // The execution environment being used to host this Revision. + ExecutionEnvironment execution_environment = 20; + + // A reference to a customer managed encryption key (CMEK) to use to encrypt + // this container image. For more information, go to + // https://cloud.google.com/run/docs/securing/using-cmek + string encryption_key = 21 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // Enables service mesh connectivity. + ServiceMesh service_mesh = 22; + + // The action to take if the encryption key is revoked. + EncryptionKeyRevocationAction encryption_key_revocation_action = 23; + + // If encryption_key_revocation_action is SHUTDOWN, the duration before + // shutting down all instances. The minimum increment is 1 hour. + google.protobuf.Duration encryption_key_shutdown_duration = 24; + + // Output only. Indicates whether the resource's reconciliation is still in + // progress. See comments in `Service.reconciling` for additional information + // on reconciliation process in Cloud Run. + bool reconciling = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Condition of this Revision, containing its readiness + // status, and detailed error information in case it did not reach a serving + // state. + repeated Condition conditions = 31 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The generation of this Revision currently serving traffic. See + // comments in `reconciling` for additional information on reconciliation + // process in Cloud Run. + int64 observed_generation = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Google Console URI to obtain logs for the Revision. + string log_uri = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 37 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Enable session affinity. + bool session_affinity = 38; + + // Output only. The current effective scaling settings for the revision. + RevisionScalingStatus scaling_status = 39 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The node selector for the revision. + NodeSelector node_selector = 40; + + // Optional. Output only. True if GPU zonal redundancy is disabled on this + // revision. + optional bool gpu_zonal_redundancy_disabled = 48 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. Email address of the authenticated creator. + string creator = 49 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto new file mode 100644 index 00000000000..b29c95c4892 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto @@ -0,0 +1,131 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/run/v2/k8s.min.proto"; +import "google/cloud/run/v2/vendor_settings.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "RevisionTemplateProto"; +option java_package = "com.google.cloud.run.v2"; + +// RevisionTemplate describes the data a revision should have when created from +// a template. +message RevisionTemplate { + // Optional. The unique name for the revision. If this field is omitted, it + // will be automatically generated based on the Service name. + string revision = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Optional. Unstructured key value map that can be used to organize and + // categorize objects. User-provided labels are shared with Google's billing + // system, so they can be used to filter, or break down billing charges by + // team, component, environment, state, etc. For more information, visit + // https://cloud.google.com/resource-manager/docs/creating-managing-labels or + // https://cloud.google.com/run/docs/configuring/labels. + // + //

Cloud Run API v2 does not support labels with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected. All system labels in v1 now have a + // corresponding field in v2 RevisionTemplate. + map labels = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Unstructured key value map that may be set by external tools to + // store and arbitrary metadata. They are not queryable and should be + // preserved when modifying objects. + // + //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected. All system annotations in v1 now + // have a corresponding field in v2 RevisionTemplate. + // + //

This field follows Kubernetes annotations' namespacing, limits, and + // rules. + map annotations = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Scaling settings for this Revision. + RevisionScaling scaling = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. VPC Access configuration to use for this Revision. For more + // information, visit + // https://cloud.google.com/run/docs/configuring/connecting-vpc. + VpcAccess vpc_access = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Max allowed time for an instance to respond to a request. + google.protobuf.Duration timeout = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email address of the IAM service account associated with the + // revision of the service. The service account represents the identity of the + // running revision, and determines what permissions the revision has. If not + // provided, the revision will use the project's default service account. + string service_account = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Holds the single container that defines the unit of execution for this + // Revision. + repeated Container containers = 10; + + // Optional. A list of Volumes to make available to containers. + repeated Volume volumes = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The sandbox environment to host this Revision. + ExecutionEnvironment execution_environment = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // A reference to a customer managed encryption key (CMEK) to use to encrypt + // this container image. For more information, go to + // https://cloud.google.com/run/docs/securing/using-cmek + string encryption_key = 14 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // Optional. Sets the maximum number of requests that each serving instance + // can receive. If not specified or 0, concurrency defaults to 80 when + // requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + int32 max_instance_request_concurrency = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables service mesh connectivity. + ServiceMesh service_mesh = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The action to take if the encryption key is revoked. + EncryptionKeyRevocationAction encryption_key_revocation_action = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If encryption_key_revocation_action is SHUTDOWN, the duration + // before shutting down all instances. The minimum increment is 1 hour. + google.protobuf.Duration encryption_key_shutdown_duration = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enable session affinity. + bool session_affinity = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Disables health checking containers during deployment. + bool health_check_disabled = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The node selector for the revision template. + NodeSelector node_selector = 21 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True if GPU zonal redundancy is disabled on this revision. + optional bool gpu_zonal_redundancy_disabled = 24 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto new file mode 100644 index 00000000000..506638a1a07 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto @@ -0,0 +1,520 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/launch_stage.proto"; +import "google/api/resource.proto"; +import "google/api/routing.proto"; +import "google/cloud/run/v2/condition.proto"; +import "google/cloud/run/v2/revision_template.proto"; +import "google/cloud/run/v2/traffic_target.proto"; +import "google/cloud/run/v2/vendor_settings.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.run.v2"; + +// Cloud Run Service Control Plane API +service Services { + option (google.api.default_host) = "run.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new Service in a given project and location. + rpc CreateService(CreateServiceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/services" + body: "service" + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + }; + option (google.api.method_signature) = "parent,service,service_id"; + option (google.longrunning.operation_info) = { + response_type: "Service" + metadata_type: "Service" + }; + } + + // Gets information about a Service. + rpc GetService(GetServiceRequest) returns (Service) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/services/*}" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists Services. Results are sorted by creation time, descending. + rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/services" + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a Service. + rpc UpdateService(UpdateServiceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{service.name=projects/*/locations/*/services/*}" + body: "service" + }; + option (google.api.routing) = { + routing_parameters { + field: "service.name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "service"; + option (google.api.method_signature) = "service,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Service" + metadata_type: "Service" + }; + } + + // Deletes a Service. + // This will cause the Service to stop serving traffic and will delete all + // revisions. + rpc DeleteService(DeleteServiceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/services/*}" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Service" + metadata_type: "Service" + }; + } + + // Gets the IAM Access Control policy currently in effect for the given + // Cloud Run Service. This result does not include any inherited policies. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + get: "/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy" + }; + } + + // Sets the IAM Access control policy for the specified Service. Overwrites + // any existing policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy" + body: "*" + }; + } + + // Returns permissions that a caller has on the specified Project. + // + // There are no permissions required for making this API call. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions" + body: "*" + }; + } +} + +// Request message for creating a Service. +message CreateServiceRequest { + // Required. The location and project in which this service should be created. + // Format: projects/{project}/locations/{location}, where {project} can be + // project id or number. Only lowercase characters, digits, and hyphens. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "run.googleapis.com/Service" + } + ]; + + // Required. The Service instance to create. + Service service = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The unique identifier for the Service. It must begin with letter, + // and cannot end with hyphen; must contain fewer than 50 characters. + // The name of the service becomes {parent}/services/{service_id}. + string service_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Indicates that the request should be validated and default values + // populated, without persisting the request or creating any resources. + bool validate_only = 4; +} + +// Request message for updating a service. +message UpdateServiceRequest { + // Optional. The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The Service to be updated. + Service service = 1 [(google.api.field_behavior) = REQUIRED]; + + // Indicates that the request should be validated and default values + // populated, without persisting the request or updating any resources. + bool validate_only = 3; + + // Optional. If set to true, and if the Service does not exist, it will create + // a new one. The caller must have 'run.services.create' permissions if this + // is set to true and the Service does not exist. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for retrieving a list of Services. +message ListServicesRequest { + // Required. The location and project to list resources on. + // Location must be a valid Google Cloud region, and cannot be the "-" + // wildcard. Format: projects/{project}/locations/{location}, where {project} + // can be project id or number. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "run.googleapis.com/Service" + } + ]; + + // Maximum number of Services to return in this call. + int32 page_size = 2; + + // A page token received from a previous call to ListServices. + // All other parameters must match. + string page_token = 3; + + // If true, returns deleted (but unexpired) resources along with active ones. + bool show_deleted = 4; +} + +// Response message containing a list of Services. +message ListServicesResponse { + // The resulting list of Services. + repeated Service services = 1; + + // A token indicating there are more items than page_size. Use it in the next + // ListServices request to continue. + string next_page_token = 2; + + // Output only. For global requests, returns the list of regions that could + // not be reached within the deadline. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for obtaining a Service by its full name. +message GetServiceRequest { + // Required. The full name of the Service. + // Format: projects/{project}/locations/{location}/services/{service}, where + // {project} can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Service" } + ]; +} + +// Request message to delete a Service by its full name. +message DeleteServiceRequest { + // Required. The full name of the Service. + // Format: projects/{project}/locations/{location}/services/{service}, where + // {project} can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Service" } + ]; + + // Indicates that the request should be validated without actually + // deleting any resources. + bool validate_only = 2; + + // A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 3; +} + +// Service acts as a top-level container that manages a set of +// configurations and revision templates which implement a network service. +// Service exists to provide a singular abstraction which can be access +// controlled, reasoned about, and which encapsulates software lifecycle +// decisions such as rollout policy and team resource ownership. +message Service { + option (google.api.resource) = { + type: "run.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/services/{service}" + style: DECLARATIVE_FRIENDLY + }; + + // Settings for multi-region deployment. + message MultiRegionSettings { + // Required. List of regions to deploy to, including primary region. + repeated string regions = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. System-generated unique id for the multi-region Service. + string multi_region_id = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Identifier. The fully qualified name of this Service. In + // CreateServiceRequest, this field is ignored, and instead composed from + // CreateServiceRequest.parent and CreateServiceRequest.service_id. + // + // Format: + // projects/{project}/locations/{location}/services/{service_id} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // User-provided description of the Service. This field currently has a + // 512-character limit. + string description = 2; + + // Output only. Server assigned unique identifier for the trigger. The value + // is a UUID4 string and guaranteed to remain unchanged until the resource is + // deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A number that monotonically increases every time the user + // modifies the desired state. + // Please note that unlike v1, this is an int64 value. As with most Google + // APIs, its JSON representation will be a `string` instead of an `integer`. + int64 generation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Unstructured key value map that can be used to organize and + // categorize objects. User-provided labels are shared with Google's billing + // system, so they can be used to filter, or break down billing charges by + // team, component, environment, state, etc. For more information, visit + // https://cloud.google.com/resource-manager/docs/creating-managing-labels or + // https://cloud.google.com/run/docs/configuring/labels. + // + //

Cloud Run API v2 does not support labels with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected. All system labels in v1 now have a + // corresponding field in v2 Service. + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Unstructured key value map that may be set by external tools to + // store and arbitrary metadata. They are not queryable and should be + // preserved when modifying objects. + // + //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected in new resources. All system + // annotations in v1 now have a corresponding field in v2 Service. + // + //

This field follows Kubernetes + // annotations' namespacing, limits, and rules. + map annotations = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The deletion time. It is only populated as a response to a + // Delete request. + google.protobuf.Timestamp delete_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a deleted resource, the time after which it will be + // permanently deleted. + google.protobuf.Timestamp expire_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the authenticated creator. + string creator = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the last authenticated modifier. + string last_modifier = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Arbitrary identifier for the API client. + string client = 13; + + // Arbitrary version identifier for the API client. + string client_version = 14; + + // Optional. Provides the ingress settings for this Service. On output, + // returns the currently observed ingress settings, or + // INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. + IngressTraffic ingress = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The launch stage as defined by [Google Cloud Platform + // Launch Stages](https://cloud.google.com/terms/launch-stages). + // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + // is assumed. + // Set the launch stage to a preview stage on input to allow use of preview + // features in that stage. On read (or output), describes whether the resource + // uses preview features. + // + // For example, if ALPHA is provided as input, but only BETA and GA-level + // features are used, this field will be BETA on output. + google.api.LaunchStage launch_stage = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings for the Binary Authorization feature. + BinaryAuthorization binary_authorization = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The template used to create revisions for this Service. + RevisionTemplate template = 18 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies how to distribute traffic over a collection of + // Revisions belonging to the Service. If traffic is empty or not provided, + // defaults to 100% traffic to the latest `Ready` Revision. + repeated TrafficTarget traffic = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies service-level scaling settings + ServiceScaling scaling = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Disables IAM permission check for run.routes.invoke for callers + // of this service. For more information, visit + // https://cloud.google.com/run/docs/securing/managing-access#invoker_check. + bool invoker_iam_disabled = 21 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Disables public resolution of the default URI of this service. + bool default_uri_disabled = 22 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. All URLs serving traffic for this Service. + repeated string urls = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. IAP settings on the Service. + bool iap_enabled = 25 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings for multi-region deployment. + MultiRegionSettings multi_region_settings = 26 + [(google.api.field_behavior) = OPTIONAL]; + + // One or more custom audiences that you want this service to support. Specify + // each custom audience as the full URL in a string. The custom audiences are + // encoded in the token and used to authenticate requests. For more + // information, see + // https://cloud.google.com/run/docs/configuring/custom-audiences. + repeated string custom_audiences = 37; + + // Output only. The generation of this Service currently serving traffic. See + // comments in `reconciling` for additional information on reconciliation + // process in Cloud Run. Please note that unlike v1, this is an int64 value. + // As with most Google APIs, its JSON representation will be a `string` + // instead of an `integer`. + int64 observed_generation = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Condition of this Service, containing its readiness + // status, and detailed error information in case it did not reach a serving + // state. See comments in `reconciling` for additional information on + // reconciliation process in Cloud Run. + Condition terminal_condition = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Conditions of all other associated sub-resources. They + // contain additional diagnostics information in case the Service does not + // reach its Serving state. See comments in `reconciling` for additional + // information on reconciliation process in Cloud Run. + repeated Condition conditions = 32 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the latest revision that is serving traffic. See + // comments in `reconciling` for additional information on reconciliation + // process in Cloud Run. + string latest_ready_revision = 33 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Output only. Name of the last created revision. See comments in + // `reconciling` for additional information on reconciliation process in Cloud + // Run. + string latest_created_revision = 34 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Output only. Detailed status information for corresponding traffic targets. + // See comments in `reconciling` for additional information on reconciliation + // process in Cloud Run. + repeated TrafficTargetStatus traffic_statuses = 35 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The main URI in which this Service is serving traffic. + string uri = 36 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. True if Cloud Run Threat Detection monitoring is enabled for + // the parent project of this Service. + bool threat_detection_enabled = 40 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for building a Cloud Run function. + BuildConfig build_config = 41 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Returns true if the Service is currently being acted upon by + // the system to bring it into the desired state. + // + // When a new Service is created, or an existing one is updated, Cloud Run + // will asynchronously perform all necessary steps to bring the Service to the + // desired serving state. This process is called reconciliation. + // While reconciliation is in process, `observed_generation`, + // `latest_ready_revision`, `traffic_statuses`, and `uri` will have transient + // values that might mismatch the intended state: Once reconciliation is over + // (and this field is false), there are two possible outcomes: reconciliation + // succeeded and the serving state matches the Service, or there was an error, + // and reconciliation failed. This state can be found in + // `terminal_condition.state`. + // + // If reconciliation succeeded, the following fields will match: `traffic` and + // `traffic_statuses`, `observed_generation` and `generation`, + // `latest_ready_revision` and `latest_created_revision`. + // + // If reconciliation failed, `traffic_statuses`, `observed_generation`, and + // `latest_ready_revision` will have the state of the last serving revision, + // or empty for newly created Services. Additional information on the failure + // can be found in `terminal_condition` and `conditions`. + bool reconciling = 98 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 99 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto new file mode 100644 index 00000000000..68e98cfd839 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto @@ -0,0 +1,28 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "StatusProto"; +option java_package = "com.google.cloud.run.v2"; + +// Effective settings for the current revision +message RevisionScalingStatus { + // The current number of min instances provisioned for this revision. + int32 desired_min_instance_count = 1; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto new file mode 100644 index 00000000000..a4bb905576e --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto @@ -0,0 +1,291 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/run/v2/condition.proto"; +import "google/cloud/run/v2/k8s.min.proto"; +import "google/cloud/run/v2/vendor_settings.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "TaskProto"; +option java_package = "com.google.cloud.run.v2"; + +// Cloud Run Task Control Plane API. +service Tasks { + option (google.api.default_host) = "run.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets information about a Task. + rpc GetTask(GetTaskRequest) returns (Task) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Tasks from an Execution of a Job. + rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for obtaining a Task by its full name. +message GetTaskRequest { + // Required. The full name of the Task. + // Format: + // projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/Task" } + ]; +} + +// Request message for retrieving a list of Tasks. +message ListTasksRequest { + // Required. The Execution from which the Tasks should be listed. + // To list all Tasks across Executions of a Job, use "-" instead of Execution + // name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + // projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "run.googleapis.com/Task" } + ]; + + // Maximum number of Tasks to return in this call. + int32 page_size = 2; + + // A page token received from a previous call to ListTasks. + // All other parameters must match. + string page_token = 3; + + // If true, returns deleted (but unexpired) resources along with active ones. + bool show_deleted = 4; +} + +// Response message containing a list of Tasks. +message ListTasksResponse { + // The resulting list of Tasks. + repeated Task tasks = 1; + + // A token indicating there are more items than page_size. Use it in the next + // ListTasks request to continue. + string next_page_token = 2; +} + +// Task represents a single run of a container to completion. +message Task { + option (google.api.resource) = { + type: "run.googleapis.com/Task" + pattern: "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}" + style: DECLARATIVE_FRIENDLY + }; + + // Output only. The unique name of this Task. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server assigned unique identifier for the Task. The value is a + // UUID4 string and guaranteed to remain unchanged until the resource is + // deleted. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A number that monotonically increases every time the user + // modifies the desired state. + int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unstructured key value map that can be used to organize and + // categorize objects. User-provided labels are shared with Google's billing + // system, so they can be used to filter, or break down billing charges by + // team, component, environment, state, etc. For more information, visit + // https://cloud.google.com/resource-manager/docs/creating-managing-labels or + // https://cloud.google.com/run/docs/configuring/labels + map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unstructured key value map that may + // be set by external tools to store and arbitrary metadata. + // They are not queryable and should be preserved + // when modifying objects. + map annotations = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents time when the task was created by the system. + // It is not guaranteed to be set in happens-before order across separate + // operations. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents time when the task was scheduled to run by the + // system. It is not guaranteed to be set in happens-before order across + // separate operations. + google.protobuf.Timestamp scheduled_time = 34 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents time when the task started to run. + // It is not guaranteed to be set in happens-before order across separate + // operations. + google.protobuf.Timestamp start_time = 27 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Represents time when the Task was completed. It is not + // guaranteed to be set in happens-before order across separate operations. + google.protobuf.Timestamp completion_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a deleted resource, the deletion time. It is only + // populated as a response to a Delete request. + google.protobuf.Timestamp delete_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a deleted resource, the time after which it will be + // permamently deleted. It is only populated as a response to a Delete + // request. + google.protobuf.Timestamp expire_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the parent Job. + string job = 12 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "run.googleapis.com/Job" } + ]; + + // Output only. The name of the parent Execution. + string execution = 13 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } + ]; + + // Holds the single container that defines the unit of execution for this + // task. + repeated Container containers = 14; + + // A list of Volumes to make available to containers. + repeated Volume volumes = 15; + + // Number of retries allowed per Task, before marking this Task failed. + int32 max_retries = 16; + + // Max allowed time duration the Task may be active before the system will + // actively try to mark it failed and kill associated containers. This applies + // per attempt of a task, meaning each retry can run for the full timeout. + google.protobuf.Duration timeout = 17; + + // Email address of the IAM service account associated with the Task of a + // Job. The service account represents the identity of the + // running task, and determines what permissions the task has. If + // not provided, the task will use the project's default service account. + string service_account = 18; + + // The execution environment being used to host this Task. + ExecutionEnvironment execution_environment = 20; + + // Output only. Indicates whether the resource's reconciliation is still in + // progress. See comments in `Job.reconciling` for additional information on + // reconciliation process in Cloud Run. + bool reconciling = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Condition of this Task, containing its readiness status, + // and detailed error information in case it did not reach the desired state. + repeated Condition conditions = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The generation of this Task. See comments in `Job.reconciling` + // for additional information on reconciliation process in Cloud Run. + int64 observed_generation = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Index of the Task, unique per execution, and beginning at 0. + int32 index = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of times this Task was retried. + // Tasks are retried when they fail up to the maxRetries limit. + int32 retried = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Result of the last attempt of this Task. + TaskAttemptResult last_attempt_result = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A reference to a customer managed encryption key (CMEK) to use + // to encrypt this container image. For more information, go to + // https://cloud.google.com/run/docs/securing/using-cmek + string encryption_key = 28 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. VPC Access configuration to use for this Task. For more + // information, visit + // https://cloud.google.com/run/docs/configuring/connecting-vpc. + VpcAccess vpc_access = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. URI where logs for this execution can be found in Cloud + // Console. + string log_uri = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The node selector for the task. + NodeSelector node_selector = 36 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Output only. True if GPU zonal redundancy is disabled on this + // task. + optional bool gpu_zonal_redundancy_disabled = 37 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Result of a task attempt. +message TaskAttemptResult { + // Output only. The status of this attempt. + // If the status code is OK, then the attempt succeeded. + google.rpc.Status status = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The exit code of this attempt. + // This may be unset if the container was unable to exit cleanly with a code + // due to some other failure. + // See status field for possible failure details. + // + // At most one of exit_code or term_signal will be set. + int32 exit_code = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Termination signal of the container. This is set to non-zero + // if the container is terminated by the system. + // + // At most one of exit_code or term_signal will be set. + int32 term_signal = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto new file mode 100644 index 00000000000..fddfe2d394d --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/run/v2/k8s.min.proto"; +import "google/cloud/run/v2/vendor_settings.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "TaskTemplateProto"; +option java_package = "com.google.cloud.run.v2"; + +// TaskTemplate describes the data a task should have when created +// from a template. +message TaskTemplate { + // Holds the single container that defines the unit of execution for this + // task. + repeated Container containers = 1; + + // Optional. A list of Volumes to make available to containers. + repeated Volume volumes = 2 [(google.api.field_behavior) = OPTIONAL]; + + oneof retries { + // Number of retries allowed per Task, before marking this Task failed. + // Defaults to 3. + int32 max_retries = 3; + } + + // Optional. Max allowed time duration the Task may be active before the + // system will actively try to mark it failed and kill associated containers. + // This applies per attempt of a task, meaning each retry can run for the full + // timeout. Defaults to 600 seconds. + google.protobuf.Duration timeout = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email address of the IAM service account associated with the Task + // of a Job. The service account represents the identity of the running task, + // and determines what permissions the task has. If not provided, the task + // will use the project's default service account. + string service_account = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The execution environment being used to host this Task. + ExecutionEnvironment execution_environment = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // A reference to a customer managed encryption key (CMEK) to use to encrypt + // this container image. For more information, go to + // https://cloud.google.com/run/docs/securing/using-cmek + string encryption_key = 7 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // Optional. VPC Access configuration to use for this Task. For more + // information, visit + // https://cloud.google.com/run/docs/configuring/connecting-vpc. + VpcAccess vpc_access = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The node selector for the task template. + NodeSelector node_selector = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True if GPU zonal redundancy is disabled on this task template. + optional bool gpu_zonal_redundancy_disabled = 12 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto new file mode 100644 index 00000000000..7dfec861029 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "TrafficTargetProto"; +option java_package = "com.google.cloud.run.v2"; + +// Holds a single traffic routing entry for the Service. Allocations can be done +// to a specific Revision name, or pointing to the latest Ready Revision. +message TrafficTarget { + // The allocation type for this traffic target. + TrafficTargetAllocationType type = 1; + + // Revision to which to send this portion of traffic, if traffic allocation is + // by revision. + string revision = 2 [ + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Specifies percent of the traffic to this Revision. + // This defaults to zero if unspecified. + int32 percent = 3; + + // Indicates a string to be part of the URI to exclusively reference this + // target. + string tag = 4; +} + +// Represents the observed state of a single `TrafficTarget` entry. +message TrafficTargetStatus { + // The allocation type for this traffic target. + TrafficTargetAllocationType type = 1; + + // Revision to which this traffic is sent. + string revision = 2 [ + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Specifies percent of the traffic to this Revision. + int32 percent = 3; + + // Indicates the string used in the URI to exclusively reference this target. + string tag = 4; + + // Displays the target URI. + string uri = 5; +} + +// The type of instance allocation. +enum TrafficTargetAllocationType { + // Unspecified instance allocation type. + TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0; + + // Allocates instances to the Service's latest ready Revision. + TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1; + + // Allocates instances to a Revision by name. + TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto new file mode 100644 index 00000000000..67074b4c875 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto @@ -0,0 +1,285 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "VendorSettingsProto"; +option java_package = "com.google.cloud.run.v2"; +option (google.api.resource_definition) = { + type: "binaryauthorization.googleapis.com/Policy" + pattern: "projects/{project}/policy" + pattern: "locations/{location}/policy" +}; +option (google.api.resource_definition) = { + type: "networkservices.googleapis.com/Mesh" + pattern: "projects/{project}/locations/{location}/meshes/{mesh}" +}; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/Build" + pattern: "projects/{project}/locations/{location}/builds/{build}" +}; + +// VPC Access settings. For more information on sending traffic to a VPC +// network, visit https://cloud.google.com/run/docs/configuring/connecting-vpc. +message VpcAccess { + // Egress options for VPC access. + enum VpcEgress { + // Unspecified + VPC_EGRESS_UNSPECIFIED = 0; + + // All outbound traffic is routed through the VPC connector. + ALL_TRAFFIC = 1; + + // Only private IP ranges are routed through the VPC connector. + PRIVATE_RANGES_ONLY = 2; + } + + // Direct VPC egress settings. + message NetworkInterface { + // Optional. The VPC network that the Cloud Run resource will be able to + // send traffic to. At least one of network or subnetwork must be specified. + // If both network and subnetwork are specified, the given VPC subnetwork + // must belong to the given VPC network. If network is not specified, it + // will be looked up from the subnetwork. + string network = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The VPC subnetwork that the Cloud Run resource will get IPs + // from. At least one of network or subnetwork must be specified. If both + // network and subnetwork are specified, the given VPC subnetwork must + // belong to the given VPC network. If subnetwork is not specified, the + // subnetwork with the same name with the network will be used. + string subnetwork = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Network tags applied to this Cloud Run resource. + repeated string tags = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // VPC Access connector name. + // Format: `projects/{project}/locations/{location}/connectors/{connector}`, + // where `{project}` can be project id or number. + // For more information on sending traffic to a VPC network via a connector, + // visit https://cloud.google.com/run/docs/configuring/vpc-connectors. + string connector = 1 [(google.api.resource_reference) = { + type: "vpcaccess.googleapis.com/Connector" + }]; + + // Optional. Traffic VPC egress settings. If not provided, it defaults to + // PRIVATE_RANGES_ONLY. + VpcEgress egress = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Direct VPC egress settings. Currently only single network + // interface is supported. + repeated NetworkInterface network_interfaces = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for Binary Authorization feature. +message BinaryAuthorization { + oneof binauthz_method { + // Optional. If True, indicates to use the default project's binary + // authorization policy. If False, binary authorization will be disabled. + bool use_default = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The path to a binary authorization policy. + // Format: `projects/{project}/platforms/cloudRun/{policy-name}` + string policy = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "binaryauthorization.googleapis.com/Policy" + } + ]; + } + + // Optional. If present, indicates to use Breakglass using this justification. + // If use_default is False, then it must be empty. + // For more information on breakglass, see + // https://cloud.google.com/binary-authorization/docs/using-breakglass + string breakglass_justification = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for revision-level scaling settings. +message RevisionScaling { + // Optional. Minimum number of serving instances that this resource should + // have. + int32 min_instance_count = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of serving instances that this resource should + // have. When unspecified, the field is set to the server default value of + // 100. For more information see + // https://cloud.google.com/run/docs/configuring/max-instances + int32 max_instance_count = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for Cloud Service Mesh. For more information see +// https://cloud.google.com/service-mesh/docs/overview. +message ServiceMesh { + // The Mesh resource name. Format: + // `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + // be project id or number. + string mesh = 1 [(google.api.resource_reference) = { + type: "networkservices.googleapis.com/Mesh" + }]; +} + +// Scaling settings applied at the service level rather than +// at the revision level. +message ServiceScaling { + // The scaling mode for the service. If not provided, it defaults to + // AUTOMATIC. + enum ScalingMode { + // Unspecified. + SCALING_MODE_UNSPECIFIED = 0; + + // Scale based on traffic between min and max instances. + AUTOMATIC = 1; + + // Scale to exactly min instances and ignore max instances. + MANUAL = 2; + } + + // Optional. total min instances for the service. This number of instances is + // divided among all revisions with specified traffic based on the percent + // of traffic they are receiving. + int32 min_instance_count = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The scaling mode for the service. + ScalingMode scaling_mode = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. total max instances for the service. This number of instances is + // divided among all revisions with specified traffic based on the percent + // of traffic they are receiving. + int32 max_instance_count = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. total instance count for the service in manual scaling mode. This + // number of instances is divided among all revisions with specified traffic + // based on the percent of traffic they are receiving. + optional int32 manual_instance_count = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Worker pool scaling settings. +message WorkerPoolScaling { + // Optional. The total number of instances in manual scaling mode. + optional int32 manual_instance_count = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Hardware constraints configuration. +message NodeSelector { + // Required. GPU accelerator type to attach to an instance. + string accelerator = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Describes the Build step of the function that builds a container from the +// given source. +message BuildConfig { + // Output only. The Cloud Build name of the latest successful deployment of + // the function. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // The Cloud Storage bucket URI where the function source code is located. + string source_location = 2; + + // Optional. The name of the function (as defined in source code) that will be + // executed. Defaults to the resource name suffix, if not specified. For + // backward compatibility, if function with given name is not found, then the + // system will try to use function named "function". + string function_target = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Artifact Registry URI to store the built image. + string image_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The base image used to build the function. + string base_image = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sets whether the function will receive automatic base image + // updates. + bool enable_automatic_updates = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Name of the Cloud Build Custom Worker Pool that should be used to + // build the Cloud Run function. The format of this field is + // `projects/{project}/locations/{region}/workerPools/{workerPool}` where + // `{project}` and `{region}` are the project id and region respectively where + // the worker pool is defined and `{workerPool}` is the short name of the + // worker pool. + string worker_pool = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/BuildWorkerPool" + } + ]; + + // Optional. User-provided build-time environment variables for the function + map environment_variables = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service account to be used for building the container. The format + // of this field is + // `projects/{projectId}/serviceAccounts/{serviceAccountEmail}`. + string service_account = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Allowed ingress traffic for the Container. +enum IngressTraffic { + // Unspecified + INGRESS_TRAFFIC_UNSPECIFIED = 0; + + // All inbound traffic is allowed. + INGRESS_TRAFFIC_ALL = 1; + + // Only internal traffic is allowed. + INGRESS_TRAFFIC_INTERNAL_ONLY = 2; + + // Both internal and Google Cloud Load Balancer traffic is allowed. + INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; + + // No ingress traffic is allowed. + INGRESS_TRAFFIC_NONE = 4; +} + +// Alternatives for execution environments. +enum ExecutionEnvironment { + // Unspecified + EXECUTION_ENVIRONMENT_UNSPECIFIED = 0; + + // Uses the First Generation environment. + EXECUTION_ENVIRONMENT_GEN1 = 1; + + // Uses Second Generation environment. + EXECUTION_ENVIRONMENT_GEN2 = 2; +} + +// Specifies behavior if an encryption key used by a resource is revoked. +enum EncryptionKeyRevocationAction { + // Unspecified + ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0; + + // Prevents the creation of new instances. + PREVENT_NEW = 1; + + // Shuts down existing instances, and prevents creation of new ones. + SHUTDOWN = 2; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto new file mode 100644 index 00000000000..5a19ae2b1ef --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto @@ -0,0 +1,492 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/launch_stage.proto"; +import "google/api/resource.proto"; +import "google/api/routing.proto"; +import "google/cloud/run/v2/condition.proto"; +import "google/cloud/run/v2/instance_split.proto"; +import "google/cloud/run/v2/vendor_settings.proto"; +import "google/cloud/run/v2/worker_pool_revision_template.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "WorkerPoolProto"; +option java_package = "com.google.cloud.run.v2"; + +// Cloud Run WorkerPool Control Plane API. +service WorkerPools { + option (google.api.default_host) = "run.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new WorkerPool in a given project and location. + rpc CreateWorkerPool(CreateWorkerPoolRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/locations/*}/workerPools" + body: "worker_pool" + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + }; + option (google.api.method_signature) = "parent,worker_pool,worker_pool_id"; + option (google.longrunning.operation_info) = { + response_type: "WorkerPool" + metadata_type: "WorkerPool" + }; + } + + // Gets information about a WorkerPool. + rpc GetWorkerPool(GetWorkerPoolRequest) returns (WorkerPool) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/workerPools/*}" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists WorkerPools. Results are sorted by creation time, descending. + rpc ListWorkerPools(ListWorkerPoolsRequest) + returns (ListWorkerPoolsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/workerPools" + }; + option (google.api.routing) = { + routing_parameters { + field: "parent" + path_template: "projects/*/locations/{location=*}" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a WorkerPool. + rpc UpdateWorkerPool(UpdateWorkerPoolRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{worker_pool.name=projects/*/locations/*/workerPools/*}" + body: "worker_pool" + }; + option (google.api.routing) = { + routing_parameters { + field: "worker_pool.name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "worker_pool"; + option (google.api.method_signature) = "worker_pool,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "WorkerPool" + metadata_type: "WorkerPool" + }; + } + + // Deletes a WorkerPool. + rpc DeleteWorkerPool(DeleteWorkerPoolRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/locations/*/workerPools/*}" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "projects/*/locations/{location=*}/**" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "WorkerPool" + metadata_type: "WorkerPool" + }; + } + + // Gets the IAM Access Control policy currently in effect for the given + // Cloud Run WorkerPool. This result does not include any inherited policies. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + get: "/v2/{resource=projects/*/locations/*/workerPools/*}:getIamPolicy" + }; + } + + // Sets the IAM Access control policy for the specified WorkerPool. Overwrites + // any existing policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/locations/*/workerPools/*}:setIamPolicy" + body: "*" + }; + } + + // Returns permissions that a caller has on the specified Project. + // + // There are no permissions required for making this API call. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/locations/*/workerPools/*}:testIamPermissions" + body: "*" + }; + } +} + +// Request message for creating a WorkerPool. +message CreateWorkerPoolRequest { + // Required. The location and project in which this worker pool should be + // created. Format: `projects/{project}/locations/{location}`, where + // `{project}` can be project id or number. Only lowercase characters, digits, + // and hyphens. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "run.googleapis.com/WorkerPool" + } + ]; + + // Required. The WorkerPool instance to create. + WorkerPool worker_pool = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The unique identifier for the WorkerPool. It must begin with + // letter, and cannot end with hyphen; must contain fewer than 50 characters. + // The name of the worker pool becomes + // `{parent}/workerPools/{worker_pool_id}`. + string worker_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Indicates that the request should be validated and default values + // populated, without persisting the request or creating any resources. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for updating a worker pool. +message UpdateWorkerPoolRequest { + // Optional. The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The WorkerPool to be updated. + WorkerPool worker_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Indicates that the request should be validated and default values + // populated, without persisting the request or updating any resources. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, and if the WorkerPool does not exist, it will + // create a new one. The caller must have 'run.workerpools.create' permissions + // if this is set to true and the WorkerPool does not exist. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, a new revision will be created from the template + // even if the system doesn't detect any changes from the previously deployed + // revision. + // + // This may be useful for cases where the underlying resources need to be + // recreated or reinitialized. For example if the image is specified by label, + // but the underlying image digest has changed) or if the container performs + // deployment initialization work that needs to be performed again. + bool force_new_revision = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for retrieving a list of WorkerPools. +message ListWorkerPoolsRequest { + // Required. The location and project to list resources on. + // Location must be a valid Google Cloud region, and cannot be the "-" + // wildcard. Format: `projects/{project}/locations/{location}`, where + // `{project}` can be project id or number. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "run.googleapis.com/WorkerPool" + } + ]; + + // Maximum number of WorkerPools to return in this call. + int32 page_size = 2; + + // A page token received from a previous call to ListWorkerPools. + // All other parameters must match. + string page_token = 3; + + // If true, returns deleted (but unexpired) resources along with active ones. + bool show_deleted = 4; +} + +// Response message containing a list of WorkerPools. +message ListWorkerPoolsResponse { + // The resulting list of WorkerPools. + repeated WorkerPool worker_pools = 1; + + // A token indicating there are more items than page_size. Use it in the next + // ListWorkerPools request to continue. + string next_page_token = 2; +} + +// Request message for obtaining a WorkerPool by its full name. +message GetWorkerPoolRequest { + // Required. The full name of the WorkerPool. + // Format: + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where + // `{project}` can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/WorkerPool" } + ]; +} + +// Request message to delete a WorkerPool by its full name. +message DeleteWorkerPoolRequest { + // Required. The full name of the WorkerPool. + // Format: + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where + // `{project}` can be project id or number. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "run.googleapis.com/WorkerPool" } + ]; + + // Optional. Indicates that the request should be validated without actually + // deleting any resources. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 3; +} + +// WorkerPool acts as a top-level container that manages a set of +// configurations and revision templates which implement a pull-based workload. +// WorkerPool exists to provide a singular abstraction which can be access +// controlled, reasoned about, and which encapsulates software lifecycle +// decisions such as rollout policy and team resource ownership. +message WorkerPool { + option (google.api.resource) = { + type: "run.googleapis.com/WorkerPool" + pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" + plural: "workerPools" + singular: "workerPool" + style: DECLARATIVE_FRIENDLY + }; + + // The fully qualified name of this WorkerPool. In CreateWorkerPoolRequest, + // this field is ignored, and instead composed from + // CreateWorkerPoolRequest.parent and CreateWorkerPoolRequest.worker_id. + // + // Format: + // `projects/{project}/locations/{location}/workerPools/{worker_id}` + string name = 1; + + // User-provided description of the WorkerPool. This field currently has a + // 512-character limit. + string description = 2; + + // Output only. Server assigned unique identifier for the trigger. The value + // is a UUID4 string and guaranteed to remain unchanged until the resource is + // deleted. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A number that monotonically increases every time the user + // modifies the desired state. + // Please note that unlike v1, this is an int64 value. As with most Google + // APIs, its JSON representation will be a `string` instead of an `integer`. + int64 generation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Unstructured key value map that can be used to organize and + // categorize objects. User-provided labels are shared with Google's billing + // system, so they can be used to filter, or break down billing charges by + // team, component, environment, state, etc. For more information, visit + // https://cloud.google.com/resource-manager/docs/creating-managing-labels or + // https://cloud.google.com/run/docs/configuring/labels. + // + // Cloud Run API v2 does not support labels with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected. All system labels in v1 now have a + // corresponding field in v2 WorkerPool. + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Unstructured key value map that may be set by external tools to + // store and arbitrary metadata. They are not queryable and should be + // preserved when modifying objects. + // + // Cloud Run API v2 does not support annotations with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected in new resources. All system + // annotations in v1 now have a corresponding field in v2 WorkerPool. + // + //

This field follows Kubernetes + // annotations' namespacing, limits, and rules. + map annotations = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The deletion time. It is only populated as a response to a + // Delete request. + google.protobuf.Timestamp delete_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For a deleted resource, the time after which it will be + // permamently deleted. + google.protobuf.Timestamp expire_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the authenticated creator. + string creator = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email address of the last authenticated modifier. + string last_modifier = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Arbitrary identifier for the API client. + string client = 13; + + // Arbitrary version identifier for the API client. + string client_version = 14; + + // Optional. The launch stage as defined by [Google Cloud Platform + // Launch Stages](https://cloud.google.com/terms/launch-stages). + // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + // is assumed. + // Set the launch stage to a preview stage on input to allow use of preview + // features in that stage. On read (or output), describes whether the + // resource uses preview features. + // + // For example, if ALPHA is provided as input, but only BETA and GA-level + // features are used, this field will be BETA on output. + google.api.LaunchStage launch_stage = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings for the Binary Authorization feature. + BinaryAuthorization binary_authorization = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The template used to create revisions for this WorkerPool. + WorkerPoolRevisionTemplate template = 18 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies how to distribute instances over a collection of + // Revisions belonging to the WorkerPool. If instance split is empty or not + // provided, defaults to 100% instances assigned to the latest `Ready` + // Revision. + repeated InstanceSplit instance_splits = 26 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies worker-pool-level scaling settings + WorkerPoolScaling scaling = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The generation of this WorkerPool currently serving workloads. + // See comments in `reconciling` for additional information on reconciliation + // process in Cloud Run. Please note that unlike v1, this is an int64 value. + // As with most Google APIs, its JSON representation will be a `string` + // instead of an `integer`. + int64 observed_generation = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Condition of this WorkerPool, containing its readiness + // status, and detailed error information in case it did not reach a serving + // state. See comments in `reconciling` for additional information on + // reconciliation process in Cloud Run. + Condition terminal_condition = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Conditions of all other associated sub-resources. They + // contain additional diagnostics information in case the WorkerPool does not + // reach its Serving state. See comments in `reconciling` for additional + // information on reconciliation process in Cloud Run. + repeated Condition conditions = 32 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the latest revision that is serving workloads. See + // comments in `reconciling` for additional information on reconciliation + // process in Cloud Run. + string latest_ready_revision = 33 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Output only. Name of the last created revision. See comments in + // `reconciling` for additional information on reconciliation process in Cloud + // Run. + string latest_created_revision = 34 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Output only. Detailed status information for corresponding instance splits. + // See comments in `reconciling` for additional information on reconciliation + // process in Cloud Run. + repeated InstanceSplitStatus instance_split_statuses = 27 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether Cloud Run Threat Detection monitoring is + // enabled for the parent project of this worker pool. + bool threat_detection_enabled = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Not supported, and ignored by Cloud Run. + repeated string custom_audiences = 37; + + // Output only. Reserved for future use. + bool satisfies_pzs = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Returns true if the WorkerPool is currently being acted upon + // by the system to bring it into the desired state. + // + // When a new WorkerPool is created, or an existing one is updated, Cloud Run + // will asynchronously perform all necessary steps to bring the WorkerPool to + // the desired serving state. This process is called reconciliation. While + // reconciliation is in process, `observed_generation`, + // `latest_ready_revison`, `instance_split_statuses`, and `uri` will have + // transient values that might mismatch the intended state: Once + // reconciliation is over (and this field is false), there are two possible + // outcomes: reconciliation succeeded and the serving state matches the + // WorkerPool, or there was an error, and reconciliation failed. This state + // can be found in `terminal_condition.state`. + // + // If reconciliation succeeded, the following fields will match: + // `instance_splits` and `instance_split_statuses`, `observed_generation` and + // `generation`, `latest_ready_revision` and `latest_created_revision`. + // + // If reconciliation failed, `instance_split_statuses`, `observed_generation`, + // and `latest_ready_revision` will have the state of the last serving + // revision, or empty for newly created WorkerPools. Additional information on + // the failure can be found in `terminal_condition` and `conditions`. + bool reconciling = 98 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A system-generated fingerprint for this version of the + // resource. May be used to detect modification conflict during updates. + string etag = 99 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto new file mode 100644 index 00000000000..fa07f6f8e07 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto @@ -0,0 +1,109 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.run.v2; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/run/v2/k8s.min.proto"; +import "google/cloud/run/v2/vendor_settings.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; +option java_multiple_files = true; +option java_outer_classname = "WorkerPoolRevisionTemplateProto"; +option java_package = "com.google.cloud.run.v2"; + +// WorkerPoolRevisionTemplate describes the data a worker pool revision should +// have when created from a template. +message WorkerPoolRevisionTemplate { + // Optional. The unique name for the revision. If this field is omitted, it + // will be automatically generated based on the WorkerPool name. + string revision = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } + ]; + + // Optional. Unstructured key value map that can be used to organize and + // categorize objects. User-provided labels are shared with Google's billing + // system, so they can be used to filter, or break down billing charges by + // team, component, environment, state, etc. For more information, visit + // https://cloud.google.com/resource-manager/docs/creating-managing-labels or + // https://cloud.google.com/run/docs/configuring/labels. + // + // Cloud Run API v2 does not support labels with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected. All system labels in v1 now have a + // corresponding field in v2 WorkerPoolRevisionTemplate. + map labels = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Unstructured key value map that may be set by external tools to + // store and arbitrary metadata. They are not queryable and should be + // preserved when modifying objects. + // + // Cloud Run API v2 does not support annotations with `run.googleapis.com`, + // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` + // namespaces, and they will be rejected. All system annotations in v1 now + // have a corresponding field in v2 WorkerPoolRevisionTemplate. + // + // This field follows Kubernetes annotations' namespacing, limits, and + // rules. + map annotations = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. VPC Access configuration to use for this Revision. For more + // information, visit + // https://cloud.google.com/run/docs/configuring/connecting-vpc. + VpcAccess vpc_access = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Email address of the IAM service account associated with the + // revision of the service. The service account represents the identity of the + // running revision, and determines what permissions the revision has. If not + // provided, the revision will use the project's default service account. + string service_account = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Holds list of the containers that defines the unit of execution for this + // Revision. + repeated Container containers = 6; + + // Optional. A list of Volumes to make available to containers. + repeated Volume volumes = 7 [(google.api.field_behavior) = OPTIONAL]; + + // A reference to a customer managed encryption key (CMEK) to use to encrypt + // this container image. For more information, go to + // https://cloud.google.com/run/docs/securing/using-cmek + string encryption_key = 8 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // Optional. Enables service mesh connectivity. + ServiceMesh service_mesh = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The action to take if the encryption key is revoked. + EncryptionKeyRevocationAction encryption_key_revocation_action = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If encryption_key_revocation_action is SHUTDOWN, the duration + // before shutting down all instances. The minimum increment is 1 hour. + google.protobuf.Duration encryption_key_shutdown_duration = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The node selector for the revision template. + NodeSelector node_selector = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True if GPU zonal redundancy is disabled on this worker pool. + optional bool gpu_zonal_redundancy_disabled = 16 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-run/protos/protos.d.ts b/owl-bot-staging/google-cloud-run/protos/protos.d.ts new file mode 100644 index 00000000000..0f969068560 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/protos.d.ts @@ -0,0 +1,22927 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace run. */ + namespace run { + + /** Namespace v2. */ + namespace v2 { + + /** Represents a Builds */ + class Builds extends $protobuf.rpc.Service { + + /** + * Constructs a new Builds 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 Builds 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): Builds; + + /** + * Calls SubmitBuild. + * @param request SubmitBuildRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SubmitBuildResponse + */ + public submitBuild(request: google.cloud.run.v2.ISubmitBuildRequest, callback: google.cloud.run.v2.Builds.SubmitBuildCallback): void; + + /** + * Calls SubmitBuild. + * @param request SubmitBuildRequest message or plain object + * @returns Promise + */ + public submitBuild(request: google.cloud.run.v2.ISubmitBuildRequest): Promise; + } + + namespace Builds { + + /** + * Callback as used by {@link google.cloud.run.v2.Builds|submitBuild}. + * @param error Error, if any + * @param [response] SubmitBuildResponse + */ + type SubmitBuildCallback = (error: (Error|null), response?: google.cloud.run.v2.SubmitBuildResponse) => void; + } + + /** Properties of a SubmitBuildRequest. */ + interface ISubmitBuildRequest { + + /** SubmitBuildRequest parent */ + parent?: (string|null); + + /** SubmitBuildRequest storageSource */ + storageSource?: (google.cloud.run.v2.IStorageSource|null); + + /** SubmitBuildRequest imageUri */ + imageUri?: (string|null); + + /** SubmitBuildRequest buildpackBuild */ + buildpackBuild?: (google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null); + + /** SubmitBuildRequest dockerBuild */ + dockerBuild?: (google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null); + + /** SubmitBuildRequest serviceAccount */ + serviceAccount?: (string|null); + + /** SubmitBuildRequest workerPool */ + workerPool?: (string|null); + + /** SubmitBuildRequest tags */ + tags?: (string[]|null); + + /** SubmitBuildRequest machineType */ + machineType?: (string|null); + + /** SubmitBuildRequest releaseTrack */ + releaseTrack?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** SubmitBuildRequest client */ + client?: (string|null); + } + + /** Represents a SubmitBuildRequest. */ + class SubmitBuildRequest implements ISubmitBuildRequest { + + /** + * Constructs a new SubmitBuildRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ISubmitBuildRequest); + + /** SubmitBuildRequest parent. */ + public parent: string; + + /** SubmitBuildRequest storageSource. */ + public storageSource?: (google.cloud.run.v2.IStorageSource|null); + + /** SubmitBuildRequest imageUri. */ + public imageUri: string; + + /** SubmitBuildRequest buildpackBuild. */ + public buildpackBuild?: (google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null); + + /** SubmitBuildRequest dockerBuild. */ + public dockerBuild?: (google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null); + + /** SubmitBuildRequest serviceAccount. */ + public serviceAccount: string; + + /** SubmitBuildRequest workerPool. */ + public workerPool: string; + + /** SubmitBuildRequest tags. */ + public tags: string[]; + + /** SubmitBuildRequest machineType. */ + public machineType: string; + + /** SubmitBuildRequest releaseTrack. */ + public releaseTrack: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** SubmitBuildRequest client. */ + public client: string; + + /** SubmitBuildRequest source. */ + public source?: "storageSource"; + + /** SubmitBuildRequest buildType. */ + public buildType?: ("buildpackBuild"|"dockerBuild"); + + /** + * Creates a new SubmitBuildRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SubmitBuildRequest instance + */ + public static create(properties?: google.cloud.run.v2.ISubmitBuildRequest): google.cloud.run.v2.SubmitBuildRequest; + + /** + * Encodes the specified SubmitBuildRequest message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. + * @param message SubmitBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ISubmitBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubmitBuildRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. + * @param message SubmitBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ISubmitBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubmitBuildRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubmitBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildRequest; + + /** + * Decodes a SubmitBuildRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubmitBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildRequest; + + /** + * Verifies a SubmitBuildRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubmitBuildRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubmitBuildRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildRequest; + + /** + * Creates a plain object from a SubmitBuildRequest message. Also converts values to other types if specified. + * @param message SubmitBuildRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.SubmitBuildRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubmitBuildRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubmitBuildRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SubmitBuildRequest { + + /** Properties of a DockerBuild. */ + interface IDockerBuild { + } + + /** Represents a DockerBuild. */ + class DockerBuild implements IDockerBuild { + + /** + * Constructs a new DockerBuild. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild); + + /** + * Creates a new DockerBuild instance using the specified properties. + * @param [properties] Properties to set + * @returns DockerBuild instance + */ + public static create(properties?: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; + + /** + * Encodes the specified DockerBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. + * @param message DockerBuild message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DockerBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. + * @param message DockerBuild message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DockerBuild message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DockerBuild + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; + + /** + * Decodes a DockerBuild message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DockerBuild + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; + + /** + * Verifies a DockerBuild message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DockerBuild message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DockerBuild + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; + + /** + * Creates a plain object from a DockerBuild message. Also converts values to other types if specified. + * @param message DockerBuild + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.SubmitBuildRequest.DockerBuild, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DockerBuild to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DockerBuild + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BuildpacksBuild. */ + interface IBuildpacksBuild { + + /** BuildpacksBuild runtime */ + runtime?: (string|null); + + /** BuildpacksBuild functionTarget */ + functionTarget?: (string|null); + + /** BuildpacksBuild cacheImageUri */ + cacheImageUri?: (string|null); + + /** BuildpacksBuild baseImage */ + baseImage?: (string|null); + + /** BuildpacksBuild environmentVariables */ + environmentVariables?: ({ [k: string]: string }|null); + + /** BuildpacksBuild enableAutomaticUpdates */ + enableAutomaticUpdates?: (boolean|null); + + /** BuildpacksBuild projectDescriptor */ + projectDescriptor?: (string|null); + } + + /** Represents a BuildpacksBuild. */ + class BuildpacksBuild implements IBuildpacksBuild { + + /** + * Constructs a new BuildpacksBuild. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild); + + /** BuildpacksBuild runtime. */ + public runtime: string; + + /** BuildpacksBuild functionTarget. */ + public functionTarget: string; + + /** BuildpacksBuild cacheImageUri. */ + public cacheImageUri: string; + + /** BuildpacksBuild baseImage. */ + public baseImage: string; + + /** BuildpacksBuild environmentVariables. */ + public environmentVariables: { [k: string]: string }; + + /** BuildpacksBuild enableAutomaticUpdates. */ + public enableAutomaticUpdates: boolean; + + /** BuildpacksBuild projectDescriptor. */ + public projectDescriptor: string; + + /** + * Creates a new BuildpacksBuild instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildpacksBuild instance + */ + public static create(properties?: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; + + /** + * Encodes the specified BuildpacksBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. + * @param message BuildpacksBuild message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildpacksBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. + * @param message BuildpacksBuild message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildpacksBuild message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildpacksBuild + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; + + /** + * Decodes a BuildpacksBuild message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildpacksBuild + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; + + /** + * Verifies a BuildpacksBuild message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildpacksBuild message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildpacksBuild + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; + + /** + * Creates a plain object from a BuildpacksBuild message. Also converts values to other types if specified. + * @param message BuildpacksBuild + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildpacksBuild to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuildpacksBuild + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SubmitBuildResponse. */ + interface ISubmitBuildResponse { + + /** SubmitBuildResponse buildOperation */ + buildOperation?: (google.longrunning.IOperation|null); + + /** SubmitBuildResponse baseImageUri */ + baseImageUri?: (string|null); + + /** SubmitBuildResponse baseImageWarning */ + baseImageWarning?: (string|null); + } + + /** Represents a SubmitBuildResponse. */ + class SubmitBuildResponse implements ISubmitBuildResponse { + + /** + * Constructs a new SubmitBuildResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ISubmitBuildResponse); + + /** SubmitBuildResponse buildOperation. */ + public buildOperation?: (google.longrunning.IOperation|null); + + /** SubmitBuildResponse baseImageUri. */ + public baseImageUri: string; + + /** SubmitBuildResponse baseImageWarning. */ + public baseImageWarning: string; + + /** + * Creates a new SubmitBuildResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SubmitBuildResponse instance + */ + public static create(properties?: google.cloud.run.v2.ISubmitBuildResponse): google.cloud.run.v2.SubmitBuildResponse; + + /** + * Encodes the specified SubmitBuildResponse message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. + * @param message SubmitBuildResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ISubmitBuildResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubmitBuildResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. + * @param message SubmitBuildResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ISubmitBuildResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubmitBuildResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubmitBuildResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildResponse; + + /** + * Decodes a SubmitBuildResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubmitBuildResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildResponse; + + /** + * Verifies a SubmitBuildResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubmitBuildResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubmitBuildResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildResponse; + + /** + * Creates a plain object from a SubmitBuildResponse message. Also converts values to other types if specified. + * @param message SubmitBuildResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.SubmitBuildResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubmitBuildResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubmitBuildResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StorageSource. */ + interface IStorageSource { + + /** StorageSource bucket */ + bucket?: (string|null); + + /** StorageSource object */ + object?: (string|null); + + /** StorageSource generation */ + generation?: (number|Long|string|null); + } + + /** Represents a StorageSource. */ + class StorageSource implements IStorageSource { + + /** + * Constructs a new StorageSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IStorageSource); + + /** StorageSource bucket. */ + public bucket: string; + + /** StorageSource object. */ + public object: string; + + /** StorageSource generation. */ + public generation: (number|Long|string); + + /** + * Creates a new StorageSource instance using the specified properties. + * @param [properties] Properties to set + * @returns StorageSource instance + */ + public static create(properties?: google.cloud.run.v2.IStorageSource): google.cloud.run.v2.StorageSource; + + /** + * Encodes the specified StorageSource message. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. + * @param message StorageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. + * @param message StorageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StorageSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StorageSource; + + /** + * Decodes a StorageSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StorageSource; + + /** + * Verifies a StorageSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StorageSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StorageSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StorageSource; + + /** + * Creates a plain object from a StorageSource message. Also converts values to other types if specified. + * @param message StorageSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.StorageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StorageSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StorageSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition type */ + type?: (string|null); + + /** Condition state */ + state?: (google.cloud.run.v2.Condition.State|keyof typeof google.cloud.run.v2.Condition.State|null); + + /** Condition message */ + message?: (string|null); + + /** Condition lastTransitionTime */ + lastTransitionTime?: (google.protobuf.ITimestamp|null); + + /** Condition severity */ + severity?: (google.cloud.run.v2.Condition.Severity|keyof typeof google.cloud.run.v2.Condition.Severity|null); + + /** Condition reason */ + reason?: (google.cloud.run.v2.Condition.CommonReason|keyof typeof google.cloud.run.v2.Condition.CommonReason|null); + + /** Condition revisionReason */ + revisionReason?: (google.cloud.run.v2.Condition.RevisionReason|keyof typeof google.cloud.run.v2.Condition.RevisionReason|null); + + /** Condition executionReason */ + executionReason?: (google.cloud.run.v2.Condition.ExecutionReason|keyof typeof google.cloud.run.v2.Condition.ExecutionReason|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ICondition); + + /** Condition type. */ + public type: string; + + /** Condition state. */ + public state: (google.cloud.run.v2.Condition.State|keyof typeof google.cloud.run.v2.Condition.State); + + /** Condition message. */ + public message: string; + + /** Condition lastTransitionTime. */ + public lastTransitionTime?: (google.protobuf.ITimestamp|null); + + /** Condition severity. */ + public severity: (google.cloud.run.v2.Condition.Severity|keyof typeof google.cloud.run.v2.Condition.Severity); + + /** Condition reason. */ + public reason?: (google.cloud.run.v2.Condition.CommonReason|keyof typeof google.cloud.run.v2.Condition.CommonReason|null); + + /** Condition revisionReason. */ + public revisionReason?: (google.cloud.run.v2.Condition.RevisionReason|keyof typeof google.cloud.run.v2.Condition.RevisionReason|null); + + /** Condition executionReason. */ + public executionReason?: (google.cloud.run.v2.Condition.ExecutionReason|keyof typeof google.cloud.run.v2.Condition.ExecutionReason|null); + + /** Condition reasons. */ + public reasons?: ("reason"|"revisionReason"|"executionReason"); + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.cloud.run.v2.ICondition): google.cloud.run.v2.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Condition; + + /** + * Verifies a Condition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Condition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Condition { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CONDITION_PENDING = 1, + CONDITION_RECONCILING = 2, + CONDITION_FAILED = 3, + CONDITION_SUCCEEDED = 4 + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + ERROR = 1, + WARNING = 2, + INFO = 3 + } + + /** CommonReason enum. */ + enum CommonReason { + COMMON_REASON_UNDEFINED = 0, + UNKNOWN = 1, + REVISION_FAILED = 3, + PROGRESS_DEADLINE_EXCEEDED = 4, + CONTAINER_MISSING = 6, + CONTAINER_PERMISSION_DENIED = 7, + CONTAINER_IMAGE_UNAUTHORIZED = 8, + CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9, + ENCRYPTION_KEY_PERMISSION_DENIED = 10, + ENCRYPTION_KEY_CHECK_FAILED = 11, + SECRETS_ACCESS_CHECK_FAILED = 12, + WAITING_FOR_OPERATION = 13, + IMMEDIATE_RETRY = 14, + POSTPONED_RETRY = 15, + INTERNAL = 16, + VPC_NETWORK_NOT_FOUND = 17 + } + + /** RevisionReason enum. */ + enum RevisionReason { + REVISION_REASON_UNDEFINED = 0, + PENDING = 1, + RESERVE = 2, + RETIRED = 3, + RETIRING = 4, + RECREATING = 5, + HEALTH_CHECK_CONTAINER_ERROR = 6, + CUSTOMIZED_PATH_RESPONSE_PENDING = 7, + MIN_INSTANCES_NOT_PROVISIONED = 8, + ACTIVE_REVISION_LIMIT_REACHED = 9, + NO_DEPLOYMENT = 10, + HEALTH_CHECK_SKIPPED = 11, + MIN_INSTANCES_WARMING = 12 + } + + /** ExecutionReason enum. */ + enum ExecutionReason { + EXECUTION_REASON_UNDEFINED = 0, + JOB_STATUS_SERVICE_POLLING_ERROR = 1, + NON_ZERO_EXIT_CODE = 2, + CANCELLED = 3, + CANCELLING = 4, + DELETED = 5, + DELAYED_START_PENDING = 6 + } + } + + /** Properties of a ContainerStatus. */ + interface IContainerStatus { + + /** ContainerStatus name */ + name?: (string|null); + + /** ContainerStatus imageDigest */ + imageDigest?: (string|null); + } + + /** Represents a ContainerStatus. */ + class ContainerStatus implements IContainerStatus { + + /** + * Constructs a new ContainerStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IContainerStatus); + + /** ContainerStatus name. */ + public name: string; + + /** ContainerStatus imageDigest. */ + public imageDigest: string; + + /** + * Creates a new ContainerStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ContainerStatus instance + */ + public static create(properties?: google.cloud.run.v2.IContainerStatus): google.cloud.run.v2.ContainerStatus; + + /** + * Encodes the specified ContainerStatus message. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @param message ContainerStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IContainerStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContainerStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @param message ContainerStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IContainerStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ContainerStatus; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ContainerStatus; + + /** + * Verifies a ContainerStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContainerStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContainerStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ContainerStatus; + + /** + * Creates a plain object from a ContainerStatus message. Also converts values to other types if specified. + * @param message ContainerStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ContainerStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContainerStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContainerStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Executions */ + class Executions extends $protobuf.rpc.Service { + + /** + * Constructs a new Executions 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 Executions 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): Executions; + + /** + * Calls GetExecution. + * @param request GetExecutionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Execution + */ + public getExecution(request: google.cloud.run.v2.IGetExecutionRequest, callback: google.cloud.run.v2.Executions.GetExecutionCallback): void; + + /** + * Calls GetExecution. + * @param request GetExecutionRequest message or plain object + * @returns Promise + */ + public getExecution(request: google.cloud.run.v2.IGetExecutionRequest): Promise; + + /** + * Calls ListExecutions. + * @param request ListExecutionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExecutionsResponse + */ + public listExecutions(request: google.cloud.run.v2.IListExecutionsRequest, callback: google.cloud.run.v2.Executions.ListExecutionsCallback): void; + + /** + * Calls ListExecutions. + * @param request ListExecutionsRequest message or plain object + * @returns Promise + */ + public listExecutions(request: google.cloud.run.v2.IListExecutionsRequest): Promise; + + /** + * Calls DeleteExecution. + * @param request DeleteExecutionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteExecution(request: google.cloud.run.v2.IDeleteExecutionRequest, callback: google.cloud.run.v2.Executions.DeleteExecutionCallback): void; + + /** + * Calls DeleteExecution. + * @param request DeleteExecutionRequest message or plain object + * @returns Promise + */ + public deleteExecution(request: google.cloud.run.v2.IDeleteExecutionRequest): Promise; + + /** + * Calls CancelExecution. + * @param request CancelExecutionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public cancelExecution(request: google.cloud.run.v2.ICancelExecutionRequest, callback: google.cloud.run.v2.Executions.CancelExecutionCallback): void; + + /** + * Calls CancelExecution. + * @param request CancelExecutionRequest message or plain object + * @returns Promise + */ + public cancelExecution(request: google.cloud.run.v2.ICancelExecutionRequest): Promise; + } + + namespace Executions { + + /** + * Callback as used by {@link google.cloud.run.v2.Executions|getExecution}. + * @param error Error, if any + * @param [response] Execution + */ + type GetExecutionCallback = (error: (Error|null), response?: google.cloud.run.v2.Execution) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Executions|listExecutions}. + * @param error Error, if any + * @param [response] ListExecutionsResponse + */ + type ListExecutionsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListExecutionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Executions|deleteExecution}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteExecutionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Executions|cancelExecution}. + * @param error Error, if any + * @param [response] Operation + */ + type CancelExecutionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a GetExecutionRequest. */ + interface IGetExecutionRequest { + + /** GetExecutionRequest name */ + name?: (string|null); + } + + /** Represents a GetExecutionRequest. */ + class GetExecutionRequest implements IGetExecutionRequest { + + /** + * Constructs a new GetExecutionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IGetExecutionRequest); + + /** GetExecutionRequest name. */ + public name: string; + + /** + * Creates a new GetExecutionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExecutionRequest instance + */ + public static create(properties?: google.cloud.run.v2.IGetExecutionRequest): google.cloud.run.v2.GetExecutionRequest; + + /** + * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. + * @param message GetExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. + * @param message GetExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExecutionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetExecutionRequest; + + /** + * Decodes a GetExecutionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetExecutionRequest; + + /** + * Verifies a GetExecutionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExecutionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetExecutionRequest; + + /** + * Creates a plain object from a GetExecutionRequest message. Also converts values to other types if specified. + * @param message GetExecutionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.GetExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExecutionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExecutionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExecutionsRequest. */ + interface IListExecutionsRequest { + + /** ListExecutionsRequest parent */ + parent?: (string|null); + + /** ListExecutionsRequest pageSize */ + pageSize?: (number|null); + + /** ListExecutionsRequest pageToken */ + pageToken?: (string|null); + + /** ListExecutionsRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListExecutionsRequest. */ + class ListExecutionsRequest implements IListExecutionsRequest { + + /** + * Constructs a new ListExecutionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListExecutionsRequest); + + /** ListExecutionsRequest parent. */ + public parent: string; + + /** ListExecutionsRequest pageSize. */ + public pageSize: number; + + /** ListExecutionsRequest pageToken. */ + public pageToken: string; + + /** ListExecutionsRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListExecutionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExecutionsRequest instance + */ + public static create(properties?: google.cloud.run.v2.IListExecutionsRequest): google.cloud.run.v2.ListExecutionsRequest; + + /** + * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. + * @param message ListExecutionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. + * @param message ListExecutionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExecutionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExecutionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListExecutionsRequest; + + /** + * Decodes a ListExecutionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExecutionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListExecutionsRequest; + + /** + * Verifies a ListExecutionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExecutionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExecutionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListExecutionsRequest; + + /** + * Creates a plain object from a ListExecutionsRequest message. Also converts values to other types if specified. + * @param message ListExecutionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListExecutionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExecutionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExecutionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExecutionsResponse. */ + interface IListExecutionsResponse { + + /** ListExecutionsResponse executions */ + executions?: (google.cloud.run.v2.IExecution[]|null); + + /** ListExecutionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExecutionsResponse. */ + class ListExecutionsResponse implements IListExecutionsResponse { + + /** + * Constructs a new ListExecutionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListExecutionsResponse); + + /** ListExecutionsResponse executions. */ + public executions: google.cloud.run.v2.IExecution[]; + + /** ListExecutionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExecutionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExecutionsResponse instance + */ + public static create(properties?: google.cloud.run.v2.IListExecutionsResponse): google.cloud.run.v2.ListExecutionsResponse; + + /** + * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. + * @param message ListExecutionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. + * @param message ListExecutionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExecutionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExecutionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListExecutionsResponse; + + /** + * Decodes a ListExecutionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExecutionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListExecutionsResponse; + + /** + * Verifies a ListExecutionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExecutionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExecutionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListExecutionsResponse; + + /** + * Creates a plain object from a ListExecutionsResponse message. Also converts values to other types if specified. + * @param message ListExecutionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListExecutionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExecutionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExecutionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExecutionRequest. */ + interface IDeleteExecutionRequest { + + /** DeleteExecutionRequest name */ + name?: (string|null); + + /** DeleteExecutionRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteExecutionRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteExecutionRequest. */ + class DeleteExecutionRequest implements IDeleteExecutionRequest { + + /** + * Constructs a new DeleteExecutionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IDeleteExecutionRequest); + + /** DeleteExecutionRequest name. */ + public name: string; + + /** DeleteExecutionRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteExecutionRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteExecutionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExecutionRequest instance + */ + public static create(properties?: google.cloud.run.v2.IDeleteExecutionRequest): google.cloud.run.v2.DeleteExecutionRequest; + + /** + * Encodes the specified DeleteExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. + * @param message DeleteExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IDeleteExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. + * @param message DeleteExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IDeleteExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExecutionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteExecutionRequest; + + /** + * Decodes a DeleteExecutionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteExecutionRequest; + + /** + * Verifies a DeleteExecutionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExecutionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteExecutionRequest; + + /** + * Creates a plain object from a DeleteExecutionRequest message. Also converts values to other types if specified. + * @param message DeleteExecutionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.DeleteExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExecutionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExecutionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelExecutionRequest. */ + interface ICancelExecutionRequest { + + /** CancelExecutionRequest name */ + name?: (string|null); + + /** CancelExecutionRequest validateOnly */ + validateOnly?: (boolean|null); + + /** CancelExecutionRequest etag */ + etag?: (string|null); + } + + /** Represents a CancelExecutionRequest. */ + class CancelExecutionRequest implements ICancelExecutionRequest { + + /** + * Constructs a new CancelExecutionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ICancelExecutionRequest); + + /** CancelExecutionRequest name. */ + public name: string; + + /** CancelExecutionRequest validateOnly. */ + public validateOnly: boolean; + + /** CancelExecutionRequest etag. */ + public etag: string; + + /** + * Creates a new CancelExecutionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelExecutionRequest instance + */ + public static create(properties?: google.cloud.run.v2.ICancelExecutionRequest): google.cloud.run.v2.CancelExecutionRequest; + + /** + * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. + * @param message CancelExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. + * @param message CancelExecutionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelExecutionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CancelExecutionRequest; + + /** + * Decodes a CancelExecutionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CancelExecutionRequest; + + /** + * Verifies a CancelExecutionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelExecutionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CancelExecutionRequest; + + /** + * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. + * @param message CancelExecutionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.CancelExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelExecutionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelExecutionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Execution. */ + interface IExecution { + + /** Execution name */ + name?: (string|null); + + /** Execution uid */ + uid?: (string|null); + + /** Execution creator */ + creator?: (string|null); + + /** Execution generation */ + generation?: (number|Long|string|null); + + /** Execution labels */ + labels?: ({ [k: string]: string }|null); + + /** Execution annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Execution createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Execution startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Execution completionTime */ + completionTime?: (google.protobuf.ITimestamp|null); + + /** Execution updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Execution deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Execution expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Execution launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** Execution job */ + job?: (string|null); + + /** Execution parallelism */ + parallelism?: (number|null); + + /** Execution taskCount */ + taskCount?: (number|null); + + /** Execution template */ + template?: (google.cloud.run.v2.ITaskTemplate|null); + + /** Execution reconciling */ + reconciling?: (boolean|null); + + /** Execution conditions */ + conditions?: (google.cloud.run.v2.ICondition[]|null); + + /** Execution observedGeneration */ + observedGeneration?: (number|Long|string|null); + + /** Execution runningCount */ + runningCount?: (number|null); + + /** Execution succeededCount */ + succeededCount?: (number|null); + + /** Execution failedCount */ + failedCount?: (number|null); + + /** Execution cancelledCount */ + cancelledCount?: (number|null); + + /** Execution retriedCount */ + retriedCount?: (number|null); + + /** Execution logUri */ + logUri?: (string|null); + + /** Execution satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Execution etag */ + etag?: (string|null); + } + + /** Represents an Execution. */ + class Execution implements IExecution { + + /** + * Constructs a new Execution. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IExecution); + + /** Execution name. */ + public name: string; + + /** Execution uid. */ + public uid: string; + + /** Execution creator. */ + public creator: string; + + /** Execution generation. */ + public generation: (number|Long|string); + + /** Execution labels. */ + public labels: { [k: string]: string }; + + /** Execution annotations. */ + public annotations: { [k: string]: string }; + + /** Execution createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Execution startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Execution completionTime. */ + public completionTime?: (google.protobuf.ITimestamp|null); + + /** Execution updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Execution deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Execution expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Execution launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** Execution job. */ + public job: string; + + /** Execution parallelism. */ + public parallelism: number; + + /** Execution taskCount. */ + public taskCount: number; + + /** Execution template. */ + public template?: (google.cloud.run.v2.ITaskTemplate|null); + + /** Execution reconciling. */ + public reconciling: boolean; + + /** Execution conditions. */ + public conditions: google.cloud.run.v2.ICondition[]; + + /** Execution observedGeneration. */ + public observedGeneration: (number|Long|string); + + /** Execution runningCount. */ + public runningCount: number; + + /** Execution succeededCount. */ + public succeededCount: number; + + /** Execution failedCount. */ + public failedCount: number; + + /** Execution cancelledCount. */ + public cancelledCount: number; + + /** Execution retriedCount. */ + public retriedCount: number; + + /** Execution logUri. */ + public logUri: string; + + /** Execution satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Execution etag. */ + public etag: string; + + /** + * Creates a new Execution instance using the specified properties. + * @param [properties] Properties to set + * @returns Execution instance + */ + public static create(properties?: google.cloud.run.v2.IExecution): google.cloud.run.v2.Execution; + + /** + * Encodes the specified Execution message. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. + * @param message Execution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. + * @param message Execution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Execution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Execution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Execution; + + /** + * Decodes an Execution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Execution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Execution; + + /** + * Verifies an Execution message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Execution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Execution + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Execution; + + /** + * Creates a plain object from an Execution message. Also converts values to other types if specified. + * @param message Execution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.Execution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Execution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Execution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskTemplate. */ + interface ITaskTemplate { + + /** TaskTemplate containers */ + containers?: (google.cloud.run.v2.IContainer[]|null); + + /** TaskTemplate volumes */ + volumes?: (google.cloud.run.v2.IVolume[]|null); + + /** TaskTemplate maxRetries */ + maxRetries?: (number|null); + + /** TaskTemplate timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** TaskTemplate serviceAccount */ + serviceAccount?: (string|null); + + /** TaskTemplate executionEnvironment */ + executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); + + /** TaskTemplate encryptionKey */ + encryptionKey?: (string|null); + + /** TaskTemplate vpcAccess */ + vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** TaskTemplate nodeSelector */ + nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** TaskTemplate gpuZonalRedundancyDisabled */ + gpuZonalRedundancyDisabled?: (boolean|null); + } + + /** Represents a TaskTemplate. */ + class TaskTemplate implements ITaskTemplate { + + /** + * Constructs a new TaskTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ITaskTemplate); + + /** TaskTemplate containers. */ + public containers: google.cloud.run.v2.IContainer[]; + + /** TaskTemplate volumes. */ + public volumes: google.cloud.run.v2.IVolume[]; + + /** TaskTemplate maxRetries. */ + public maxRetries?: (number|null); + + /** TaskTemplate timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** TaskTemplate serviceAccount. */ + public serviceAccount: string; + + /** TaskTemplate executionEnvironment. */ + public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); + + /** TaskTemplate encryptionKey. */ + public encryptionKey: string; + + /** TaskTemplate vpcAccess. */ + public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** TaskTemplate nodeSelector. */ + public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** TaskTemplate gpuZonalRedundancyDisabled. */ + public gpuZonalRedundancyDisabled?: (boolean|null); + + /** TaskTemplate retries. */ + public retries?: "maxRetries"; + + /** + * Creates a new TaskTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskTemplate instance + */ + public static create(properties?: google.cloud.run.v2.ITaskTemplate): google.cloud.run.v2.TaskTemplate; + + /** + * Encodes the specified TaskTemplate message. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. + * @param message TaskTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ITaskTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. + * @param message TaskTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ITaskTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TaskTemplate; + + /** + * Decodes a TaskTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TaskTemplate; + + /** + * Verifies a TaskTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TaskTemplate; + + /** + * Creates a plain object from a TaskTemplate message. Also converts values to other types if specified. + * @param message TaskTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.TaskTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Container. */ + interface IContainer { + + /** Container name */ + name?: (string|null); + + /** Container image */ + image?: (string|null); + + /** Container sourceCode */ + sourceCode?: (google.cloud.run.v2.ISourceCode|null); + + /** Container command */ + command?: (string[]|null); + + /** Container args */ + args?: (string[]|null); + + /** Container env */ + env?: (google.cloud.run.v2.IEnvVar[]|null); + + /** Container resources */ + resources?: (google.cloud.run.v2.IResourceRequirements|null); + + /** Container ports */ + ports?: (google.cloud.run.v2.IContainerPort[]|null); + + /** Container volumeMounts */ + volumeMounts?: (google.cloud.run.v2.IVolumeMount[]|null); + + /** Container workingDir */ + workingDir?: (string|null); + + /** Container livenessProbe */ + livenessProbe?: (google.cloud.run.v2.IProbe|null); + + /** Container startupProbe */ + startupProbe?: (google.cloud.run.v2.IProbe|null); + + /** Container readinessProbe */ + readinessProbe?: (google.cloud.run.v2.IProbe|null); + + /** Container dependsOn */ + dependsOn?: (string[]|null); + + /** Container baseImageUri */ + baseImageUri?: (string|null); + + /** Container buildInfo */ + buildInfo?: (google.cloud.run.v2.IBuildInfo|null); + } + + /** Represents a Container. */ + class Container implements IContainer { + + /** + * Constructs a new Container. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IContainer); + + /** Container name. */ + public name: string; + + /** Container image. */ + public image: string; + + /** Container sourceCode. */ + public sourceCode?: (google.cloud.run.v2.ISourceCode|null); + + /** Container command. */ + public command: string[]; + + /** Container args. */ + public args: string[]; + + /** Container env. */ + public env: google.cloud.run.v2.IEnvVar[]; + + /** Container resources. */ + public resources?: (google.cloud.run.v2.IResourceRequirements|null); + + /** Container ports. */ + public ports: google.cloud.run.v2.IContainerPort[]; + + /** Container volumeMounts. */ + public volumeMounts: google.cloud.run.v2.IVolumeMount[]; + + /** Container workingDir. */ + public workingDir: string; + + /** Container livenessProbe. */ + public livenessProbe?: (google.cloud.run.v2.IProbe|null); + + /** Container startupProbe. */ + public startupProbe?: (google.cloud.run.v2.IProbe|null); + + /** Container readinessProbe. */ + public readinessProbe?: (google.cloud.run.v2.IProbe|null); + + /** Container dependsOn. */ + public dependsOn: string[]; + + /** Container baseImageUri. */ + public baseImageUri: string; + + /** Container buildInfo. */ + public buildInfo?: (google.cloud.run.v2.IBuildInfo|null); + + /** + * Creates a new Container instance using the specified properties. + * @param [properties] Properties to set + * @returns Container instance + */ + public static create(properties?: google.cloud.run.v2.IContainer): google.cloud.run.v2.Container; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 ResourceRequirements. */ + interface IResourceRequirements { + + /** ResourceRequirements limits */ + limits?: ({ [k: string]: string }|null); + + /** ResourceRequirements cpuIdle */ + cpuIdle?: (boolean|null); + + /** ResourceRequirements startupCpuBoost */ + startupCpuBoost?: (boolean|null); + } + + /** Represents a ResourceRequirements. */ + class ResourceRequirements implements IResourceRequirements { + + /** + * Constructs a new ResourceRequirements. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IResourceRequirements); + + /** ResourceRequirements limits. */ + public limits: { [k: string]: string }; + + /** ResourceRequirements cpuIdle. */ + public cpuIdle: boolean; + + /** ResourceRequirements startupCpuBoost. */ + public startupCpuBoost: boolean; + + /** + * Creates a new ResourceRequirements instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceRequirements instance + */ + public static create(properties?: google.cloud.run.v2.IResourceRequirements): google.cloud.run.v2.ResourceRequirements; + + /** + * Encodes the specified ResourceRequirements message. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. + * @param message ResourceRequirements message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IResourceRequirements, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceRequirements message, length delimited. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. + * @param message ResourceRequirements message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IResourceRequirements, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceRequirements message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceRequirements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ResourceRequirements; + + /** + * Decodes a ResourceRequirements message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceRequirements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ResourceRequirements; + + /** + * Verifies a ResourceRequirements message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceRequirements message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceRequirements + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ResourceRequirements; + + /** + * Creates a plain object from a ResourceRequirements message. Also converts values to other types if specified. + * @param message ResourceRequirements + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ResourceRequirements, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceRequirements to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceRequirements + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnvVar. */ + interface IEnvVar { + + /** EnvVar name */ + name?: (string|null); + + /** EnvVar value */ + value?: (string|null); + + /** EnvVar valueSource */ + valueSource?: (google.cloud.run.v2.IEnvVarSource|null); + } + + /** Represents an EnvVar. */ + class EnvVar implements IEnvVar { + + /** + * Constructs a new EnvVar. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IEnvVar); + + /** EnvVar name. */ + public name: string; + + /** EnvVar value. */ + public value?: (string|null); + + /** EnvVar valueSource. */ + public valueSource?: (google.cloud.run.v2.IEnvVarSource|null); + + /** EnvVar values. */ + public values?: ("value"|"valueSource"); + + /** + * Creates a new EnvVar instance using the specified properties. + * @param [properties] Properties to set + * @returns EnvVar instance + */ + public static create(properties?: google.cloud.run.v2.IEnvVar): google.cloud.run.v2.EnvVar; + + /** + * Encodes the specified EnvVar message. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. + * @param message EnvVar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IEnvVar, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnvVar message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. + * @param message EnvVar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IEnvVar, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnvVar message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnvVar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.EnvVar; + + /** + * Decodes an EnvVar message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnvVar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.EnvVar; + + /** + * Verifies an EnvVar message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnvVar message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnvVar + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.EnvVar; + + /** + * Creates a plain object from an EnvVar message. Also converts values to other types if specified. + * @param message EnvVar + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.EnvVar, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnvVar to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnvVar + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnvVarSource. */ + interface IEnvVarSource { + + /** EnvVarSource secretKeyRef */ + secretKeyRef?: (google.cloud.run.v2.ISecretKeySelector|null); + } + + /** Represents an EnvVarSource. */ + class EnvVarSource implements IEnvVarSource { + + /** + * Constructs a new EnvVarSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IEnvVarSource); + + /** EnvVarSource secretKeyRef. */ + public secretKeyRef?: (google.cloud.run.v2.ISecretKeySelector|null); + + /** + * Creates a new EnvVarSource instance using the specified properties. + * @param [properties] Properties to set + * @returns EnvVarSource instance + */ + public static create(properties?: google.cloud.run.v2.IEnvVarSource): google.cloud.run.v2.EnvVarSource; + + /** + * Encodes the specified EnvVarSource message. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. + * @param message EnvVarSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IEnvVarSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnvVarSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. + * @param message EnvVarSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IEnvVarSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnvVarSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnvVarSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.EnvVarSource; + + /** + * Decodes an EnvVarSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnvVarSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.EnvVarSource; + + /** + * Verifies an EnvVarSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnvVarSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnvVarSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.EnvVarSource; + + /** + * Creates a plain object from an EnvVarSource message. Also converts values to other types if specified. + * @param message EnvVarSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.EnvVarSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnvVarSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnvVarSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecretKeySelector. */ + interface ISecretKeySelector { + + /** SecretKeySelector secret */ + secret?: (string|null); + + /** SecretKeySelector version */ + version?: (string|null); + } + + /** Represents a SecretKeySelector. */ + class SecretKeySelector implements ISecretKeySelector { + + /** + * Constructs a new SecretKeySelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ISecretKeySelector); + + /** SecretKeySelector secret. */ + public secret: string; + + /** SecretKeySelector version. */ + public version: string; + + /** + * Creates a new SecretKeySelector instance using the specified properties. + * @param [properties] Properties to set + * @returns SecretKeySelector instance + */ + public static create(properties?: google.cloud.run.v2.ISecretKeySelector): google.cloud.run.v2.SecretKeySelector; + + /** + * Encodes the specified SecretKeySelector message. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. + * @param message SecretKeySelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ISecretKeySelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecretKeySelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. + * @param message SecretKeySelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ISecretKeySelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecretKeySelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecretKeySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SecretKeySelector; + + /** + * Decodes a SecretKeySelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecretKeySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SecretKeySelector; + + /** + * Verifies a SecretKeySelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecretKeySelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecretKeySelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SecretKeySelector; + + /** + * Creates a plain object from a SecretKeySelector message. Also converts values to other types if specified. + * @param message SecretKeySelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.SecretKeySelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecretKeySelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecretKeySelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContainerPort. */ + interface IContainerPort { + + /** ContainerPort name */ + name?: (string|null); + + /** ContainerPort containerPort */ + containerPort?: (number|null); + } + + /** Represents a ContainerPort. */ + class ContainerPort implements IContainerPort { + + /** + * Constructs a new ContainerPort. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IContainerPort); + + /** ContainerPort name. */ + public name: string; + + /** ContainerPort containerPort. */ + public containerPort: number; + + /** + * Creates a new ContainerPort instance using the specified properties. + * @param [properties] Properties to set + * @returns ContainerPort instance + */ + public static create(properties?: google.cloud.run.v2.IContainerPort): google.cloud.run.v2.ContainerPort; + + /** + * Encodes the specified ContainerPort message. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. + * @param message ContainerPort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IContainerPort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContainerPort message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. + * @param message ContainerPort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IContainerPort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContainerPort message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContainerPort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ContainerPort; + + /** + * Decodes a ContainerPort message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContainerPort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ContainerPort; + + /** + * Verifies a ContainerPort message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContainerPort message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContainerPort + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ContainerPort; + + /** + * Creates a plain object from a ContainerPort message. Also converts values to other types if specified. + * @param message ContainerPort + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ContainerPort, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContainerPort to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContainerPort + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VolumeMount. */ + interface IVolumeMount { + + /** VolumeMount name */ + name?: (string|null); + + /** VolumeMount mountPath */ + mountPath?: (string|null); + + /** VolumeMount subPath */ + subPath?: (string|null); + } + + /** Represents a VolumeMount. */ + class VolumeMount implements IVolumeMount { + + /** + * Constructs a new VolumeMount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IVolumeMount); + + /** VolumeMount name. */ + public name: string; + + /** VolumeMount mountPath. */ + public mountPath: string; + + /** VolumeMount subPath. */ + public subPath: string; + + /** + * Creates a new VolumeMount instance using the specified properties. + * @param [properties] Properties to set + * @returns VolumeMount instance + */ + public static create(properties?: google.cloud.run.v2.IVolumeMount): google.cloud.run.v2.VolumeMount; + + /** + * Encodes the specified VolumeMount message. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. + * @param message VolumeMount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IVolumeMount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VolumeMount message, length delimited. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. + * @param message VolumeMount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IVolumeMount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VolumeMount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VolumeMount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.VolumeMount; + + /** + * Decodes a VolumeMount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VolumeMount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.VolumeMount; + + /** + * Verifies a VolumeMount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VolumeMount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VolumeMount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.VolumeMount; + + /** + * Creates a plain object from a VolumeMount message. Also converts values to other types if specified. + * @param message VolumeMount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.VolumeMount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VolumeMount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VolumeMount + * @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 name */ + name?: (string|null); + + /** Volume secret */ + secret?: (google.cloud.run.v2.ISecretVolumeSource|null); + + /** Volume cloudSqlInstance */ + cloudSqlInstance?: (google.cloud.run.v2.ICloudSqlInstance|null); + + /** Volume emptyDir */ + emptyDir?: (google.cloud.run.v2.IEmptyDirVolumeSource|null); + + /** Volume nfs */ + nfs?: (google.cloud.run.v2.INFSVolumeSource|null); + + /** Volume gcs */ + gcs?: (google.cloud.run.v2.IGCSVolumeSource|null); + } + + /** Represents a Volume. */ + class Volume implements IVolume { + + /** + * Constructs a new Volume. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IVolume); + + /** Volume name. */ + public name: string; + + /** Volume secret. */ + public secret?: (google.cloud.run.v2.ISecretVolumeSource|null); + + /** Volume cloudSqlInstance. */ + public cloudSqlInstance?: (google.cloud.run.v2.ICloudSqlInstance|null); + + /** Volume emptyDir. */ + public emptyDir?: (google.cloud.run.v2.IEmptyDirVolumeSource|null); + + /** Volume nfs. */ + public nfs?: (google.cloud.run.v2.INFSVolumeSource|null); + + /** Volume gcs. */ + public gcs?: (google.cloud.run.v2.IGCSVolumeSource|null); + + /** Volume volumeType. */ + public volumeType?: ("secret"|"cloudSqlInstance"|"emptyDir"|"nfs"|"gcs"); + + /** + * Creates a new Volume instance using the specified properties. + * @param [properties] Properties to set + * @returns Volume instance + */ + public static create(properties?: google.cloud.run.v2.IVolume): google.cloud.run.v2.Volume; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 SecretVolumeSource. */ + interface ISecretVolumeSource { + + /** SecretVolumeSource secret */ + secret?: (string|null); + + /** SecretVolumeSource items */ + items?: (google.cloud.run.v2.IVersionToPath[]|null); + + /** SecretVolumeSource defaultMode */ + defaultMode?: (number|null); + } + + /** Represents a SecretVolumeSource. */ + class SecretVolumeSource implements ISecretVolumeSource { + + /** + * Constructs a new SecretVolumeSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ISecretVolumeSource); + + /** SecretVolumeSource secret. */ + public secret: string; + + /** SecretVolumeSource items. */ + public items: google.cloud.run.v2.IVersionToPath[]; + + /** SecretVolumeSource defaultMode. */ + public defaultMode: number; + + /** + * Creates a new SecretVolumeSource instance using the specified properties. + * @param [properties] Properties to set + * @returns SecretVolumeSource instance + */ + public static create(properties?: google.cloud.run.v2.ISecretVolumeSource): google.cloud.run.v2.SecretVolumeSource; + + /** + * Encodes the specified SecretVolumeSource message. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. + * @param message SecretVolumeSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ISecretVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecretVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. + * @param message SecretVolumeSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ISecretVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecretVolumeSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecretVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SecretVolumeSource; + + /** + * Decodes a SecretVolumeSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecretVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SecretVolumeSource; + + /** + * Verifies a SecretVolumeSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecretVolumeSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecretVolumeSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SecretVolumeSource; + + /** + * Creates a plain object from a SecretVolumeSource message. Also converts values to other types if specified. + * @param message SecretVolumeSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.SecretVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecretVolumeSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecretVolumeSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VersionToPath. */ + interface IVersionToPath { + + /** VersionToPath path */ + path?: (string|null); + + /** VersionToPath version */ + version?: (string|null); + + /** VersionToPath mode */ + mode?: (number|null); + } + + /** Represents a VersionToPath. */ + class VersionToPath implements IVersionToPath { + + /** + * Constructs a new VersionToPath. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IVersionToPath); + + /** VersionToPath path. */ + public path: string; + + /** VersionToPath version. */ + public version: string; + + /** VersionToPath mode. */ + public mode: number; + + /** + * Creates a new VersionToPath instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionToPath instance + */ + public static create(properties?: google.cloud.run.v2.IVersionToPath): google.cloud.run.v2.VersionToPath; + + /** + * Encodes the specified VersionToPath message. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. + * @param message VersionToPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IVersionToPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionToPath message, length delimited. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. + * @param message VersionToPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IVersionToPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionToPath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionToPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.VersionToPath; + + /** + * Decodes a VersionToPath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionToPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.VersionToPath; + + /** + * Verifies a VersionToPath message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VersionToPath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionToPath + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.VersionToPath; + + /** + * Creates a plain object from a VersionToPath message. Also converts values to other types if specified. + * @param message VersionToPath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.VersionToPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionToPath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionToPath + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudSqlInstance. */ + interface ICloudSqlInstance { + + /** CloudSqlInstance instances */ + instances?: (string[]|null); + } + + /** Represents a CloudSqlInstance. */ + class CloudSqlInstance implements ICloudSqlInstance { + + /** + * Constructs a new CloudSqlInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ICloudSqlInstance); + + /** CloudSqlInstance instances. */ + public instances: string[]; + + /** + * Creates a new CloudSqlInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlInstance instance + */ + public static create(properties?: google.cloud.run.v2.ICloudSqlInstance): google.cloud.run.v2.CloudSqlInstance; + + /** + * Encodes the specified CloudSqlInstance message. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. + * @param message CloudSqlInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ICloudSqlInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlInstance message, length delimited. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. + * @param message CloudSqlInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ICloudSqlInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CloudSqlInstance; + + /** + * Decodes a CloudSqlInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CloudSqlInstance; + + /** + * Verifies a CloudSqlInstance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSqlInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CloudSqlInstance; + + /** + * Creates a plain object from a CloudSqlInstance message. Also converts values to other types if specified. + * @param message CloudSqlInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.CloudSqlInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlInstance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EmptyDirVolumeSource. */ + interface IEmptyDirVolumeSource { + + /** EmptyDirVolumeSource medium */ + medium?: (google.cloud.run.v2.EmptyDirVolumeSource.Medium|keyof typeof google.cloud.run.v2.EmptyDirVolumeSource.Medium|null); + + /** EmptyDirVolumeSource sizeLimit */ + sizeLimit?: (string|null); + } + + /** Represents an EmptyDirVolumeSource. */ + class EmptyDirVolumeSource implements IEmptyDirVolumeSource { + + /** + * Constructs a new EmptyDirVolumeSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IEmptyDirVolumeSource); + + /** EmptyDirVolumeSource medium. */ + public medium: (google.cloud.run.v2.EmptyDirVolumeSource.Medium|keyof typeof google.cloud.run.v2.EmptyDirVolumeSource.Medium); + + /** EmptyDirVolumeSource sizeLimit. */ + public sizeLimit: string; + + /** + * Creates a new EmptyDirVolumeSource instance using the specified properties. + * @param [properties] Properties to set + * @returns EmptyDirVolumeSource instance + */ + public static create(properties?: google.cloud.run.v2.IEmptyDirVolumeSource): google.cloud.run.v2.EmptyDirVolumeSource; + + /** + * Encodes the specified EmptyDirVolumeSource message. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. + * @param message EmptyDirVolumeSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IEmptyDirVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmptyDirVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. + * @param message EmptyDirVolumeSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IEmptyDirVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmptyDirVolumeSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmptyDirVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.EmptyDirVolumeSource; + + /** + * Decodes an EmptyDirVolumeSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmptyDirVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.EmptyDirVolumeSource; + + /** + * Verifies an EmptyDirVolumeSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EmptyDirVolumeSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmptyDirVolumeSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.EmptyDirVolumeSource; + + /** + * Creates a plain object from an EmptyDirVolumeSource message. Also converts values to other types if specified. + * @param message EmptyDirVolumeSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.EmptyDirVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmptyDirVolumeSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmptyDirVolumeSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EmptyDirVolumeSource { + + /** Medium enum. */ + enum Medium { + MEDIUM_UNSPECIFIED = 0, + MEMORY = 1 + } + } + + /** Properties of a NFSVolumeSource. */ + interface INFSVolumeSource { + + /** NFSVolumeSource server */ + server?: (string|null); + + /** NFSVolumeSource path */ + path?: (string|null); + + /** NFSVolumeSource readOnly */ + readOnly?: (boolean|null); + } + + /** Represents a NFSVolumeSource. */ + class NFSVolumeSource implements INFSVolumeSource { + + /** + * Constructs a new NFSVolumeSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.INFSVolumeSource); + + /** NFSVolumeSource server. */ + public server: string; + + /** NFSVolumeSource path. */ + public path: string; + + /** NFSVolumeSource readOnly. */ + public readOnly: boolean; + + /** + * Creates a new NFSVolumeSource instance using the specified properties. + * @param [properties] Properties to set + * @returns NFSVolumeSource instance + */ + public static create(properties?: google.cloud.run.v2.INFSVolumeSource): google.cloud.run.v2.NFSVolumeSource; + + /** + * Encodes the specified NFSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. + * @param message NFSVolumeSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.INFSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NFSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. + * @param message NFSVolumeSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.INFSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NFSVolumeSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NFSVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.NFSVolumeSource; + + /** + * Decodes a NFSVolumeSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NFSVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.NFSVolumeSource; + + /** + * Verifies a NFSVolumeSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NFSVolumeSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NFSVolumeSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.NFSVolumeSource; + + /** + * Creates a plain object from a NFSVolumeSource message. Also converts values to other types if specified. + * @param message NFSVolumeSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.NFSVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NFSVolumeSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NFSVolumeSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GCSVolumeSource. */ + interface IGCSVolumeSource { + + /** GCSVolumeSource bucket */ + bucket?: (string|null); + + /** GCSVolumeSource readOnly */ + readOnly?: (boolean|null); + + /** GCSVolumeSource mountOptions */ + mountOptions?: (string[]|null); + } + + /** Represents a GCSVolumeSource. */ + class GCSVolumeSource implements IGCSVolumeSource { + + /** + * Constructs a new GCSVolumeSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IGCSVolumeSource); + + /** GCSVolumeSource bucket. */ + public bucket: string; + + /** GCSVolumeSource readOnly. */ + public readOnly: boolean; + + /** GCSVolumeSource mountOptions. */ + public mountOptions: string[]; + + /** + * Creates a new GCSVolumeSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GCSVolumeSource instance + */ + public static create(properties?: google.cloud.run.v2.IGCSVolumeSource): google.cloud.run.v2.GCSVolumeSource; + + /** + * Encodes the specified GCSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. + * @param message GCSVolumeSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IGCSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. + * @param message GCSVolumeSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IGCSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCSVolumeSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCSVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GCSVolumeSource; + + /** + * Decodes a GCSVolumeSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCSVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GCSVolumeSource; + + /** + * Verifies a GCSVolumeSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCSVolumeSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCSVolumeSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GCSVolumeSource; + + /** + * Creates a plain object from a GCSVolumeSource message. Also converts values to other types if specified. + * @param message GCSVolumeSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.GCSVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCSVolumeSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCSVolumeSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Probe. */ + interface IProbe { + + /** Probe initialDelaySeconds */ + initialDelaySeconds?: (number|null); + + /** Probe timeoutSeconds */ + timeoutSeconds?: (number|null); + + /** Probe periodSeconds */ + periodSeconds?: (number|null); + + /** Probe failureThreshold */ + failureThreshold?: (number|null); + + /** Probe httpGet */ + httpGet?: (google.cloud.run.v2.IHTTPGetAction|null); + + /** Probe tcpSocket */ + tcpSocket?: (google.cloud.run.v2.ITCPSocketAction|null); + + /** Probe grpc */ + grpc?: (google.cloud.run.v2.IGRPCAction|null); + } + + /** Represents a Probe. */ + class Probe implements IProbe { + + /** + * Constructs a new Probe. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IProbe); + + /** Probe initialDelaySeconds. */ + public initialDelaySeconds: number; + + /** Probe timeoutSeconds. */ + public timeoutSeconds: number; + + /** Probe periodSeconds. */ + public periodSeconds: number; + + /** Probe failureThreshold. */ + public failureThreshold: number; + + /** Probe httpGet. */ + public httpGet?: (google.cloud.run.v2.IHTTPGetAction|null); + + /** Probe tcpSocket. */ + public tcpSocket?: (google.cloud.run.v2.ITCPSocketAction|null); + + /** Probe grpc. */ + public grpc?: (google.cloud.run.v2.IGRPCAction|null); + + /** Probe probeType. */ + public probeType?: ("httpGet"|"tcpSocket"|"grpc"); + + /** + * Creates a new Probe instance using the specified properties. + * @param [properties] Properties to set + * @returns Probe instance + */ + public static create(properties?: google.cloud.run.v2.IProbe): google.cloud.run.v2.Probe; + + /** + * Encodes the specified Probe message. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. + * @param message Probe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IProbe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Probe message, length delimited. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. + * @param message Probe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IProbe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Probe message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Probe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Probe; + + /** + * Decodes a Probe message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Probe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Probe; + + /** + * Verifies a Probe message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Probe message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Probe + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Probe; + + /** + * Creates a plain object from a Probe message. Also converts values to other types if specified. + * @param message Probe + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.Probe, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Probe to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Probe + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HTTPGetAction. */ + interface IHTTPGetAction { + + /** HTTPGetAction path */ + path?: (string|null); + + /** HTTPGetAction httpHeaders */ + httpHeaders?: (google.cloud.run.v2.IHTTPHeader[]|null); + + /** HTTPGetAction port */ + port?: (number|null); + } + + /** Represents a HTTPGetAction. */ + class HTTPGetAction implements IHTTPGetAction { + + /** + * Constructs a new HTTPGetAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IHTTPGetAction); + + /** HTTPGetAction path. */ + public path: string; + + /** HTTPGetAction httpHeaders. */ + public httpHeaders: google.cloud.run.v2.IHTTPHeader[]; + + /** HTTPGetAction port. */ + public port: number; + + /** + * Creates a new HTTPGetAction instance using the specified properties. + * @param [properties] Properties to set + * @returns HTTPGetAction instance + */ + public static create(properties?: google.cloud.run.v2.IHTTPGetAction): google.cloud.run.v2.HTTPGetAction; + + /** + * Encodes the specified HTTPGetAction message. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. + * @param message HTTPGetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IHTTPGetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HTTPGetAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. + * @param message HTTPGetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IHTTPGetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HTTPGetAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HTTPGetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.HTTPGetAction; + + /** + * Decodes a HTTPGetAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HTTPGetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.HTTPGetAction; + + /** + * Verifies a HTTPGetAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HTTPGetAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HTTPGetAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.HTTPGetAction; + + /** + * Creates a plain object from a HTTPGetAction message. Also converts values to other types if specified. + * @param message HTTPGetAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.HTTPGetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HTTPGetAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HTTPGetAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HTTPHeader. */ + interface IHTTPHeader { + + /** HTTPHeader name */ + name?: (string|null); + + /** HTTPHeader value */ + value?: (string|null); + } + + /** Represents a HTTPHeader. */ + class HTTPHeader implements IHTTPHeader { + + /** + * Constructs a new HTTPHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IHTTPHeader); + + /** HTTPHeader name. */ + public name: string; + + /** HTTPHeader value. */ + public value: string; + + /** + * Creates a new HTTPHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns HTTPHeader instance + */ + public static create(properties?: google.cloud.run.v2.IHTTPHeader): google.cloud.run.v2.HTTPHeader; + + /** + * Encodes the specified HTTPHeader message. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. + * @param message HTTPHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IHTTPHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HTTPHeader message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. + * @param message HTTPHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IHTTPHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HTTPHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HTTPHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.HTTPHeader; + + /** + * Decodes a HTTPHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HTTPHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.HTTPHeader; + + /** + * Verifies a HTTPHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HTTPHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HTTPHeader + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.HTTPHeader; + + /** + * Creates a plain object from a HTTPHeader message. Also converts values to other types if specified. + * @param message HTTPHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.HTTPHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HTTPHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HTTPHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TCPSocketAction. */ + interface ITCPSocketAction { + + /** TCPSocketAction port */ + port?: (number|null); + } + + /** Represents a TCPSocketAction. */ + class TCPSocketAction implements ITCPSocketAction { + + /** + * Constructs a new TCPSocketAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ITCPSocketAction); + + /** TCPSocketAction port. */ + public port: number; + + /** + * Creates a new TCPSocketAction instance using the specified properties. + * @param [properties] Properties to set + * @returns TCPSocketAction instance + */ + public static create(properties?: google.cloud.run.v2.ITCPSocketAction): google.cloud.run.v2.TCPSocketAction; + + /** + * Encodes the specified TCPSocketAction message. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. + * @param message TCPSocketAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ITCPSocketAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TCPSocketAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. + * @param message TCPSocketAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ITCPSocketAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TCPSocketAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TCPSocketAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TCPSocketAction; + + /** + * Decodes a TCPSocketAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TCPSocketAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TCPSocketAction; + + /** + * Verifies a TCPSocketAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TCPSocketAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TCPSocketAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TCPSocketAction; + + /** + * Creates a plain object from a TCPSocketAction message. Also converts values to other types if specified. + * @param message TCPSocketAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.TCPSocketAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TCPSocketAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TCPSocketAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GRPCAction. */ + interface IGRPCAction { + + /** GRPCAction port */ + port?: (number|null); + + /** GRPCAction service */ + service?: (string|null); + } + + /** Represents a GRPCAction. */ + class GRPCAction implements IGRPCAction { + + /** + * Constructs a new GRPCAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IGRPCAction); + + /** GRPCAction port. */ + public port: number; + + /** GRPCAction service. */ + public service: string; + + /** + * Creates a new GRPCAction instance using the specified properties. + * @param [properties] Properties to set + * @returns GRPCAction instance + */ + public static create(properties?: google.cloud.run.v2.IGRPCAction): google.cloud.run.v2.GRPCAction; + + /** + * Encodes the specified GRPCAction message. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. + * @param message GRPCAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IGRPCAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GRPCAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. + * @param message GRPCAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IGRPCAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GRPCAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GRPCAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GRPCAction; + + /** + * Decodes a GRPCAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GRPCAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GRPCAction; + + /** + * Verifies a GRPCAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GRPCAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GRPCAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GRPCAction; + + /** + * Creates a plain object from a GRPCAction message. Also converts values to other types if specified. + * @param message GRPCAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.GRPCAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GRPCAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GRPCAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BuildInfo. */ + interface IBuildInfo { + + /** BuildInfo functionTarget */ + functionTarget?: (string|null); + + /** BuildInfo sourceLocation */ + sourceLocation?: (string|null); + } + + /** Represents a BuildInfo. */ + class BuildInfo implements IBuildInfo { + + /** + * Constructs a new BuildInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IBuildInfo); + + /** BuildInfo functionTarget. */ + public functionTarget: string; + + /** BuildInfo sourceLocation. */ + public sourceLocation: string; + + /** + * Creates a new BuildInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildInfo instance + */ + public static create(properties?: google.cloud.run.v2.IBuildInfo): google.cloud.run.v2.BuildInfo; + + /** + * Encodes the specified BuildInfo message. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. + * @param message BuildInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IBuildInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildInfo message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. + * @param message BuildInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IBuildInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.BuildInfo; + + /** + * Decodes a BuildInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.BuildInfo; + + /** + * Verifies a BuildInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.BuildInfo; + + /** + * Creates a plain object from a BuildInfo message. Also converts values to other types if specified. + * @param message BuildInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.BuildInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuildInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SourceCode. */ + interface ISourceCode { + + /** SourceCode cloudStorageSource */ + cloudStorageSource?: (google.cloud.run.v2.SourceCode.ICloudStorageSource|null); + } + + /** Represents a SourceCode. */ + class SourceCode implements ISourceCode { + + /** + * Constructs a new SourceCode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ISourceCode); + + /** SourceCode cloudStorageSource. */ + public cloudStorageSource?: (google.cloud.run.v2.SourceCode.ICloudStorageSource|null); + + /** SourceCode sourceType. */ + public sourceType?: "cloudStorageSource"; + + /** + * Creates a new SourceCode instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCode instance + */ + public static create(properties?: google.cloud.run.v2.ISourceCode): google.cloud.run.v2.SourceCode; + + /** + * Encodes the specified SourceCode message. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. + * @param message SourceCode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ISourceCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCode message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. + * @param message SourceCode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ISourceCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SourceCode; + + /** + * Decodes a SourceCode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SourceCode; + + /** + * Verifies a SourceCode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SourceCode; + + /** + * Creates a plain object from a SourceCode message. Also converts values to other types if specified. + * @param message SourceCode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.SourceCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCode { + + /** Properties of a CloudStorageSource. */ + interface ICloudStorageSource { + + /** CloudStorageSource bucket */ + bucket?: (string|null); + + /** CloudStorageSource object */ + object?: (string|null); + + /** CloudStorageSource generation */ + generation?: (number|Long|string|null); + } + + /** Represents a CloudStorageSource. */ + class CloudStorageSource implements ICloudStorageSource { + + /** + * Constructs a new CloudStorageSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.SourceCode.ICloudStorageSource); + + /** CloudStorageSource bucket. */ + public bucket: string; + + /** CloudStorageSource object. */ + public object: string; + + /** CloudStorageSource generation. */ + public generation: (number|Long|string); + + /** + * Creates a new CloudStorageSource instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudStorageSource instance + */ + public static create(properties?: google.cloud.run.v2.SourceCode.ICloudStorageSource): google.cloud.run.v2.SourceCode.CloudStorageSource; + + /** + * Encodes the specified CloudStorageSource message. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. + * @param message CloudStorageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.SourceCode.ICloudStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudStorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. + * @param message CloudStorageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.SourceCode.ICloudStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudStorageSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudStorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SourceCode.CloudStorageSource; + + /** + * Decodes a CloudStorageSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudStorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SourceCode.CloudStorageSource; + + /** + * Verifies a CloudStorageSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudStorageSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudStorageSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SourceCode.CloudStorageSource; + + /** + * Creates a plain object from a CloudStorageSource message. Also converts values to other types if specified. + * @param message CloudStorageSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.SourceCode.CloudStorageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudStorageSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudStorageSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a VpcAccess. */ + interface IVpcAccess { + + /** VpcAccess connector */ + connector?: (string|null); + + /** VpcAccess egress */ + egress?: (google.cloud.run.v2.VpcAccess.VpcEgress|keyof typeof google.cloud.run.v2.VpcAccess.VpcEgress|null); + + /** VpcAccess networkInterfaces */ + networkInterfaces?: (google.cloud.run.v2.VpcAccess.INetworkInterface[]|null); + } + + /** Represents a VpcAccess. */ + class VpcAccess implements IVpcAccess { + + /** + * Constructs a new VpcAccess. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IVpcAccess); + + /** VpcAccess connector. */ + public connector: string; + + /** VpcAccess egress. */ + public egress: (google.cloud.run.v2.VpcAccess.VpcEgress|keyof typeof google.cloud.run.v2.VpcAccess.VpcEgress); + + /** VpcAccess networkInterfaces. */ + public networkInterfaces: google.cloud.run.v2.VpcAccess.INetworkInterface[]; + + /** + * Creates a new VpcAccess instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcAccess instance + */ + public static create(properties?: google.cloud.run.v2.IVpcAccess): google.cloud.run.v2.VpcAccess; + + /** + * Encodes the specified VpcAccess message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. + * @param message VpcAccess message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IVpcAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcAccess message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. + * @param message VpcAccess message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IVpcAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcAccess message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcAccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.VpcAccess; + + /** + * Decodes a VpcAccess message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcAccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.VpcAccess; + + /** + * Verifies a VpcAccess message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpcAccess message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcAccess + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.VpcAccess; + + /** + * Creates a plain object from a VpcAccess message. Also converts values to other types if specified. + * @param message VpcAccess + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.VpcAccess, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcAccess to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcAccess + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VpcAccess { + + /** VpcEgress enum. */ + enum VpcEgress { + VPC_EGRESS_UNSPECIFIED = 0, + ALL_TRAFFIC = 1, + PRIVATE_RANGES_ONLY = 2 + } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + + /** NetworkInterface tags */ + tags?: (string[]|null); + } + + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.VpcAccess.INetworkInterface); + + /** NetworkInterface network. */ + public network: string; + + /** NetworkInterface subnetwork. */ + public subnetwork: string; + + /** NetworkInterface tags. */ + public tags: string[]; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance + */ + public static create(properties?: google.cloud.run.v2.VpcAccess.INetworkInterface): google.cloud.run.v2.VpcAccess.NetworkInterface; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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 BinaryAuthorization. */ + interface IBinaryAuthorization { + + /** BinaryAuthorization useDefault */ + useDefault?: (boolean|null); + + /** BinaryAuthorization policy */ + policy?: (string|null); + + /** BinaryAuthorization breakglassJustification */ + breakglassJustification?: (string|null); + } + + /** Represents a BinaryAuthorization. */ + class BinaryAuthorization implements IBinaryAuthorization { + + /** + * Constructs a new BinaryAuthorization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IBinaryAuthorization); + + /** BinaryAuthorization useDefault. */ + public useDefault?: (boolean|null); + + /** BinaryAuthorization policy. */ + public policy?: (string|null); + + /** BinaryAuthorization breakglassJustification. */ + public breakglassJustification: string; + + /** BinaryAuthorization binauthzMethod. */ + public binauthzMethod?: ("useDefault"|"policy"); + + /** + * Creates a new BinaryAuthorization instance using the specified properties. + * @param [properties] Properties to set + * @returns BinaryAuthorization instance + */ + public static create(properties?: google.cloud.run.v2.IBinaryAuthorization): google.cloud.run.v2.BinaryAuthorization; + + /** + * Encodes the specified BinaryAuthorization message. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. + * @param message BinaryAuthorization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IBinaryAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BinaryAuthorization message, length delimited. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. + * @param message BinaryAuthorization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IBinaryAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BinaryAuthorization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BinaryAuthorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.BinaryAuthorization; + + /** + * Decodes a BinaryAuthorization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BinaryAuthorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.BinaryAuthorization; + + /** + * Verifies a BinaryAuthorization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BinaryAuthorization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BinaryAuthorization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.BinaryAuthorization; + + /** + * Creates a plain object from a BinaryAuthorization message. Also converts values to other types if specified. + * @param message BinaryAuthorization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.BinaryAuthorization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BinaryAuthorization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BinaryAuthorization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RevisionScaling. */ + interface IRevisionScaling { + + /** RevisionScaling minInstanceCount */ + minInstanceCount?: (number|null); + + /** RevisionScaling maxInstanceCount */ + maxInstanceCount?: (number|null); + } + + /** Represents a RevisionScaling. */ + class RevisionScaling implements IRevisionScaling { + + /** + * Constructs a new RevisionScaling. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IRevisionScaling); + + /** RevisionScaling minInstanceCount. */ + public minInstanceCount: number; + + /** RevisionScaling maxInstanceCount. */ + public maxInstanceCount: number; + + /** + * Creates a new RevisionScaling instance using the specified properties. + * @param [properties] Properties to set + * @returns RevisionScaling instance + */ + public static create(properties?: google.cloud.run.v2.IRevisionScaling): google.cloud.run.v2.RevisionScaling; + + /** + * Encodes the specified RevisionScaling message. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. + * @param message RevisionScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IRevisionScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevisionScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. + * @param message RevisionScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IRevisionScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevisionScaling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevisionScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RevisionScaling; + + /** + * Decodes a RevisionScaling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevisionScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RevisionScaling; + + /** + * Verifies a RevisionScaling message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RevisionScaling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevisionScaling + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RevisionScaling; + + /** + * Creates a plain object from a RevisionScaling message. Also converts values to other types if specified. + * @param message RevisionScaling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.RevisionScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevisionScaling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevisionScaling + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceMesh. */ + interface IServiceMesh { + + /** ServiceMesh mesh */ + mesh?: (string|null); + } + + /** Represents a ServiceMesh. */ + class ServiceMesh implements IServiceMesh { + + /** + * Constructs a new ServiceMesh. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IServiceMesh); + + /** ServiceMesh mesh. */ + public mesh: string; + + /** + * Creates a new ServiceMesh instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceMesh instance + */ + public static create(properties?: google.cloud.run.v2.IServiceMesh): google.cloud.run.v2.ServiceMesh; + + /** + * Encodes the specified ServiceMesh message. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. + * @param message ServiceMesh message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IServiceMesh, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceMesh message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. + * @param message ServiceMesh message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IServiceMesh, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceMesh message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceMesh + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ServiceMesh; + + /** + * Decodes a ServiceMesh message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceMesh + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ServiceMesh; + + /** + * Verifies a ServiceMesh message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceMesh message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceMesh + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ServiceMesh; + + /** + * Creates a plain object from a ServiceMesh message. Also converts values to other types if specified. + * @param message ServiceMesh + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ServiceMesh, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceMesh to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceMesh + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceScaling. */ + interface IServiceScaling { + + /** ServiceScaling minInstanceCount */ + minInstanceCount?: (number|null); + + /** ServiceScaling scalingMode */ + scalingMode?: (google.cloud.run.v2.ServiceScaling.ScalingMode|keyof typeof google.cloud.run.v2.ServiceScaling.ScalingMode|null); + + /** ServiceScaling maxInstanceCount */ + maxInstanceCount?: (number|null); + + /** ServiceScaling manualInstanceCount */ + manualInstanceCount?: (number|null); + } + + /** Represents a ServiceScaling. */ + class ServiceScaling implements IServiceScaling { + + /** + * Constructs a new ServiceScaling. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IServiceScaling); + + /** ServiceScaling minInstanceCount. */ + public minInstanceCount: number; + + /** ServiceScaling scalingMode. */ + public scalingMode: (google.cloud.run.v2.ServiceScaling.ScalingMode|keyof typeof google.cloud.run.v2.ServiceScaling.ScalingMode); + + /** ServiceScaling maxInstanceCount. */ + public maxInstanceCount: number; + + /** ServiceScaling manualInstanceCount. */ + public manualInstanceCount?: (number|null); + + /** + * Creates a new ServiceScaling instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceScaling instance + */ + public static create(properties?: google.cloud.run.v2.IServiceScaling): google.cloud.run.v2.ServiceScaling; + + /** + * Encodes the specified ServiceScaling message. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. + * @param message ServiceScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IServiceScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. + * @param message ServiceScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IServiceScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceScaling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ServiceScaling; + + /** + * Decodes a ServiceScaling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ServiceScaling; + + /** + * Verifies a ServiceScaling message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceScaling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceScaling + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ServiceScaling; + + /** + * Creates a plain object from a ServiceScaling message. Also converts values to other types if specified. + * @param message ServiceScaling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ServiceScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceScaling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceScaling + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServiceScaling { + + /** ScalingMode enum. */ + enum ScalingMode { + SCALING_MODE_UNSPECIFIED = 0, + AUTOMATIC = 1, + MANUAL = 2 + } + } + + /** Properties of a WorkerPoolScaling. */ + interface IWorkerPoolScaling { + + /** WorkerPoolScaling manualInstanceCount */ + manualInstanceCount?: (number|null); + } + + /** Represents a WorkerPoolScaling. */ + class WorkerPoolScaling implements IWorkerPoolScaling { + + /** + * Constructs a new WorkerPoolScaling. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IWorkerPoolScaling); + + /** WorkerPoolScaling manualInstanceCount. */ + public manualInstanceCount?: (number|null); + + /** + * Creates a new WorkerPoolScaling instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerPoolScaling instance + */ + public static create(properties?: google.cloud.run.v2.IWorkerPoolScaling): google.cloud.run.v2.WorkerPoolScaling; + + /** + * Encodes the specified WorkerPoolScaling message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. + * @param message WorkerPoolScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IWorkerPoolScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerPoolScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. + * @param message WorkerPoolScaling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IWorkerPoolScaling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerPoolScaling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerPoolScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.WorkerPoolScaling; + + /** + * Decodes a WorkerPoolScaling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerPoolScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.WorkerPoolScaling; + + /** + * Verifies a WorkerPoolScaling message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkerPoolScaling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerPoolScaling + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.WorkerPoolScaling; + + /** + * Creates a plain object from a WorkerPoolScaling message. Also converts values to other types if specified. + * @param message WorkerPoolScaling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.WorkerPoolScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerPoolScaling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerPoolScaling + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSelector. */ + interface INodeSelector { + + /** NodeSelector accelerator */ + accelerator?: (string|null); + } + + /** Represents a NodeSelector. */ + class NodeSelector implements INodeSelector { + + /** + * Constructs a new NodeSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.INodeSelector); + + /** NodeSelector accelerator. */ + public accelerator: string; + + /** + * Creates a new NodeSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSelector instance + */ + public static create(properties?: google.cloud.run.v2.INodeSelector): google.cloud.run.v2.NodeSelector; + + /** + * Encodes the specified NodeSelector message. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. + * @param message NodeSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.INodeSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. + * @param message NodeSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.INodeSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.NodeSelector; + + /** + * Decodes a NodeSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.NodeSelector; + + /** + * Verifies a NodeSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.NodeSelector; + + /** + * Creates a plain object from a NodeSelector message. Also converts values to other types if specified. + * @param message NodeSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.NodeSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BuildConfig. */ + interface IBuildConfig { + + /** BuildConfig name */ + name?: (string|null); + + /** BuildConfig sourceLocation */ + sourceLocation?: (string|null); + + /** BuildConfig functionTarget */ + functionTarget?: (string|null); + + /** BuildConfig imageUri */ + imageUri?: (string|null); + + /** BuildConfig baseImage */ + baseImage?: (string|null); + + /** BuildConfig enableAutomaticUpdates */ + enableAutomaticUpdates?: (boolean|null); + + /** BuildConfig workerPool */ + workerPool?: (string|null); + + /** BuildConfig environmentVariables */ + environmentVariables?: ({ [k: string]: string }|null); + + /** BuildConfig serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents a BuildConfig. */ + class BuildConfig implements IBuildConfig { + + /** + * Constructs a new BuildConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IBuildConfig); + + /** BuildConfig name. */ + public name: string; + + /** BuildConfig sourceLocation. */ + public sourceLocation: string; + + /** BuildConfig functionTarget. */ + public functionTarget: string; + + /** BuildConfig imageUri. */ + public imageUri: string; + + /** BuildConfig baseImage. */ + public baseImage: string; + + /** BuildConfig enableAutomaticUpdates. */ + public enableAutomaticUpdates: boolean; + + /** BuildConfig workerPool. */ + public workerPool: string; + + /** BuildConfig environmentVariables. */ + public environmentVariables: { [k: string]: string }; + + /** BuildConfig serviceAccount. */ + public serviceAccount: string; + + /** + * Creates a new BuildConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildConfig instance + */ + public static create(properties?: google.cloud.run.v2.IBuildConfig): google.cloud.run.v2.BuildConfig; + + /** + * Encodes the specified BuildConfig message. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. + * @param message BuildConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IBuildConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildConfig message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. + * @param message BuildConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IBuildConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.BuildConfig; + + /** + * Decodes a BuildConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.BuildConfig; + + /** + * Verifies a BuildConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.BuildConfig; + + /** + * Creates a plain object from a BuildConfig message. Also converts values to other types if specified. + * @param message BuildConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.BuildConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuildConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** IngressTraffic enum. */ + enum IngressTraffic { + INGRESS_TRAFFIC_UNSPECIFIED = 0, + INGRESS_TRAFFIC_ALL = 1, + INGRESS_TRAFFIC_INTERNAL_ONLY = 2, + INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3, + INGRESS_TRAFFIC_NONE = 4 + } + + /** ExecutionEnvironment enum. */ + enum ExecutionEnvironment { + EXECUTION_ENVIRONMENT_UNSPECIFIED = 0, + EXECUTION_ENVIRONMENT_GEN1 = 1, + EXECUTION_ENVIRONMENT_GEN2 = 2 + } + + /** EncryptionKeyRevocationAction enum. */ + enum EncryptionKeyRevocationAction { + ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0, + PREVENT_NEW = 1, + SHUTDOWN = 2 + } + + /** Properties of an ExecutionTemplate. */ + interface IExecutionTemplate { + + /** ExecutionTemplate labels */ + labels?: ({ [k: string]: string }|null); + + /** ExecutionTemplate annotations */ + annotations?: ({ [k: string]: string }|null); + + /** ExecutionTemplate parallelism */ + parallelism?: (number|null); + + /** ExecutionTemplate taskCount */ + taskCount?: (number|null); + + /** ExecutionTemplate template */ + template?: (google.cloud.run.v2.ITaskTemplate|null); + } + + /** Represents an ExecutionTemplate. */ + class ExecutionTemplate implements IExecutionTemplate { + + /** + * Constructs a new ExecutionTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IExecutionTemplate); + + /** ExecutionTemplate labels. */ + public labels: { [k: string]: string }; + + /** ExecutionTemplate annotations. */ + public annotations: { [k: string]: string }; + + /** ExecutionTemplate parallelism. */ + public parallelism: number; + + /** ExecutionTemplate taskCount. */ + public taskCount: number; + + /** ExecutionTemplate template. */ + public template?: (google.cloud.run.v2.ITaskTemplate|null); + + /** + * Creates a new ExecutionTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionTemplate instance + */ + public static create(properties?: google.cloud.run.v2.IExecutionTemplate): google.cloud.run.v2.ExecutionTemplate; + + /** + * Encodes the specified ExecutionTemplate message. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. + * @param message ExecutionTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IExecutionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. + * @param message ExecutionTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IExecutionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ExecutionTemplate; + + /** + * Decodes an ExecutionTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ExecutionTemplate; + + /** + * Verifies an ExecutionTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecutionTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ExecutionTemplate; + + /** + * Creates a plain object from an ExecutionTemplate message. Also converts values to other types if specified. + * @param message ExecutionTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ExecutionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Instances */ + class Instances extends $protobuf.rpc.Service { + + /** + * Constructs a new Instances 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 Instances 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): Instances; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.run.v2.ICreateInstanceRequest, callback: google.cloud.run.v2.Instances.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.run.v2.ICreateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.run.v2.IDeleteInstanceRequest, callback: google.cloud.run.v2.Instances.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.run.v2.IDeleteInstanceRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.run.v2.IGetInstanceRequest, callback: google.cloud.run.v2.Instances.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.run.v2.IGetInstanceRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.run.v2.IListInstancesRequest, callback: google.cloud.run.v2.Instances.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.run.v2.IListInstancesRequest): Promise; + + /** + * Calls StopInstance. + * @param request StopInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public stopInstance(request: google.cloud.run.v2.IStopInstanceRequest, callback: google.cloud.run.v2.Instances.StopInstanceCallback): void; + + /** + * Calls StopInstance. + * @param request StopInstanceRequest message or plain object + * @returns Promise + */ + public stopInstance(request: google.cloud.run.v2.IStopInstanceRequest): Promise; + + /** + * Calls StartInstance. + * @param request StartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startInstance(request: google.cloud.run.v2.IStartInstanceRequest, callback: google.cloud.run.v2.Instances.StartInstanceCallback): void; + + /** + * Calls StartInstance. + * @param request StartInstanceRequest message or plain object + * @returns Promise + */ + public startInstance(request: google.cloud.run.v2.IStartInstanceRequest): Promise; + } + + namespace Instances { + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.run.v2.Instance) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.run.v2.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|stopInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type StopInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|startInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type StartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.run.v2.IInstance|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.run.v2.IInstance|null); + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.ICreateInstanceRequest): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IGetInstanceRequest): google.cloud.run.v2.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + + /** DeleteInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteInstanceRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** DeleteInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteInstanceRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IDeleteInstanceRequest): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.run.v2.IListInstancesRequest): google.cloud.run.v2.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.run.v2.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.run.v2.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.run.v2.IListInstancesResponse): google.cloud.run.v2.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopInstanceRequest. */ + interface IStopInstanceRequest { + + /** StopInstanceRequest name */ + name?: (string|null); + + /** StopInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** StopInstanceRequest etag */ + etag?: (string|null); + } + + /** Represents a StopInstanceRequest. */ + class StopInstanceRequest implements IStopInstanceRequest { + + /** + * Constructs a new StopInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IStopInstanceRequest); + + /** StopInstanceRequest name. */ + public name: string; + + /** StopInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** StopInstanceRequest etag. */ + public etag: string; + + /** + * Creates a new StopInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IStopInstanceRequest): google.cloud.run.v2.StopInstanceRequest; + + /** + * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @param message StopInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @param message StopInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StopInstanceRequest; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StopInstanceRequest; + + /** + * Verifies a StopInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StopInstanceRequest; + + /** + * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. + * @param message StopInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.StopInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartInstanceRequest. */ + interface IStartInstanceRequest { + + /** StartInstanceRequest name */ + name?: (string|null); + + /** StartInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** StartInstanceRequest etag */ + etag?: (string|null); + } + + /** Represents a StartInstanceRequest. */ + class StartInstanceRequest implements IStartInstanceRequest { + + /** + * Constructs a new StartInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IStartInstanceRequest); + + /** StartInstanceRequest name. */ + public name: string; + + /** StartInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** StartInstanceRequest etag. */ + public etag: string; + + /** + * Creates a new StartInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IStartInstanceRequest): google.cloud.run.v2.StartInstanceRequest; + + /** + * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @param message StartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @param message StartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StartInstanceRequest; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StartInstanceRequest; + + /** + * Verifies a StartInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StartInstanceRequest; + + /** + * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. + * @param message StartInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.StartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance description */ + description?: (string|null); + + /** Instance uid */ + uid?: (string|null); + + /** Instance generation */ + generation?: (number|Long|string|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Instance creator */ + creator?: (string|null); + + /** Instance lastModifier */ + lastModifier?: (string|null); + + /** Instance client */ + client?: (string|null); + + /** Instance clientVersion */ + clientVersion?: (string|null); + + /** Instance launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** Instance binaryAuthorization */ + binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** Instance vpcAccess */ + vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** Instance serviceAccount */ + serviceAccount?: (string|null); + + /** Instance containers */ + containers?: (google.cloud.run.v2.IContainer[]|null); + + /** Instance volumes */ + volumes?: (google.cloud.run.v2.IVolume[]|null); + + /** Instance encryptionKey */ + encryptionKey?: (string|null); + + /** Instance encryptionKeyRevocationAction */ + encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); + + /** Instance encryptionKeyShutdownDuration */ + encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** Instance nodeSelector */ + nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** Instance gpuZonalRedundancyDisabled */ + gpuZonalRedundancyDisabled?: (boolean|null); + + /** Instance ingress */ + ingress?: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic|null); + + /** Instance invokerIamDisabled */ + invokerIamDisabled?: (boolean|null); + + /** Instance iapEnabled */ + iapEnabled?: (boolean|null); + + /** Instance observedGeneration */ + observedGeneration?: (number|Long|string|null); + + /** Instance logUri */ + logUri?: (string|null); + + /** Instance terminalCondition */ + terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** Instance conditions */ + conditions?: (google.cloud.run.v2.ICondition[]|null); + + /** Instance containerStatuses */ + containerStatuses?: (google.cloud.run.v2.IContainerStatus[]|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Instance urls */ + urls?: (string[]|null); + + /** Instance reconciling */ + reconciling?: (boolean|null); + + /** Instance etag */ + etag?: (string|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance description. */ + public description: string; + + /** Instance uid. */ + public uid: string; + + /** Instance generation. */ + public generation: (number|Long|string); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance annotations. */ + public annotations: { [k: string]: string }; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Instance creator. */ + public creator: string; + + /** Instance lastModifier. */ + public lastModifier: string; + + /** Instance client. */ + public client: string; + + /** Instance clientVersion. */ + public clientVersion: string; + + /** Instance launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** Instance binaryAuthorization. */ + public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** Instance vpcAccess. */ + public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** Instance serviceAccount. */ + public serviceAccount: string; + + /** Instance containers. */ + public containers: google.cloud.run.v2.IContainer[]; + + /** Instance volumes. */ + public volumes: google.cloud.run.v2.IVolume[]; + + /** Instance encryptionKey. */ + public encryptionKey: string; + + /** Instance encryptionKeyRevocationAction. */ + public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); + + /** Instance encryptionKeyShutdownDuration. */ + public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** Instance nodeSelector. */ + public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** Instance gpuZonalRedundancyDisabled. */ + public gpuZonalRedundancyDisabled?: (boolean|null); + + /** Instance ingress. */ + public ingress: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic); + + /** Instance invokerIamDisabled. */ + public invokerIamDisabled: boolean; + + /** Instance iapEnabled. */ + public iapEnabled: boolean; + + /** Instance observedGeneration. */ + public observedGeneration: (number|Long|string); + + /** Instance logUri. */ + public logUri: string; + + /** Instance terminalCondition. */ + public terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** Instance conditions. */ + public conditions: google.cloud.run.v2.ICondition[]; + + /** Instance containerStatuses. */ + public containerStatuses: google.cloud.run.v2.IContainerStatus[]; + + /** Instance satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Instance urls. */ + public urls: string[]; + + /** Instance reconciling. */ + public reconciling: boolean; + + /** Instance etag. */ + public etag: string; + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.run.v2.IInstance): google.cloud.run.v2.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceSplit. */ + interface IInstanceSplit { + + /** InstanceSplit type */ + type?: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType|null); + + /** InstanceSplit revision */ + revision?: (string|null); + + /** InstanceSplit percent */ + percent?: (number|null); + } + + /** Represents an InstanceSplit. */ + class InstanceSplit implements IInstanceSplit { + + /** + * Constructs a new InstanceSplit. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IInstanceSplit); + + /** InstanceSplit type. */ + public type: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType); + + /** InstanceSplit revision. */ + public revision: string; + + /** InstanceSplit percent. */ + public percent: number; + + /** + * Creates a new InstanceSplit instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceSplit instance + */ + public static create(properties?: google.cloud.run.v2.IInstanceSplit): google.cloud.run.v2.InstanceSplit; + + /** + * Encodes the specified InstanceSplit message. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. + * @param message InstanceSplit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IInstanceSplit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceSplit message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. + * @param message InstanceSplit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IInstanceSplit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceSplit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceSplit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.InstanceSplit; + + /** + * Decodes an InstanceSplit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceSplit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.InstanceSplit; + + /** + * Verifies an InstanceSplit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceSplit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceSplit + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.InstanceSplit; + + /** + * Creates a plain object from an InstanceSplit message. Also converts values to other types if specified. + * @param message InstanceSplit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.InstanceSplit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceSplit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceSplit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceSplitStatus. */ + interface IInstanceSplitStatus { + + /** InstanceSplitStatus type */ + type?: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType|null); + + /** InstanceSplitStatus revision */ + revision?: (string|null); + + /** InstanceSplitStatus percent */ + percent?: (number|null); + } + + /** Represents an InstanceSplitStatus. */ + class InstanceSplitStatus implements IInstanceSplitStatus { + + /** + * Constructs a new InstanceSplitStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IInstanceSplitStatus); + + /** InstanceSplitStatus type. */ + public type: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType); + + /** InstanceSplitStatus revision. */ + public revision: string; + + /** InstanceSplitStatus percent. */ + public percent: number; + + /** + * Creates a new InstanceSplitStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceSplitStatus instance + */ + public static create(properties?: google.cloud.run.v2.IInstanceSplitStatus): google.cloud.run.v2.InstanceSplitStatus; + + /** + * Encodes the specified InstanceSplitStatus message. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. + * @param message InstanceSplitStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IInstanceSplitStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceSplitStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. + * @param message InstanceSplitStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IInstanceSplitStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceSplitStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceSplitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.InstanceSplitStatus; + + /** + * Decodes an InstanceSplitStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceSplitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.InstanceSplitStatus; + + /** + * Verifies an InstanceSplitStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceSplitStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceSplitStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.InstanceSplitStatus; + + /** + * Creates a plain object from an InstanceSplitStatus message. Also converts values to other types if specified. + * @param message InstanceSplitStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.InstanceSplitStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceSplitStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceSplitStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** InstanceSplitAllocationType enum. */ + enum InstanceSplitAllocationType { + INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED = 0, + INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST = 1, + INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION = 2 + } + + /** Represents a Jobs */ + class Jobs extends $protobuf.rpc.Service { + + /** + * Constructs a new Jobs 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 Jobs 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): Jobs; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createJob(request: google.cloud.run.v2.ICreateJobRequest, callback: google.cloud.run.v2.Jobs.CreateJobCallback): void; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @returns Promise + */ + public createJob(request: google.cloud.run.v2.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.run.v2.IGetJobRequest, callback: google.cloud.run.v2.Jobs.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.run.v2.IGetJobRequest): 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.run.v2.IListJobsRequest, callback: google.cloud.run.v2.Jobs.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.run.v2.IListJobsRequest): Promise; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateJob(request: google.cloud.run.v2.IUpdateJobRequest, callback: google.cloud.run.v2.Jobs.UpdateJobCallback): void; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @returns Promise + */ + public updateJob(request: google.cloud.run.v2.IUpdateJobRequest): 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.run.v2.IDeleteJobRequest, callback: google.cloud.run.v2.Jobs.DeleteJobCallback): void; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @returns Promise + */ + public deleteJob(request: google.cloud.run.v2.IDeleteJobRequest): Promise; + + /** + * Calls RunJob. + * @param request RunJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runJob(request: google.cloud.run.v2.IRunJobRequest, callback: google.cloud.run.v2.Jobs.RunJobCallback): void; + + /** + * Calls RunJob. + * @param request RunJobRequest message or plain object + * @returns Promise + */ + public runJob(request: google.cloud.run.v2.IRunJobRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.run.v2.Jobs.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.run.v2.Jobs.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.run.v2.Jobs.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace Jobs { + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|createJob}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.run.v2.Job) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|updateJob}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|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.run.v2.Jobs|runJob}. + * @param error Error, if any + * @param [response] Operation + */ + type RunJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a CreateJobRequest. */ + interface ICreateJobRequest { + + /** CreateJobRequest parent */ + parent?: (string|null); + + /** CreateJobRequest job */ + job?: (google.cloud.run.v2.IJob|null); + + /** CreateJobRequest jobId */ + jobId?: (string|null); + + /** CreateJobRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateJobRequest. */ + class CreateJobRequest implements ICreateJobRequest { + + /** + * Constructs a new CreateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ICreateJobRequest); + + /** CreateJobRequest parent. */ + public parent: string; + + /** CreateJobRequest job. */ + public job?: (google.cloud.run.v2.IJob|null); + + /** CreateJobRequest jobId. */ + public jobId: string; + + /** CreateJobRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobRequest instance + */ + public static create(properties?: google.cloud.run.v2.ICreateJobRequest): google.cloud.run.v2.CreateJobRequest; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.IGetJobRequest): google.cloud.run.v2.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 an UpdateJobRequest. */ + interface IUpdateJobRequest { + + /** UpdateJobRequest job */ + job?: (google.cloud.run.v2.IJob|null); + + /** UpdateJobRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateJobRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateJobRequest. */ + class UpdateJobRequest implements IUpdateJobRequest { + + /** + * Constructs a new UpdateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IUpdateJobRequest); + + /** UpdateJobRequest job. */ + public job?: (google.cloud.run.v2.IJob|null); + + /** UpdateJobRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateJobRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateJobRequest instance + */ + public static create(properties?: google.cloud.run.v2.IUpdateJobRequest): google.cloud.run.v2.UpdateJobRequest; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListJobsRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListJobsRequest); + + /** ListJobsRequest parent. */ + public parent: string; + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** ListJobsRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.run.v2.IListJobsRequest): google.cloud.run.v2.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.cloud.run.v2.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.cloud.run.v2.IListJobsResponse): google.cloud.run.v2.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 DeleteJobRequest. */ + interface IDeleteJobRequest { + + /** DeleteJobRequest name */ + name?: (string|null); + + /** DeleteJobRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteJobRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteJobRequest. */ + class DeleteJobRequest implements IDeleteJobRequest { + + /** + * Constructs a new DeleteJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IDeleteJobRequest); + + /** DeleteJobRequest name. */ + public name: string; + + /** DeleteJobRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteJobRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobRequest instance + */ + public static create(properties?: google.cloud.run.v2.IDeleteJobRequest): google.cloud.run.v2.DeleteJobRequest; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 RunJobRequest. */ + interface IRunJobRequest { + + /** RunJobRequest name */ + name?: (string|null); + + /** RunJobRequest validateOnly */ + validateOnly?: (boolean|null); + + /** RunJobRequest etag */ + etag?: (string|null); + + /** RunJobRequest overrides */ + overrides?: (google.cloud.run.v2.RunJobRequest.IOverrides|null); + } + + /** Represents a RunJobRequest. */ + class RunJobRequest implements IRunJobRequest { + + /** + * Constructs a new RunJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IRunJobRequest); + + /** RunJobRequest name. */ + public name: string; + + /** RunJobRequest validateOnly. */ + public validateOnly: boolean; + + /** RunJobRequest etag. */ + public etag: string; + + /** RunJobRequest overrides. */ + public overrides?: (google.cloud.run.v2.RunJobRequest.IOverrides|null); + + /** + * Creates a new RunJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunJobRequest instance + */ + public static create(properties?: google.cloud.run.v2.IRunJobRequest): google.cloud.run.v2.RunJobRequest; + + /** + * Encodes the specified RunJobRequest message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. + * @param message RunJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IRunJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. + * @param message RunJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IRunJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest; + + /** + * Decodes a RunJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest; + + /** + * Verifies a RunJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest; + + /** + * Creates a plain object from a RunJobRequest message. Also converts values to other types if specified. + * @param message RunJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.RunJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RunJobRequest { + + /** Properties of an Overrides. */ + interface IOverrides { + + /** Overrides containerOverrides */ + containerOverrides?: (google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride[]|null); + + /** Overrides taskCount */ + taskCount?: (number|null); + + /** Overrides timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents an Overrides. */ + class Overrides implements IOverrides { + + /** + * Constructs a new Overrides. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.RunJobRequest.IOverrides); + + /** Overrides containerOverrides. */ + public containerOverrides: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride[]; + + /** Overrides taskCount. */ + public taskCount: number; + + /** Overrides timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new Overrides instance using the specified properties. + * @param [properties] Properties to set + * @returns Overrides instance + */ + public static create(properties?: google.cloud.run.v2.RunJobRequest.IOverrides): google.cloud.run.v2.RunJobRequest.Overrides; + + /** + * Encodes the specified Overrides message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. + * @param message Overrides message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.RunJobRequest.IOverrides, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Overrides message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. + * @param message Overrides message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.RunJobRequest.IOverrides, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Overrides message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Overrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest.Overrides; + + /** + * Decodes an Overrides message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Overrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest.Overrides; + + /** + * Verifies an Overrides message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Overrides message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Overrides + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest.Overrides; + + /** + * Creates a plain object from an Overrides message. Also converts values to other types if specified. + * @param message Overrides + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.RunJobRequest.Overrides, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Overrides to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Overrides + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Overrides { + + /** Properties of a ContainerOverride. */ + interface IContainerOverride { + + /** ContainerOverride name */ + name?: (string|null); + + /** ContainerOverride args */ + args?: (string[]|null); + + /** ContainerOverride env */ + env?: (google.cloud.run.v2.IEnvVar[]|null); + + /** ContainerOverride clearArgs */ + clearArgs?: (boolean|null); + } + + /** Represents a ContainerOverride. */ + class ContainerOverride implements IContainerOverride { + + /** + * Constructs a new ContainerOverride. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride); + + /** ContainerOverride name. */ + public name: string; + + /** ContainerOverride args. */ + public args: string[]; + + /** ContainerOverride env. */ + public env: google.cloud.run.v2.IEnvVar[]; + + /** ContainerOverride clearArgs. */ + public clearArgs: boolean; + + /** + * Creates a new ContainerOverride instance using the specified properties. + * @param [properties] Properties to set + * @returns ContainerOverride instance + */ + public static create(properties?: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; + + /** + * Encodes the specified ContainerOverride message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. + * @param message ContainerOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContainerOverride message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. + * @param message ContainerOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContainerOverride message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContainerOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; + + /** + * Decodes a ContainerOverride message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContainerOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; + + /** + * Verifies a ContainerOverride message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContainerOverride message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContainerOverride + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; + + /** + * Creates a plain object from a ContainerOverride message. Also converts values to other types if specified. + * @param message ContainerOverride + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContainerOverride to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContainerOverride + * @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 generation */ + generation?: (number|Long|string|null); + + /** Job labels */ + labels?: ({ [k: string]: string }|null); + + /** Job annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Job createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Job updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Job deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Job expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Job creator */ + creator?: (string|null); + + /** Job lastModifier */ + lastModifier?: (string|null); + + /** Job client */ + client?: (string|null); + + /** Job clientVersion */ + clientVersion?: (string|null); + + /** Job launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** Job binaryAuthorization */ + binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** Job template */ + template?: (google.cloud.run.v2.IExecutionTemplate|null); + + /** Job observedGeneration */ + observedGeneration?: (number|Long|string|null); + + /** Job terminalCondition */ + terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** Job conditions */ + conditions?: (google.cloud.run.v2.ICondition[]|null); + + /** Job executionCount */ + executionCount?: (number|null); + + /** Job latestCreatedExecution */ + latestCreatedExecution?: (google.cloud.run.v2.IExecutionReference|null); + + /** Job reconciling */ + reconciling?: (boolean|null); + + /** Job satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Job startExecutionToken */ + startExecutionToken?: (string|null); + + /** Job runExecutionToken */ + runExecutionToken?: (string|null); + + /** Job etag */ + etag?: (string|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IJob); + + /** Job name. */ + public name: string; + + /** Job uid. */ + public uid: string; + + /** Job generation. */ + public generation: (number|Long|string); + + /** Job labels. */ + public labels: { [k: string]: string }; + + /** Job annotations. */ + public annotations: { [k: string]: string }; + + /** Job createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Job updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Job deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Job expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Job creator. */ + public creator: string; + + /** Job lastModifier. */ + public lastModifier: string; + + /** Job client. */ + public client: string; + + /** Job clientVersion. */ + public clientVersion: string; + + /** Job launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** Job binaryAuthorization. */ + public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** Job template. */ + public template?: (google.cloud.run.v2.IExecutionTemplate|null); + + /** Job observedGeneration. */ + public observedGeneration: (number|Long|string); + + /** Job terminalCondition. */ + public terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** Job conditions. */ + public conditions: google.cloud.run.v2.ICondition[]; + + /** Job executionCount. */ + public executionCount: number; + + /** Job latestCreatedExecution. */ + public latestCreatedExecution?: (google.cloud.run.v2.IExecutionReference|null); + + /** Job reconciling. */ + public reconciling: boolean; + + /** Job satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Job startExecutionToken. */ + public startExecutionToken?: (string|null); + + /** Job runExecutionToken. */ + public runExecutionToken?: (string|null); + + /** Job etag. */ + public etag: string; + + /** Job createExecution. */ + public createExecution?: ("startExecutionToken"|"runExecutionToken"); + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.run.v2.IJob): google.cloud.run.v2.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 an ExecutionReference. */ + interface IExecutionReference { + + /** ExecutionReference name */ + name?: (string|null); + + /** ExecutionReference createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ExecutionReference completionTime */ + completionTime?: (google.protobuf.ITimestamp|null); + + /** ExecutionReference deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** ExecutionReference completionStatus */ + completionStatus?: (google.cloud.run.v2.ExecutionReference.CompletionStatus|keyof typeof google.cloud.run.v2.ExecutionReference.CompletionStatus|null); + } + + /** Represents an ExecutionReference. */ + class ExecutionReference implements IExecutionReference { + + /** + * Constructs a new ExecutionReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IExecutionReference); + + /** ExecutionReference name. */ + public name: string; + + /** ExecutionReference createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ExecutionReference completionTime. */ + public completionTime?: (google.protobuf.ITimestamp|null); + + /** ExecutionReference deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** ExecutionReference completionStatus. */ + public completionStatus: (google.cloud.run.v2.ExecutionReference.CompletionStatus|keyof typeof google.cloud.run.v2.ExecutionReference.CompletionStatus); + + /** + * Creates a new ExecutionReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionReference instance + */ + public static create(properties?: google.cloud.run.v2.IExecutionReference): google.cloud.run.v2.ExecutionReference; + + /** + * Encodes the specified ExecutionReference message. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. + * @param message ExecutionReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IExecutionReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionReference message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. + * @param message ExecutionReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IExecutionReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ExecutionReference; + + /** + * Decodes an ExecutionReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ExecutionReference; + + /** + * Verifies an ExecutionReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecutionReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ExecutionReference; + + /** + * Creates a plain object from an ExecutionReference message. Also converts values to other types if specified. + * @param message ExecutionReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ExecutionReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecutionReference { + + /** CompletionStatus enum. */ + enum CompletionStatus { + COMPLETION_STATUS_UNSPECIFIED = 0, + EXECUTION_SUCCEEDED = 1, + EXECUTION_FAILED = 2, + EXECUTION_RUNNING = 3, + EXECUTION_PENDING = 4, + EXECUTION_CANCELLED = 5 + } + } + + /** Represents a Revisions */ + class Revisions extends $protobuf.rpc.Service { + + /** + * Constructs a new Revisions 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 Revisions 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): Revisions; + + /** + * Calls GetRevision. + * @param request GetRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Revision + */ + public getRevision(request: google.cloud.run.v2.IGetRevisionRequest, callback: google.cloud.run.v2.Revisions.GetRevisionCallback): void; + + /** + * Calls GetRevision. + * @param request GetRevisionRequest message or plain object + * @returns Promise + */ + public getRevision(request: google.cloud.run.v2.IGetRevisionRequest): Promise; + + /** + * Calls ListRevisions. + * @param request ListRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRevisionsResponse + */ + public listRevisions(request: google.cloud.run.v2.IListRevisionsRequest, callback: google.cloud.run.v2.Revisions.ListRevisionsCallback): void; + + /** + * Calls ListRevisions. + * @param request ListRevisionsRequest message or plain object + * @returns Promise + */ + public listRevisions(request: google.cloud.run.v2.IListRevisionsRequest): Promise; + + /** + * Calls DeleteRevision. + * @param request DeleteRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteRevision(request: google.cloud.run.v2.IDeleteRevisionRequest, callback: google.cloud.run.v2.Revisions.DeleteRevisionCallback): void; + + /** + * Calls DeleteRevision. + * @param request DeleteRevisionRequest message or plain object + * @returns Promise + */ + public deleteRevision(request: google.cloud.run.v2.IDeleteRevisionRequest): Promise; + } + + namespace Revisions { + + /** + * Callback as used by {@link google.cloud.run.v2.Revisions|getRevision}. + * @param error Error, if any + * @param [response] Revision + */ + type GetRevisionCallback = (error: (Error|null), response?: google.cloud.run.v2.Revision) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Revisions|listRevisions}. + * @param error Error, if any + * @param [response] ListRevisionsResponse + */ + type ListRevisionsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListRevisionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Revisions|deleteRevision}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteRevisionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a GetRevisionRequest. */ + interface IGetRevisionRequest { + + /** GetRevisionRequest name */ + name?: (string|null); + } + + /** Represents a GetRevisionRequest. */ + class GetRevisionRequest implements IGetRevisionRequest { + + /** + * Constructs a new GetRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IGetRevisionRequest); + + /** GetRevisionRequest name. */ + public name: string; + + /** + * Creates a new GetRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRevisionRequest instance + */ + public static create(properties?: google.cloud.run.v2.IGetRevisionRequest): google.cloud.run.v2.GetRevisionRequest; + + /** + * Encodes the specified GetRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. + * @param message GetRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IGetRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. + * @param message GetRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IGetRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetRevisionRequest; + + /** + * Decodes a GetRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetRevisionRequest; + + /** + * Verifies a GetRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetRevisionRequest; + + /** + * Creates a plain object from a GetRevisionRequest message. Also converts values to other types if specified. + * @param message GetRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.GetRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRevisionsRequest. */ + interface IListRevisionsRequest { + + /** ListRevisionsRequest parent */ + parent?: (string|null); + + /** ListRevisionsRequest pageSize */ + pageSize?: (number|null); + + /** ListRevisionsRequest pageToken */ + pageToken?: (string|null); + + /** ListRevisionsRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListRevisionsRequest. */ + class ListRevisionsRequest implements IListRevisionsRequest { + + /** + * Constructs a new ListRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListRevisionsRequest); + + /** ListRevisionsRequest parent. */ + public parent: string; + + /** ListRevisionsRequest pageSize. */ + public pageSize: number; + + /** ListRevisionsRequest pageToken. */ + public pageToken: string; + + /** ListRevisionsRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRevisionsRequest instance + */ + public static create(properties?: google.cloud.run.v2.IListRevisionsRequest): google.cloud.run.v2.ListRevisionsRequest; + + /** + * Encodes the specified ListRevisionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. + * @param message ListRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. + * @param message ListRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListRevisionsRequest; + + /** + * Decodes a ListRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListRevisionsRequest; + + /** + * Verifies a ListRevisionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListRevisionsRequest; + + /** + * Creates a plain object from a ListRevisionsRequest message. Also converts values to other types if specified. + * @param message ListRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRevisionsResponse. */ + interface IListRevisionsResponse { + + /** ListRevisionsResponse revisions */ + revisions?: (google.cloud.run.v2.IRevision[]|null); + + /** ListRevisionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRevisionsResponse. */ + class ListRevisionsResponse implements IListRevisionsResponse { + + /** + * Constructs a new ListRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListRevisionsResponse); + + /** ListRevisionsResponse revisions. */ + public revisions: google.cloud.run.v2.IRevision[]; + + /** ListRevisionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRevisionsResponse instance + */ + public static create(properties?: google.cloud.run.v2.IListRevisionsResponse): google.cloud.run.v2.ListRevisionsResponse; + + /** + * Encodes the specified ListRevisionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. + * @param message ListRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. + * @param message ListRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListRevisionsResponse; + + /** + * Decodes a ListRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListRevisionsResponse; + + /** + * Verifies a ListRevisionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListRevisionsResponse; + + /** + * Creates a plain object from a ListRevisionsResponse message. Also converts values to other types if specified. + * @param message ListRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRevisionRequest. */ + interface IDeleteRevisionRequest { + + /** DeleteRevisionRequest name */ + name?: (string|null); + + /** DeleteRevisionRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteRevisionRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteRevisionRequest. */ + class DeleteRevisionRequest implements IDeleteRevisionRequest { + + /** + * Constructs a new DeleteRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IDeleteRevisionRequest); + + /** DeleteRevisionRequest name. */ + public name: string; + + /** DeleteRevisionRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteRevisionRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRevisionRequest instance + */ + public static create(properties?: google.cloud.run.v2.IDeleteRevisionRequest): google.cloud.run.v2.DeleteRevisionRequest; + + /** + * Encodes the specified DeleteRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. + * @param message DeleteRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IDeleteRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. + * @param message DeleteRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IDeleteRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteRevisionRequest; + + /** + * Decodes a DeleteRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteRevisionRequest; + + /** + * Verifies a DeleteRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteRevisionRequest; + + /** + * Creates a plain object from a DeleteRevisionRequest message. Also converts values to other types if specified. + * @param message DeleteRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.DeleteRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Revision. */ + interface IRevision { + + /** Revision name */ + name?: (string|null); + + /** Revision uid */ + uid?: (string|null); + + /** Revision generation */ + generation?: (number|Long|string|null); + + /** Revision labels */ + labels?: ({ [k: string]: string }|null); + + /** Revision annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Revision createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Revision updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Revision deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Revision expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Revision launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** Revision service */ + service?: (string|null); + + /** Revision scaling */ + scaling?: (google.cloud.run.v2.IRevisionScaling|null); + + /** Revision vpcAccess */ + vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** Revision maxInstanceRequestConcurrency */ + maxInstanceRequestConcurrency?: (number|null); + + /** Revision timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** Revision serviceAccount */ + serviceAccount?: (string|null); + + /** Revision containers */ + containers?: (google.cloud.run.v2.IContainer[]|null); + + /** Revision volumes */ + volumes?: (google.cloud.run.v2.IVolume[]|null); + + /** Revision executionEnvironment */ + executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); + + /** Revision encryptionKey */ + encryptionKey?: (string|null); + + /** Revision serviceMesh */ + serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); + + /** Revision encryptionKeyRevocationAction */ + encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); + + /** Revision encryptionKeyShutdownDuration */ + encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** Revision reconciling */ + reconciling?: (boolean|null); + + /** Revision conditions */ + conditions?: (google.cloud.run.v2.ICondition[]|null); + + /** Revision observedGeneration */ + observedGeneration?: (number|Long|string|null); + + /** Revision logUri */ + logUri?: (string|null); + + /** Revision satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Revision sessionAffinity */ + sessionAffinity?: (boolean|null); + + /** Revision scalingStatus */ + scalingStatus?: (google.cloud.run.v2.IRevisionScalingStatus|null); + + /** Revision nodeSelector */ + nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** Revision gpuZonalRedundancyDisabled */ + gpuZonalRedundancyDisabled?: (boolean|null); + + /** Revision creator */ + creator?: (string|null); + + /** Revision etag */ + etag?: (string|null); + } + + /** Represents a Revision. */ + class Revision implements IRevision { + + /** + * Constructs a new Revision. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IRevision); + + /** Revision name. */ + public name: string; + + /** Revision uid. */ + public uid: string; + + /** Revision generation. */ + public generation: (number|Long|string); + + /** Revision labels. */ + public labels: { [k: string]: string }; + + /** Revision annotations. */ + public annotations: { [k: string]: string }; + + /** Revision createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Revision updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Revision deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Revision expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Revision launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** Revision service. */ + public service: string; + + /** Revision scaling. */ + public scaling?: (google.cloud.run.v2.IRevisionScaling|null); + + /** Revision vpcAccess. */ + public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** Revision maxInstanceRequestConcurrency. */ + public maxInstanceRequestConcurrency: number; + + /** Revision timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** Revision serviceAccount. */ + public serviceAccount: string; + + /** Revision containers. */ + public containers: google.cloud.run.v2.IContainer[]; + + /** Revision volumes. */ + public volumes: google.cloud.run.v2.IVolume[]; + + /** Revision executionEnvironment. */ + public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); + + /** Revision encryptionKey. */ + public encryptionKey: string; + + /** Revision serviceMesh. */ + public serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); + + /** Revision encryptionKeyRevocationAction. */ + public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); + + /** Revision encryptionKeyShutdownDuration. */ + public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** Revision reconciling. */ + public reconciling: boolean; + + /** Revision conditions. */ + public conditions: google.cloud.run.v2.ICondition[]; + + /** Revision observedGeneration. */ + public observedGeneration: (number|Long|string); + + /** Revision logUri. */ + public logUri: string; + + /** Revision satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Revision sessionAffinity. */ + public sessionAffinity: boolean; + + /** Revision scalingStatus. */ + public scalingStatus?: (google.cloud.run.v2.IRevisionScalingStatus|null); + + /** Revision nodeSelector. */ + public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** Revision gpuZonalRedundancyDisabled. */ + public gpuZonalRedundancyDisabled?: (boolean|null); + + /** Revision creator. */ + public creator: string; + + /** Revision etag. */ + public etag: string; + + /** + * Creates a new Revision instance using the specified properties. + * @param [properties] Properties to set + * @returns Revision instance + */ + public static create(properties?: google.cloud.run.v2.IRevision): google.cloud.run.v2.Revision; + + /** + * Encodes the specified Revision message. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. + * @param message Revision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. + * @param message Revision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Revision message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Revision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Revision; + + /** + * Decodes a Revision message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Revision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Revision; + + /** + * Verifies a Revision message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Revision message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Revision + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Revision; + + /** + * Creates a plain object from a Revision message. Also converts values to other types if specified. + * @param message Revision + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.Revision, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Revision to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Revision + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RevisionScalingStatus. */ + interface IRevisionScalingStatus { + + /** RevisionScalingStatus desiredMinInstanceCount */ + desiredMinInstanceCount?: (number|null); + } + + /** Represents a RevisionScalingStatus. */ + class RevisionScalingStatus implements IRevisionScalingStatus { + + /** + * Constructs a new RevisionScalingStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IRevisionScalingStatus); + + /** RevisionScalingStatus desiredMinInstanceCount. */ + public desiredMinInstanceCount: number; + + /** + * Creates a new RevisionScalingStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns RevisionScalingStatus instance + */ + public static create(properties?: google.cloud.run.v2.IRevisionScalingStatus): google.cloud.run.v2.RevisionScalingStatus; + + /** + * Encodes the specified RevisionScalingStatus message. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. + * @param message RevisionScalingStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IRevisionScalingStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevisionScalingStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. + * @param message RevisionScalingStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IRevisionScalingStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevisionScalingStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevisionScalingStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RevisionScalingStatus; + + /** + * Decodes a RevisionScalingStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevisionScalingStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RevisionScalingStatus; + + /** + * Verifies a RevisionScalingStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RevisionScalingStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevisionScalingStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RevisionScalingStatus; + + /** + * Creates a plain object from a RevisionScalingStatus message. Also converts values to other types if specified. + * @param message RevisionScalingStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.RevisionScalingStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevisionScalingStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevisionScalingStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RevisionTemplate. */ + interface IRevisionTemplate { + + /** RevisionTemplate revision */ + revision?: (string|null); + + /** RevisionTemplate labels */ + labels?: ({ [k: string]: string }|null); + + /** RevisionTemplate annotations */ + annotations?: ({ [k: string]: string }|null); + + /** RevisionTemplate scaling */ + scaling?: (google.cloud.run.v2.IRevisionScaling|null); + + /** RevisionTemplate vpcAccess */ + vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** RevisionTemplate timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** RevisionTemplate serviceAccount */ + serviceAccount?: (string|null); + + /** RevisionTemplate containers */ + containers?: (google.cloud.run.v2.IContainer[]|null); + + /** RevisionTemplate volumes */ + volumes?: (google.cloud.run.v2.IVolume[]|null); + + /** RevisionTemplate executionEnvironment */ + executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); + + /** RevisionTemplate encryptionKey */ + encryptionKey?: (string|null); + + /** RevisionTemplate maxInstanceRequestConcurrency */ + maxInstanceRequestConcurrency?: (number|null); + + /** RevisionTemplate serviceMesh */ + serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); + + /** RevisionTemplate encryptionKeyRevocationAction */ + encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); + + /** RevisionTemplate encryptionKeyShutdownDuration */ + encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** RevisionTemplate sessionAffinity */ + sessionAffinity?: (boolean|null); + + /** RevisionTemplate healthCheckDisabled */ + healthCheckDisabled?: (boolean|null); + + /** RevisionTemplate nodeSelector */ + nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** RevisionTemplate gpuZonalRedundancyDisabled */ + gpuZonalRedundancyDisabled?: (boolean|null); + } + + /** Represents a RevisionTemplate. */ + class RevisionTemplate implements IRevisionTemplate { + + /** + * Constructs a new RevisionTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IRevisionTemplate); + + /** RevisionTemplate revision. */ + public revision: string; + + /** RevisionTemplate labels. */ + public labels: { [k: string]: string }; + + /** RevisionTemplate annotations. */ + public annotations: { [k: string]: string }; + + /** RevisionTemplate scaling. */ + public scaling?: (google.cloud.run.v2.IRevisionScaling|null); + + /** RevisionTemplate vpcAccess. */ + public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** RevisionTemplate timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** RevisionTemplate serviceAccount. */ + public serviceAccount: string; + + /** RevisionTemplate containers. */ + public containers: google.cloud.run.v2.IContainer[]; + + /** RevisionTemplate volumes. */ + public volumes: google.cloud.run.v2.IVolume[]; + + /** RevisionTemplate executionEnvironment. */ + public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); + + /** RevisionTemplate encryptionKey. */ + public encryptionKey: string; + + /** RevisionTemplate maxInstanceRequestConcurrency. */ + public maxInstanceRequestConcurrency: number; + + /** RevisionTemplate serviceMesh. */ + public serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); + + /** RevisionTemplate encryptionKeyRevocationAction. */ + public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); + + /** RevisionTemplate encryptionKeyShutdownDuration. */ + public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** RevisionTemplate sessionAffinity. */ + public sessionAffinity: boolean; + + /** RevisionTemplate healthCheckDisabled. */ + public healthCheckDisabled: boolean; + + /** RevisionTemplate nodeSelector. */ + public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** RevisionTemplate gpuZonalRedundancyDisabled. */ + public gpuZonalRedundancyDisabled?: (boolean|null); + + /** + * Creates a new RevisionTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns RevisionTemplate instance + */ + public static create(properties?: google.cloud.run.v2.IRevisionTemplate): google.cloud.run.v2.RevisionTemplate; + + /** + * Encodes the specified RevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. + * @param message RevisionTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. + * @param message RevisionTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevisionTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevisionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RevisionTemplate; + + /** + * Decodes a RevisionTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevisionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RevisionTemplate; + + /** + * Verifies a RevisionTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RevisionTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevisionTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RevisionTemplate; + + /** + * Creates a plain object from a RevisionTemplate message. Also converts values to other types if specified. + * @param message RevisionTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.RevisionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevisionTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevisionTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Services */ + class Services extends $protobuf.rpc.Service { + + /** + * Constructs a new Services 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 Services 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): Services; + + /** + * Calls CreateService. + * @param request CreateServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createService(request: google.cloud.run.v2.ICreateServiceRequest, callback: google.cloud.run.v2.Services.CreateServiceCallback): void; + + /** + * Calls CreateService. + * @param request CreateServiceRequest message or plain object + * @returns Promise + */ + public createService(request: google.cloud.run.v2.ICreateServiceRequest): Promise; + + /** + * Calls GetService. + * @param request GetServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Service + */ + public getService(request: google.cloud.run.v2.IGetServiceRequest, callback: google.cloud.run.v2.Services.GetServiceCallback): void; + + /** + * Calls GetService. + * @param request GetServiceRequest message or plain object + * @returns Promise + */ + public getService(request: google.cloud.run.v2.IGetServiceRequest): Promise; + + /** + * Calls ListServices. + * @param request ListServicesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServicesResponse + */ + public listServices(request: google.cloud.run.v2.IListServicesRequest, callback: google.cloud.run.v2.Services.ListServicesCallback): void; + + /** + * Calls ListServices. + * @param request ListServicesRequest message or plain object + * @returns Promise + */ + public listServices(request: google.cloud.run.v2.IListServicesRequest): Promise; + + /** + * Calls UpdateService. + * @param request UpdateServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateService(request: google.cloud.run.v2.IUpdateServiceRequest, callback: google.cloud.run.v2.Services.UpdateServiceCallback): void; + + /** + * Calls UpdateService. + * @param request UpdateServiceRequest message or plain object + * @returns Promise + */ + public updateService(request: google.cloud.run.v2.IUpdateServiceRequest): Promise; + + /** + * Calls DeleteService. + * @param request DeleteServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteService(request: google.cloud.run.v2.IDeleteServiceRequest, callback: google.cloud.run.v2.Services.DeleteServiceCallback): void; + + /** + * Calls DeleteService. + * @param request DeleteServiceRequest message or plain object + * @returns Promise + */ + public deleteService(request: google.cloud.run.v2.IDeleteServiceRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.run.v2.Services.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.run.v2.Services.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.run.v2.Services.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace Services { + + /** + * Callback as used by {@link google.cloud.run.v2.Services|createService}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Services|getService}. + * @param error Error, if any + * @param [response] Service + */ + type GetServiceCallback = (error: (Error|null), response?: google.cloud.run.v2.Service) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Services|listServices}. + * @param error Error, if any + * @param [response] ListServicesResponse + */ + type ListServicesCallback = (error: (Error|null), response?: google.cloud.run.v2.ListServicesResponse) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Services|updateService}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Services|deleteService}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Services|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Services|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Services|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a CreateServiceRequest. */ + interface ICreateServiceRequest { + + /** CreateServiceRequest parent */ + parent?: (string|null); + + /** CreateServiceRequest service */ + service?: (google.cloud.run.v2.IService|null); + + /** CreateServiceRequest serviceId */ + serviceId?: (string|null); + + /** CreateServiceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateServiceRequest. */ + class CreateServiceRequest implements ICreateServiceRequest { + + /** + * Constructs a new CreateServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ICreateServiceRequest); + + /** CreateServiceRequest parent. */ + public parent: string; + + /** CreateServiceRequest service. */ + public service?: (google.cloud.run.v2.IService|null); + + /** CreateServiceRequest serviceId. */ + public serviceId: string; + + /** CreateServiceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateServiceRequest instance + */ + public static create(properties?: google.cloud.run.v2.ICreateServiceRequest): google.cloud.run.v2.CreateServiceRequest; + + /** + * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. + * @param message CreateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. + * @param message CreateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateServiceRequest; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateServiceRequest; + + /** + * Verifies a CreateServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateServiceRequest; + + /** + * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. + * @param message CreateServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.CreateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateServiceRequest. */ + interface IUpdateServiceRequest { + + /** UpdateServiceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateServiceRequest service */ + service?: (google.cloud.run.v2.IService|null); + + /** UpdateServiceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateServiceRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateServiceRequest. */ + class UpdateServiceRequest implements IUpdateServiceRequest { + + /** + * Constructs a new UpdateServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IUpdateServiceRequest); + + /** UpdateServiceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateServiceRequest service. */ + public service?: (google.cloud.run.v2.IService|null); + + /** UpdateServiceRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateServiceRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateServiceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IUpdateServiceRequest): google.cloud.run.v2.UpdateServiceRequest; + + /** + * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. + * @param message UpdateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. + * @param message UpdateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.UpdateServiceRequest; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.UpdateServiceRequest; + + /** + * Verifies an UpdateServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.UpdateServiceRequest; + + /** + * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. + * @param message UpdateServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.UpdateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListServicesRequest. */ + interface IListServicesRequest { + + /** ListServicesRequest parent */ + parent?: (string|null); + + /** ListServicesRequest pageSize */ + pageSize?: (number|null); + + /** ListServicesRequest pageToken */ + pageToken?: (string|null); + + /** ListServicesRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListServicesRequest. */ + class ListServicesRequest implements IListServicesRequest { + + /** + * Constructs a new ListServicesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListServicesRequest); + + /** ListServicesRequest parent. */ + public parent: string; + + /** ListServicesRequest pageSize. */ + public pageSize: number; + + /** ListServicesRequest pageToken. */ + public pageToken: string; + + /** ListServicesRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListServicesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServicesRequest instance + */ + public static create(properties?: google.cloud.run.v2.IListServicesRequest): google.cloud.run.v2.ListServicesRequest; + + /** + * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. + * @param message ListServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. + * @param message ListServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListServicesRequest; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListServicesRequest; + + /** + * Verifies a ListServicesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServicesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListServicesRequest; + + /** + * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. + * @param message ListServicesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServicesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServicesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListServicesResponse. */ + interface IListServicesResponse { + + /** ListServicesResponse services */ + services?: (google.cloud.run.v2.IService[]|null); + + /** ListServicesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListServicesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListServicesResponse. */ + class ListServicesResponse implements IListServicesResponse { + + /** + * Constructs a new ListServicesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListServicesResponse); + + /** ListServicesResponse services. */ + public services: google.cloud.run.v2.IService[]; + + /** ListServicesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListServicesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListServicesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServicesResponse instance + */ + public static create(properties?: google.cloud.run.v2.IListServicesResponse): google.cloud.run.v2.ListServicesResponse; + + /** + * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. + * @param message ListServicesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. + * @param message ListServicesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListServicesResponse; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListServicesResponse; + + /** + * Verifies a ListServicesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServicesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListServicesResponse; + + /** + * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. + * @param message ListServicesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListServicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServicesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServicesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetServiceRequest. */ + interface IGetServiceRequest { + + /** GetServiceRequest name */ + name?: (string|null); + } + + /** Represents a GetServiceRequest. */ + class GetServiceRequest implements IGetServiceRequest { + + /** + * Constructs a new GetServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IGetServiceRequest); + + /** GetServiceRequest name. */ + public name: string; + + /** + * Creates a new GetServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServiceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IGetServiceRequest): google.cloud.run.v2.GetServiceRequest; + + /** + * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. + * @param message GetServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. + * @param message GetServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetServiceRequest; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetServiceRequest; + + /** + * Verifies a GetServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetServiceRequest; + + /** + * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. + * @param message GetServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.GetServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteServiceRequest. */ + interface IDeleteServiceRequest { + + /** DeleteServiceRequest name */ + name?: (string|null); + + /** DeleteServiceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteServiceRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteServiceRequest. */ + class DeleteServiceRequest implements IDeleteServiceRequest { + + /** + * Constructs a new DeleteServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IDeleteServiceRequest); + + /** DeleteServiceRequest name. */ + public name: string; + + /** DeleteServiceRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteServiceRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteServiceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IDeleteServiceRequest): google.cloud.run.v2.DeleteServiceRequest; + + /** + * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. + * @param message DeleteServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. + * @param message DeleteServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteServiceRequest; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteServiceRequest; + + /** + * Verifies a DeleteServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteServiceRequest; + + /** + * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. + * @param message DeleteServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.DeleteServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Service. */ + interface IService { + + /** Service name */ + name?: (string|null); + + /** Service description */ + description?: (string|null); + + /** Service uid */ + uid?: (string|null); + + /** Service generation */ + generation?: (number|Long|string|null); + + /** Service labels */ + labels?: ({ [k: string]: string }|null); + + /** Service annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Service createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Service updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Service deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Service expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Service creator */ + creator?: (string|null); + + /** Service lastModifier */ + lastModifier?: (string|null); + + /** Service client */ + client?: (string|null); + + /** Service clientVersion */ + clientVersion?: (string|null); + + /** Service ingress */ + ingress?: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic|null); + + /** Service launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** Service binaryAuthorization */ + binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** Service template */ + template?: (google.cloud.run.v2.IRevisionTemplate|null); + + /** Service traffic */ + traffic?: (google.cloud.run.v2.ITrafficTarget[]|null); + + /** Service scaling */ + scaling?: (google.cloud.run.v2.IServiceScaling|null); + + /** Service invokerIamDisabled */ + invokerIamDisabled?: (boolean|null); + + /** Service defaultUriDisabled */ + defaultUriDisabled?: (boolean|null); + + /** Service urls */ + urls?: (string[]|null); + + /** Service iapEnabled */ + iapEnabled?: (boolean|null); + + /** Service multiRegionSettings */ + multiRegionSettings?: (google.cloud.run.v2.Service.IMultiRegionSettings|null); + + /** Service customAudiences */ + customAudiences?: (string[]|null); + + /** Service observedGeneration */ + observedGeneration?: (number|Long|string|null); + + /** Service terminalCondition */ + terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** Service conditions */ + conditions?: (google.cloud.run.v2.ICondition[]|null); + + /** Service latestReadyRevision */ + latestReadyRevision?: (string|null); + + /** Service latestCreatedRevision */ + latestCreatedRevision?: (string|null); + + /** Service trafficStatuses */ + trafficStatuses?: (google.cloud.run.v2.ITrafficTargetStatus[]|null); + + /** Service uri */ + uri?: (string|null); + + /** Service satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Service threatDetectionEnabled */ + threatDetectionEnabled?: (boolean|null); + + /** Service buildConfig */ + buildConfig?: (google.cloud.run.v2.IBuildConfig|null); + + /** Service reconciling */ + reconciling?: (boolean|null); + + /** Service etag */ + etag?: (string|null); + } + + /** Represents a Service. */ + class Service implements IService { + + /** + * Constructs a new Service. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IService); + + /** Service name. */ + public name: string; + + /** Service description. */ + public description: string; + + /** Service uid. */ + public uid: string; + + /** Service generation. */ + public generation: (number|Long|string); + + /** Service labels. */ + public labels: { [k: string]: string }; + + /** Service annotations. */ + public annotations: { [k: string]: string }; + + /** Service createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Service updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Service deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Service expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Service creator. */ + public creator: string; + + /** Service lastModifier. */ + public lastModifier: string; + + /** Service client. */ + public client: string; + + /** Service clientVersion. */ + public clientVersion: string; + + /** Service ingress. */ + public ingress: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic); + + /** Service launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** Service binaryAuthorization. */ + public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** Service template. */ + public template?: (google.cloud.run.v2.IRevisionTemplate|null); + + /** Service traffic. */ + public traffic: google.cloud.run.v2.ITrafficTarget[]; + + /** Service scaling. */ + public scaling?: (google.cloud.run.v2.IServiceScaling|null); + + /** Service invokerIamDisabled. */ + public invokerIamDisabled: boolean; + + /** Service defaultUriDisabled. */ + public defaultUriDisabled: boolean; + + /** Service urls. */ + public urls: string[]; + + /** Service iapEnabled. */ + public iapEnabled: boolean; + + /** Service multiRegionSettings. */ + public multiRegionSettings?: (google.cloud.run.v2.Service.IMultiRegionSettings|null); + + /** Service customAudiences. */ + public customAudiences: string[]; + + /** Service observedGeneration. */ + public observedGeneration: (number|Long|string); + + /** Service terminalCondition. */ + public terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** Service conditions. */ + public conditions: google.cloud.run.v2.ICondition[]; + + /** Service latestReadyRevision. */ + public latestReadyRevision: string; + + /** Service latestCreatedRevision. */ + public latestCreatedRevision: string; + + /** Service trafficStatuses. */ + public trafficStatuses: google.cloud.run.v2.ITrafficTargetStatus[]; + + /** Service uri. */ + public uri: string; + + /** Service satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Service threatDetectionEnabled. */ + public threatDetectionEnabled: boolean; + + /** Service buildConfig. */ + public buildConfig?: (google.cloud.run.v2.IBuildConfig|null); + + /** Service reconciling. */ + public reconciling: boolean; + + /** Service etag. */ + public etag: string; + + /** + * Creates a new Service instance using the specified properties. + * @param [properties] Properties to set + * @returns Service instance + */ + public static create(properties?: google.cloud.run.v2.IService): google.cloud.run.v2.Service; + + /** + * Encodes the specified Service message. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. + * @param message Service message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. + * @param message Service message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Service message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Service; + + /** + * Decodes a Service message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Service; + + /** + * Verifies a Service message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Service message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Service + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Service; + + /** + * Creates a plain object from a Service message. Also converts values to other types if specified. + * @param message Service + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.Service, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Service to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Service + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Service { + + /** Properties of a MultiRegionSettings. */ + interface IMultiRegionSettings { + + /** MultiRegionSettings regions */ + regions?: (string[]|null); + + /** MultiRegionSettings multiRegionId */ + multiRegionId?: (string|null); + } + + /** Represents a MultiRegionSettings. */ + class MultiRegionSettings implements IMultiRegionSettings { + + /** + * Constructs a new MultiRegionSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.Service.IMultiRegionSettings); + + /** MultiRegionSettings regions. */ + public regions: string[]; + + /** MultiRegionSettings multiRegionId. */ + public multiRegionId: string; + + /** + * Creates a new MultiRegionSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiRegionSettings instance + */ + public static create(properties?: google.cloud.run.v2.Service.IMultiRegionSettings): google.cloud.run.v2.Service.MultiRegionSettings; + + /** + * Encodes the specified MultiRegionSettings message. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. + * @param message MultiRegionSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.Service.IMultiRegionSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiRegionSettings message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. + * @param message MultiRegionSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.Service.IMultiRegionSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiRegionSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiRegionSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Service.MultiRegionSettings; + + /** + * Decodes a MultiRegionSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiRegionSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Service.MultiRegionSettings; + + /** + * Verifies a MultiRegionSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiRegionSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiRegionSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Service.MultiRegionSettings; + + /** + * Creates a plain object from a MultiRegionSettings message. Also converts values to other types if specified. + * @param message MultiRegionSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.Service.MultiRegionSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiRegionSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiRegionSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TrafficTarget. */ + interface ITrafficTarget { + + /** TrafficTarget type */ + type?: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType|null); + + /** TrafficTarget revision */ + revision?: (string|null); + + /** TrafficTarget percent */ + percent?: (number|null); + + /** TrafficTarget tag */ + tag?: (string|null); + } + + /** Represents a TrafficTarget. */ + class TrafficTarget implements ITrafficTarget { + + /** + * Constructs a new TrafficTarget. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ITrafficTarget); + + /** TrafficTarget type. */ + public type: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType); + + /** TrafficTarget revision. */ + public revision: string; + + /** TrafficTarget percent. */ + public percent: number; + + /** TrafficTarget tag. */ + public tag: string; + + /** + * Creates a new TrafficTarget instance using the specified properties. + * @param [properties] Properties to set + * @returns TrafficTarget instance + */ + public static create(properties?: google.cloud.run.v2.ITrafficTarget): google.cloud.run.v2.TrafficTarget; + + /** + * Encodes the specified TrafficTarget message. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. + * @param message TrafficTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ITrafficTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrafficTarget message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. + * @param message TrafficTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ITrafficTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrafficTarget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrafficTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TrafficTarget; + + /** + * Decodes a TrafficTarget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrafficTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TrafficTarget; + + /** + * Verifies a TrafficTarget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrafficTarget message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrafficTarget + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TrafficTarget; + + /** + * Creates a plain object from a TrafficTarget message. Also converts values to other types if specified. + * @param message TrafficTarget + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.TrafficTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrafficTarget to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrafficTarget + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrafficTargetStatus. */ + interface ITrafficTargetStatus { + + /** TrafficTargetStatus type */ + type?: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType|null); + + /** TrafficTargetStatus revision */ + revision?: (string|null); + + /** TrafficTargetStatus percent */ + percent?: (number|null); + + /** TrafficTargetStatus tag */ + tag?: (string|null); + + /** TrafficTargetStatus uri */ + uri?: (string|null); + } + + /** Represents a TrafficTargetStatus. */ + class TrafficTargetStatus implements ITrafficTargetStatus { + + /** + * Constructs a new TrafficTargetStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ITrafficTargetStatus); + + /** TrafficTargetStatus type. */ + public type: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType); + + /** TrafficTargetStatus revision. */ + public revision: string; + + /** TrafficTargetStatus percent. */ + public percent: number; + + /** TrafficTargetStatus tag. */ + public tag: string; + + /** TrafficTargetStatus uri. */ + public uri: string; + + /** + * Creates a new TrafficTargetStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns TrafficTargetStatus instance + */ + public static create(properties?: google.cloud.run.v2.ITrafficTargetStatus): google.cloud.run.v2.TrafficTargetStatus; + + /** + * Encodes the specified TrafficTargetStatus message. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. + * @param message TrafficTargetStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ITrafficTargetStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrafficTargetStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. + * @param message TrafficTargetStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ITrafficTargetStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrafficTargetStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrafficTargetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TrafficTargetStatus; + + /** + * Decodes a TrafficTargetStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrafficTargetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TrafficTargetStatus; + + /** + * Verifies a TrafficTargetStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrafficTargetStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrafficTargetStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TrafficTargetStatus; + + /** + * Creates a plain object from a TrafficTargetStatus message. Also converts values to other types if specified. + * @param message TrafficTargetStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.TrafficTargetStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrafficTargetStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrafficTargetStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TrafficTargetAllocationType enum. */ + enum TrafficTargetAllocationType { + TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0, + TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1, + TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2 + } + + /** Represents a Tasks */ + class Tasks extends $protobuf.rpc.Service { + + /** + * Constructs a new Tasks 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 Tasks 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): Tasks; + + /** + * 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.run.v2.IGetTaskRequest, callback: google.cloud.run.v2.Tasks.GetTaskCallback): void; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @returns Promise + */ + public getTask(request: google.cloud.run.v2.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.run.v2.IListTasksRequest, callback: google.cloud.run.v2.Tasks.ListTasksCallback): void; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @returns Promise + */ + public listTasks(request: google.cloud.run.v2.IListTasksRequest): Promise; + } + + namespace Tasks { + + /** + * Callback as used by {@link google.cloud.run.v2.Tasks|getTask}. + * @param error Error, if any + * @param [response] Task + */ + type GetTaskCallback = (error: (Error|null), response?: google.cloud.run.v2.Task) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Tasks|listTasks}. + * @param error Error, if any + * @param [response] ListTasksResponse + */ + type ListTasksCallback = (error: (Error|null), response?: google.cloud.run.v2.ListTasksResponse) => void; + } + + /** 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.run.v2.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.run.v2.IGetTaskRequest): google.cloud.run.v2.GetTaskRequest; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 ListTasksRequest. */ + interface IListTasksRequest { + + /** ListTasksRequest parent */ + parent?: (string|null); + + /** ListTasksRequest pageSize */ + pageSize?: (number|null); + + /** ListTasksRequest pageToken */ + pageToken?: (string|null); + + /** ListTasksRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListTasksRequest. */ + class ListTasksRequest implements IListTasksRequest { + + /** + * Constructs a new ListTasksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListTasksRequest); + + /** ListTasksRequest parent. */ + public parent: string; + + /** ListTasksRequest pageSize. */ + public pageSize: number; + + /** ListTasksRequest pageToken. */ + public pageToken: string; + + /** ListTasksRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksRequest instance + */ + public static create(properties?: google.cloud.run.v2.IListTasksRequest): google.cloud.run.v2.ListTasksRequest; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.ITask[]|null); + + /** ListTasksResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTasksResponse. */ + class ListTasksResponse implements IListTasksResponse { + + /** + * Constructs a new ListTasksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListTasksResponse); + + /** ListTasksResponse tasks. */ + public tasks: google.cloud.run.v2.ITask[]; + + /** ListTasksResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksResponse instance + */ + public static create(properties?: google.cloud.run.v2.IListTasksResponse): google.cloud.run.v2.ListTasksResponse; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 Task. */ + interface ITask { + + /** Task name */ + name?: (string|null); + + /** Task uid */ + uid?: (string|null); + + /** Task generation */ + generation?: (number|Long|string|null); + + /** Task labels */ + labels?: ({ [k: string]: string }|null); + + /** Task annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Task createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Task scheduledTime */ + scheduledTime?: (google.protobuf.ITimestamp|null); + + /** Task startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Task completionTime */ + completionTime?: (google.protobuf.ITimestamp|null); + + /** Task updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Task deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Task expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Task job */ + job?: (string|null); + + /** Task execution */ + execution?: (string|null); + + /** Task containers */ + containers?: (google.cloud.run.v2.IContainer[]|null); + + /** Task volumes */ + volumes?: (google.cloud.run.v2.IVolume[]|null); + + /** Task maxRetries */ + maxRetries?: (number|null); + + /** Task timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** Task serviceAccount */ + serviceAccount?: (string|null); + + /** Task executionEnvironment */ + executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); + + /** Task reconciling */ + reconciling?: (boolean|null); + + /** Task conditions */ + conditions?: (google.cloud.run.v2.ICondition[]|null); + + /** Task observedGeneration */ + observedGeneration?: (number|Long|string|null); + + /** Task index */ + index?: (number|null); + + /** Task retried */ + retried?: (number|null); + + /** Task lastAttemptResult */ + lastAttemptResult?: (google.cloud.run.v2.ITaskAttemptResult|null); + + /** Task encryptionKey */ + encryptionKey?: (string|null); + + /** Task vpcAccess */ + vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** Task logUri */ + logUri?: (string|null); + + /** Task satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Task nodeSelector */ + nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** Task gpuZonalRedundancyDisabled */ + gpuZonalRedundancyDisabled?: (boolean|null); + + /** Task etag */ + etag?: (string|null); + } + + /** Represents a Task. */ + class Task implements ITask { + + /** + * Constructs a new Task. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ITask); + + /** Task name. */ + public name: string; + + /** Task uid. */ + public uid: string; + + /** Task generation. */ + public generation: (number|Long|string); + + /** Task labels. */ + public labels: { [k: string]: string }; + + /** Task annotations. */ + public annotations: { [k: string]: string }; + + /** Task createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Task scheduledTime. */ + public scheduledTime?: (google.protobuf.ITimestamp|null); + + /** Task startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Task completionTime. */ + public completionTime?: (google.protobuf.ITimestamp|null); + + /** Task updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Task deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Task expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Task job. */ + public job: string; + + /** Task execution. */ + public execution: string; + + /** Task containers. */ + public containers: google.cloud.run.v2.IContainer[]; + + /** Task volumes. */ + public volumes: google.cloud.run.v2.IVolume[]; + + /** Task maxRetries. */ + public maxRetries: number; + + /** Task timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** Task serviceAccount. */ + public serviceAccount: string; + + /** Task executionEnvironment. */ + public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); + + /** Task reconciling. */ + public reconciling: boolean; + + /** Task conditions. */ + public conditions: google.cloud.run.v2.ICondition[]; + + /** Task observedGeneration. */ + public observedGeneration: (number|Long|string); + + /** Task index. */ + public index: number; + + /** Task retried. */ + public retried: number; + + /** Task lastAttemptResult. */ + public lastAttemptResult?: (google.cloud.run.v2.ITaskAttemptResult|null); + + /** Task encryptionKey. */ + public encryptionKey: string; + + /** Task vpcAccess. */ + public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** Task logUri. */ + public logUri: string; + + /** Task satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Task nodeSelector. */ + public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** Task gpuZonalRedundancyDisabled. */ + public gpuZonalRedundancyDisabled?: (boolean|null); + + /** Task etag. */ + public etag: string; + + /** + * Creates a new Task instance using the specified properties. + * @param [properties] Properties to set + * @returns Task instance + */ + public static create(properties?: google.cloud.run.v2.ITask): google.cloud.run.v2.Task; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 a TaskAttemptResult. */ + interface ITaskAttemptResult { + + /** TaskAttemptResult status */ + status?: (google.rpc.IStatus|null); + + /** TaskAttemptResult exitCode */ + exitCode?: (number|null); + + /** TaskAttemptResult termSignal */ + termSignal?: (number|null); + } + + /** Represents a TaskAttemptResult. */ + class TaskAttemptResult implements ITaskAttemptResult { + + /** + * Constructs a new TaskAttemptResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ITaskAttemptResult); + + /** TaskAttemptResult status. */ + public status?: (google.rpc.IStatus|null); + + /** TaskAttemptResult exitCode. */ + public exitCode: number; + + /** TaskAttemptResult termSignal. */ + public termSignal: number; + + /** + * Creates a new TaskAttemptResult instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskAttemptResult instance + */ + public static create(properties?: google.cloud.run.v2.ITaskAttemptResult): google.cloud.run.v2.TaskAttemptResult; + + /** + * Encodes the specified TaskAttemptResult message. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. + * @param message TaskAttemptResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ITaskAttemptResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskAttemptResult message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. + * @param message TaskAttemptResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ITaskAttemptResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskAttemptResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskAttemptResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TaskAttemptResult; + + /** + * Decodes a TaskAttemptResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskAttemptResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TaskAttemptResult; + + /** + * Verifies a TaskAttemptResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskAttemptResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskAttemptResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TaskAttemptResult; + + /** + * Creates a plain object from a TaskAttemptResult message. Also converts values to other types if specified. + * @param message TaskAttemptResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.TaskAttemptResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskAttemptResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskAttemptResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a WorkerPools */ + class WorkerPools extends $protobuf.rpc.Service { + + /** + * Constructs a new WorkerPools 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 WorkerPools 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): WorkerPools; + + /** + * Calls CreateWorkerPool. + * @param request CreateWorkerPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createWorkerPool(request: google.cloud.run.v2.ICreateWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.CreateWorkerPoolCallback): void; + + /** + * Calls CreateWorkerPool. + * @param request CreateWorkerPoolRequest message or plain object + * @returns Promise + */ + public createWorkerPool(request: google.cloud.run.v2.ICreateWorkerPoolRequest): Promise; + + /** + * Calls GetWorkerPool. + * @param request GetWorkerPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WorkerPool + */ + public getWorkerPool(request: google.cloud.run.v2.IGetWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.GetWorkerPoolCallback): void; + + /** + * Calls GetWorkerPool. + * @param request GetWorkerPoolRequest message or plain object + * @returns Promise + */ + public getWorkerPool(request: google.cloud.run.v2.IGetWorkerPoolRequest): Promise; + + /** + * Calls ListWorkerPools. + * @param request ListWorkerPoolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWorkerPoolsResponse + */ + public listWorkerPools(request: google.cloud.run.v2.IListWorkerPoolsRequest, callback: google.cloud.run.v2.WorkerPools.ListWorkerPoolsCallback): void; + + /** + * Calls ListWorkerPools. + * @param request ListWorkerPoolsRequest message or plain object + * @returns Promise + */ + public listWorkerPools(request: google.cloud.run.v2.IListWorkerPoolsRequest): Promise; + + /** + * Calls UpdateWorkerPool. + * @param request UpdateWorkerPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateWorkerPool(request: google.cloud.run.v2.IUpdateWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.UpdateWorkerPoolCallback): void; + + /** + * Calls UpdateWorkerPool. + * @param request UpdateWorkerPoolRequest message or plain object + * @returns Promise + */ + public updateWorkerPool(request: google.cloud.run.v2.IUpdateWorkerPoolRequest): Promise; + + /** + * Calls DeleteWorkerPool. + * @param request DeleteWorkerPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteWorkerPool(request: google.cloud.run.v2.IDeleteWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.DeleteWorkerPoolCallback): void; + + /** + * Calls DeleteWorkerPool. + * @param request DeleteWorkerPoolRequest message or plain object + * @returns Promise + */ + public deleteWorkerPool(request: google.cloud.run.v2.IDeleteWorkerPoolRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.run.v2.WorkerPools.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.run.v2.WorkerPools.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.run.v2.WorkerPools.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace WorkerPools { + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|createWorkerPool}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|getWorkerPool}. + * @param error Error, if any + * @param [response] WorkerPool + */ + type GetWorkerPoolCallback = (error: (Error|null), response?: google.cloud.run.v2.WorkerPool) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|listWorkerPools}. + * @param error Error, if any + * @param [response] ListWorkerPoolsResponse + */ + type ListWorkerPoolsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListWorkerPoolsResponse) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|updateWorkerPool}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|deleteWorkerPool}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a CreateWorkerPoolRequest. */ + interface ICreateWorkerPoolRequest { + + /** CreateWorkerPoolRequest parent */ + parent?: (string|null); + + /** CreateWorkerPoolRequest workerPool */ + workerPool?: (google.cloud.run.v2.IWorkerPool|null); + + /** CreateWorkerPoolRequest workerPoolId */ + workerPoolId?: (string|null); + + /** CreateWorkerPoolRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateWorkerPoolRequest. */ + class CreateWorkerPoolRequest implements ICreateWorkerPoolRequest { + + /** + * Constructs a new CreateWorkerPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ICreateWorkerPoolRequest); + + /** CreateWorkerPoolRequest parent. */ + public parent: string; + + /** CreateWorkerPoolRequest workerPool. */ + public workerPool?: (google.cloud.run.v2.IWorkerPool|null); + + /** CreateWorkerPoolRequest workerPoolId. */ + public workerPoolId: string; + + /** CreateWorkerPoolRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateWorkerPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkerPoolRequest instance + */ + public static create(properties?: google.cloud.run.v2.ICreateWorkerPoolRequest): google.cloud.run.v2.CreateWorkerPoolRequest; + + /** + * Encodes the specified CreateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. + * @param message CreateWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ICreateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. + * @param message CreateWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ICreateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateWorkerPoolRequest; + + /** + * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateWorkerPoolRequest; + + /** + * Verifies a CreateWorkerPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkerPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateWorkerPoolRequest; + + /** + * Creates a plain object from a CreateWorkerPoolRequest message. Also converts values to other types if specified. + * @param message CreateWorkerPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.CreateWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkerPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkerPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateWorkerPoolRequest. */ + interface IUpdateWorkerPoolRequest { + + /** UpdateWorkerPoolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkerPoolRequest workerPool */ + workerPool?: (google.cloud.run.v2.IWorkerPool|null); + + /** UpdateWorkerPoolRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateWorkerPoolRequest allowMissing */ + allowMissing?: (boolean|null); + + /** UpdateWorkerPoolRequest forceNewRevision */ + forceNewRevision?: (boolean|null); + } + + /** Represents an UpdateWorkerPoolRequest. */ + class UpdateWorkerPoolRequest implements IUpdateWorkerPoolRequest { + + /** + * Constructs a new UpdateWorkerPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IUpdateWorkerPoolRequest); + + /** UpdateWorkerPoolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkerPoolRequest workerPool. */ + public workerPool?: (google.cloud.run.v2.IWorkerPool|null); + + /** UpdateWorkerPoolRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateWorkerPoolRequest allowMissing. */ + public allowMissing: boolean; + + /** UpdateWorkerPoolRequest forceNewRevision. */ + public forceNewRevision: boolean; + + /** + * Creates a new UpdateWorkerPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkerPoolRequest instance + */ + public static create(properties?: google.cloud.run.v2.IUpdateWorkerPoolRequest): google.cloud.run.v2.UpdateWorkerPoolRequest; + + /** + * Encodes the specified UpdateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. + * @param message UpdateWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IUpdateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. + * @param message UpdateWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IUpdateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.UpdateWorkerPoolRequest; + + /** + * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.UpdateWorkerPoolRequest; + + /** + * Verifies an UpdateWorkerPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkerPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.UpdateWorkerPoolRequest; + + /** + * Creates a plain object from an UpdateWorkerPoolRequest message. Also converts values to other types if specified. + * @param message UpdateWorkerPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.UpdateWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkerPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWorkerPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkerPoolsRequest. */ + interface IListWorkerPoolsRequest { + + /** ListWorkerPoolsRequest parent */ + parent?: (string|null); + + /** ListWorkerPoolsRequest pageSize */ + pageSize?: (number|null); + + /** ListWorkerPoolsRequest pageToken */ + pageToken?: (string|null); + + /** ListWorkerPoolsRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListWorkerPoolsRequest. */ + class ListWorkerPoolsRequest implements IListWorkerPoolsRequest { + + /** + * Constructs a new ListWorkerPoolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListWorkerPoolsRequest); + + /** ListWorkerPoolsRequest parent. */ + public parent: string; + + /** ListWorkerPoolsRequest pageSize. */ + public pageSize: number; + + /** ListWorkerPoolsRequest pageToken. */ + public pageToken: string; + + /** ListWorkerPoolsRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListWorkerPoolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkerPoolsRequest instance + */ + public static create(properties?: google.cloud.run.v2.IListWorkerPoolsRequest): google.cloud.run.v2.ListWorkerPoolsRequest; + + /** + * Encodes the specified ListWorkerPoolsRequest message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. + * @param message ListWorkerPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListWorkerPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkerPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. + * @param message ListWorkerPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListWorkerPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkerPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListWorkerPoolsRequest; + + /** + * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkerPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListWorkerPoolsRequest; + + /** + * Verifies a ListWorkerPoolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkerPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkerPoolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListWorkerPoolsRequest; + + /** + * Creates a plain object from a ListWorkerPoolsRequest message. Also converts values to other types if specified. + * @param message ListWorkerPoolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListWorkerPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkerPoolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkerPoolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkerPoolsResponse. */ + interface IListWorkerPoolsResponse { + + /** ListWorkerPoolsResponse workerPools */ + workerPools?: (google.cloud.run.v2.IWorkerPool[]|null); + + /** ListWorkerPoolsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListWorkerPoolsResponse. */ + class ListWorkerPoolsResponse implements IListWorkerPoolsResponse { + + /** + * Constructs a new ListWorkerPoolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListWorkerPoolsResponse); + + /** ListWorkerPoolsResponse workerPools. */ + public workerPools: google.cloud.run.v2.IWorkerPool[]; + + /** ListWorkerPoolsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListWorkerPoolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkerPoolsResponse instance + */ + public static create(properties?: google.cloud.run.v2.IListWorkerPoolsResponse): google.cloud.run.v2.ListWorkerPoolsResponse; + + /** + * Encodes the specified ListWorkerPoolsResponse message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. + * @param message ListWorkerPoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListWorkerPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkerPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. + * @param message ListWorkerPoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListWorkerPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkerPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListWorkerPoolsResponse; + + /** + * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkerPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListWorkerPoolsResponse; + + /** + * Verifies a ListWorkerPoolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkerPoolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkerPoolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListWorkerPoolsResponse; + + /** + * Creates a plain object from a ListWorkerPoolsResponse message. Also converts values to other types if specified. + * @param message ListWorkerPoolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListWorkerPoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkerPoolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkerPoolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetWorkerPoolRequest. */ + interface IGetWorkerPoolRequest { + + /** GetWorkerPoolRequest name */ + name?: (string|null); + } + + /** Represents a GetWorkerPoolRequest. */ + class GetWorkerPoolRequest implements IGetWorkerPoolRequest { + + /** + * Constructs a new GetWorkerPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IGetWorkerPoolRequest); + + /** GetWorkerPoolRequest name. */ + public name: string; + + /** + * Creates a new GetWorkerPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWorkerPoolRequest instance + */ + public static create(properties?: google.cloud.run.v2.IGetWorkerPoolRequest): google.cloud.run.v2.GetWorkerPoolRequest; + + /** + * Encodes the specified GetWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. + * @param message GetWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IGetWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. + * @param message GetWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IGetWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWorkerPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetWorkerPoolRequest; + + /** + * Decodes a GetWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetWorkerPoolRequest; + + /** + * Verifies a GetWorkerPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWorkerPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetWorkerPoolRequest; + + /** + * Creates a plain object from a GetWorkerPoolRequest message. Also converts values to other types if specified. + * @param message GetWorkerPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.GetWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWorkerPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWorkerPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteWorkerPoolRequest. */ + interface IDeleteWorkerPoolRequest { + + /** DeleteWorkerPoolRequest name */ + name?: (string|null); + + /** DeleteWorkerPoolRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteWorkerPoolRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteWorkerPoolRequest. */ + class DeleteWorkerPoolRequest implements IDeleteWorkerPoolRequest { + + /** + * Constructs a new DeleteWorkerPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IDeleteWorkerPoolRequest); + + /** DeleteWorkerPoolRequest name. */ + public name: string; + + /** DeleteWorkerPoolRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteWorkerPoolRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteWorkerPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkerPoolRequest instance + */ + public static create(properties?: google.cloud.run.v2.IDeleteWorkerPoolRequest): google.cloud.run.v2.DeleteWorkerPoolRequest; + + /** + * Encodes the specified DeleteWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. + * @param message DeleteWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IDeleteWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. + * @param message DeleteWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IDeleteWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteWorkerPoolRequest; + + /** + * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteWorkerPoolRequest; + + /** + * Verifies a DeleteWorkerPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkerPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteWorkerPoolRequest; + + /** + * Creates a plain object from a DeleteWorkerPoolRequest message. Also converts values to other types if specified. + * @param message DeleteWorkerPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.DeleteWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkerPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWorkerPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkerPool. */ + interface IWorkerPool { + + /** WorkerPool name */ + name?: (string|null); + + /** WorkerPool description */ + description?: (string|null); + + /** WorkerPool uid */ + uid?: (string|null); + + /** WorkerPool generation */ + generation?: (number|Long|string|null); + + /** WorkerPool labels */ + labels?: ({ [k: string]: string }|null); + + /** WorkerPool annotations */ + annotations?: ({ [k: string]: string }|null); + + /** WorkerPool createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool creator */ + creator?: (string|null); + + /** WorkerPool lastModifier */ + lastModifier?: (string|null); + + /** WorkerPool client */ + client?: (string|null); + + /** WorkerPool clientVersion */ + clientVersion?: (string|null); + + /** WorkerPool launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** WorkerPool binaryAuthorization */ + binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** WorkerPool template */ + template?: (google.cloud.run.v2.IWorkerPoolRevisionTemplate|null); + + /** WorkerPool instanceSplits */ + instanceSplits?: (google.cloud.run.v2.IInstanceSplit[]|null); + + /** WorkerPool scaling */ + scaling?: (google.cloud.run.v2.IWorkerPoolScaling|null); + + /** WorkerPool observedGeneration */ + observedGeneration?: (number|Long|string|null); + + /** WorkerPool terminalCondition */ + terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** WorkerPool conditions */ + conditions?: (google.cloud.run.v2.ICondition[]|null); + + /** WorkerPool latestReadyRevision */ + latestReadyRevision?: (string|null); + + /** WorkerPool latestCreatedRevision */ + latestCreatedRevision?: (string|null); + + /** WorkerPool instanceSplitStatuses */ + instanceSplitStatuses?: (google.cloud.run.v2.IInstanceSplitStatus[]|null); + + /** WorkerPool threatDetectionEnabled */ + threatDetectionEnabled?: (boolean|null); + + /** WorkerPool customAudiences */ + customAudiences?: (string[]|null); + + /** WorkerPool satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** WorkerPool reconciling */ + reconciling?: (boolean|null); + + /** WorkerPool etag */ + etag?: (string|null); + } + + /** Represents a WorkerPool. */ + class WorkerPool implements IWorkerPool { + + /** + * Constructs a new WorkerPool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IWorkerPool); + + /** WorkerPool name. */ + public name: string; + + /** WorkerPool description. */ + public description: string; + + /** WorkerPool uid. */ + public uid: string; + + /** WorkerPool generation. */ + public generation: (number|Long|string); + + /** WorkerPool labels. */ + public labels: { [k: string]: string }; + + /** WorkerPool annotations. */ + public annotations: { [k: string]: string }; + + /** WorkerPool createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool creator. */ + public creator: string; + + /** WorkerPool lastModifier. */ + public lastModifier: string; + + /** WorkerPool client. */ + public client: string; + + /** WorkerPool clientVersion. */ + public clientVersion: string; + + /** WorkerPool launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** WorkerPool binaryAuthorization. */ + public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** WorkerPool template. */ + public template?: (google.cloud.run.v2.IWorkerPoolRevisionTemplate|null); + + /** WorkerPool instanceSplits. */ + public instanceSplits: google.cloud.run.v2.IInstanceSplit[]; + + /** WorkerPool scaling. */ + public scaling?: (google.cloud.run.v2.IWorkerPoolScaling|null); + + /** WorkerPool observedGeneration. */ + public observedGeneration: (number|Long|string); + + /** WorkerPool terminalCondition. */ + public terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** WorkerPool conditions. */ + public conditions: google.cloud.run.v2.ICondition[]; + + /** WorkerPool latestReadyRevision. */ + public latestReadyRevision: string; + + /** WorkerPool latestCreatedRevision. */ + public latestCreatedRevision: string; + + /** WorkerPool instanceSplitStatuses. */ + public instanceSplitStatuses: google.cloud.run.v2.IInstanceSplitStatus[]; + + /** WorkerPool threatDetectionEnabled. */ + public threatDetectionEnabled: boolean; + + /** WorkerPool customAudiences. */ + public customAudiences: string[]; + + /** WorkerPool satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** WorkerPool reconciling. */ + public reconciling: boolean; + + /** WorkerPool etag. */ + public etag: string; + + /** + * Creates a new WorkerPool instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerPool instance + */ + public static create(properties?: google.cloud.run.v2.IWorkerPool): google.cloud.run.v2.WorkerPool; + + /** + * Encodes the specified WorkerPool message. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. + * @param message WorkerPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IWorkerPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerPool message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. + * @param message WorkerPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IWorkerPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerPool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.WorkerPool; + + /** + * Decodes a WorkerPool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.WorkerPool; + + /** + * Verifies a WorkerPool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkerPool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerPool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.WorkerPool; + + /** + * Creates a plain object from a WorkerPool message. Also converts values to other types if specified. + * @param message WorkerPool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.WorkerPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerPool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerPool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkerPoolRevisionTemplate. */ + interface IWorkerPoolRevisionTemplate { + + /** WorkerPoolRevisionTemplate revision */ + revision?: (string|null); + + /** WorkerPoolRevisionTemplate labels */ + labels?: ({ [k: string]: string }|null); + + /** WorkerPoolRevisionTemplate annotations */ + annotations?: ({ [k: string]: string }|null); + + /** WorkerPoolRevisionTemplate vpcAccess */ + vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** WorkerPoolRevisionTemplate serviceAccount */ + serviceAccount?: (string|null); + + /** WorkerPoolRevisionTemplate containers */ + containers?: (google.cloud.run.v2.IContainer[]|null); + + /** WorkerPoolRevisionTemplate volumes */ + volumes?: (google.cloud.run.v2.IVolume[]|null); + + /** WorkerPoolRevisionTemplate encryptionKey */ + encryptionKey?: (string|null); + + /** WorkerPoolRevisionTemplate serviceMesh */ + serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); + + /** WorkerPoolRevisionTemplate encryptionKeyRevocationAction */ + encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); + + /** WorkerPoolRevisionTemplate encryptionKeyShutdownDuration */ + encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** WorkerPoolRevisionTemplate nodeSelector */ + nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled */ + gpuZonalRedundancyDisabled?: (boolean|null); + } + + /** Represents a WorkerPoolRevisionTemplate. */ + class WorkerPoolRevisionTemplate implements IWorkerPoolRevisionTemplate { + + /** + * Constructs a new WorkerPoolRevisionTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IWorkerPoolRevisionTemplate); + + /** WorkerPoolRevisionTemplate revision. */ + public revision: string; + + /** WorkerPoolRevisionTemplate labels. */ + public labels: { [k: string]: string }; + + /** WorkerPoolRevisionTemplate annotations. */ + public annotations: { [k: string]: string }; + + /** WorkerPoolRevisionTemplate vpcAccess. */ + public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** WorkerPoolRevisionTemplate serviceAccount. */ + public serviceAccount: string; + + /** WorkerPoolRevisionTemplate containers. */ + public containers: google.cloud.run.v2.IContainer[]; + + /** WorkerPoolRevisionTemplate volumes. */ + public volumes: google.cloud.run.v2.IVolume[]; + + /** WorkerPoolRevisionTemplate encryptionKey. */ + public encryptionKey: string; + + /** WorkerPoolRevisionTemplate serviceMesh. */ + public serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); + + /** WorkerPoolRevisionTemplate encryptionKeyRevocationAction. */ + public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); + + /** WorkerPoolRevisionTemplate encryptionKeyShutdownDuration. */ + public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** WorkerPoolRevisionTemplate nodeSelector. */ + public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled. */ + public gpuZonalRedundancyDisabled?: (boolean|null); + + /** + * Creates a new WorkerPoolRevisionTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerPoolRevisionTemplate instance + */ + public static create(properties?: google.cloud.run.v2.IWorkerPoolRevisionTemplate): google.cloud.run.v2.WorkerPoolRevisionTemplate; + + /** + * Encodes the specified WorkerPoolRevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. + * @param message WorkerPoolRevisionTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IWorkerPoolRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerPoolRevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. + * @param message WorkerPoolRevisionTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IWorkerPoolRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerPoolRevisionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.WorkerPoolRevisionTemplate; + + /** + * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerPoolRevisionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.WorkerPoolRevisionTemplate; + + /** + * Verifies a WorkerPoolRevisionTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkerPoolRevisionTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerPoolRevisionTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.WorkerPoolRevisionTemplate; + + /** + * Creates a plain object from a WorkerPoolRevisionTemplate message. Also converts values to other types if specified. + * @param message WorkerPoolRevisionTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.WorkerPoolRevisionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerPoolRevisionTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerPoolRevisionTemplate + * @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 ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingRule. */ + interface IRoutingRule { + + /** RoutingRule routingParameters */ + routingParameters?: (google.api.IRoutingParameter[]|null); + } + + /** Represents a RoutingRule. */ + class RoutingRule implements IRoutingRule { + + /** + * Constructs a new RoutingRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRoutingRule); + + /** RoutingRule routingParameters. */ + public routingParameters: google.api.IRoutingParameter[]; + + /** + * Creates a new RoutingRule instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingRule instance + */ + public static create(properties?: google.api.IRoutingRule): google.api.RoutingRule; + + /** + * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @param message RoutingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @param message RoutingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RoutingRule; + + /** + * Decodes a RoutingRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RoutingRule; + + /** + * Verifies a RoutingRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingRule + */ + public static fromObject(object: { [k: string]: any }): google.api.RoutingRule; + + /** + * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. + * @param message RoutingRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RoutingRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutingParameter. */ + interface IRoutingParameter { + + /** RoutingParameter field */ + field?: (string|null); + + /** RoutingParameter pathTemplate */ + pathTemplate?: (string|null); + } + + /** Represents a RoutingParameter. */ + class RoutingParameter implements IRoutingParameter { + + /** + * Constructs a new RoutingParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRoutingParameter); + + /** RoutingParameter field. */ + public field: string; + + /** RoutingParameter pathTemplate. */ + public pathTemplate: string; + + /** + * Creates a new RoutingParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingParameter instance + */ + public static create(properties?: google.api.IRoutingParameter): google.api.RoutingParameter; + + /** + * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @param message RoutingParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @param message RoutingParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RoutingParameter; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RoutingParameter; + + /** + * Verifies a RoutingParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingParameter + */ + public static fromObject(object: { [k: string]: any }): google.api.RoutingParameter; + + /** + * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. + * @param message RoutingParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RoutingParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.api.routing */ + ".google.api.routing"?: (google.api.IRoutingRule|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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 longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a IAMPolicy */ + class IAMPolicy extends $protobuf.rpc.Service { + + /** + * Constructs a new IAMPolicy service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; + } + + namespace IAMPolicy { + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @param error Error, if any + * @param [response] TestIamPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; + } + + /** Properties of a SetIamPolicyRequest. */ + interface ISetIamPolicyRequest { + + /** SetIamPolicyRequest resource */ + resource?: (string|null); + + /** SetIamPolicyRequest policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetIamPolicyRequest. */ + class SetIamPolicyRequest implements ISetIamPolicyRequest { + + /** + * Constructs a new SetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ISetIamPolicyRequest); + + /** SetIamPolicyRequest resource. */ + public resource: string; + + /** SetIamPolicyRequest policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** SetIamPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; + + /** + * Verifies a SetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetIamPolicyRequest. */ + interface IGetIamPolicyRequest { + + /** GetIamPolicyRequest resource */ + resource?: (string|null); + + /** GetIamPolicyRequest options */ + options?: (google.iam.v1.IGetPolicyOptions|null); + } + + /** Represents a GetIamPolicyRequest. */ + class GetIamPolicyRequest implements IGetIamPolicyRequest { + + /** + * Constructs a new GetIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetIamPolicyRequest); + + /** GetIamPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyRequest options. */ + public options?: (google.iam.v1.IGetPolicyOptions|null); + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRequest instance + */ + public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; + + /** + * Verifies a GetIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsRequest. */ + interface ITestIamPermissionsRequest { + + /** TestIamPermissionsRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsRequest. */ + class TestIamPermissionsRequest implements ITestIamPermissionsRequest { + + /** + * Constructs a new TestIamPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); + + /** TestIamPermissionsRequest resource. */ + public resource: string; + + /** TestIamPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRequest instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @param message TestIamPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; + + /** + * Verifies a TestIamPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TestIamPermissionsResponse. */ + interface ITestIamPermissionsResponse { + + /** TestIamPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestIamPermissionsResponse. */ + class TestIamPermissionsResponse implements ITestIamPermissionsResponse { + + /** + * Constructs a new TestIamPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); + + /** TestIamPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResponse instance + */ + public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @param message TestIamPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; + + /** + * Verifies a TestIamPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @param message TestIamPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyOptions. */ + interface IGetPolicyOptions { + + /** GetPolicyOptions requestedPolicyVersion */ + requestedPolicyVersion?: (number|null); + } + + /** Represents a GetPolicyOptions. */ + class GetPolicyOptions implements IGetPolicyOptions { + + /** + * Constructs a new GetPolicyOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IGetPolicyOptions); + + /** GetPolicyOptions requestedPolicyVersion. */ + public requestedPolicyVersion: number; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyOptions instance + */ + public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @param message GetPolicyOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; + + /** + * Verifies a GetPolicyOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyOptions + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @param message GetPolicyOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|Buffer|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|Buffer|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-run/protos/protos.js b/owl-bot-staging/google-cloud-run/protos/protos.js new file mode 100644 index 00000000000..c7edd21ba6b --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/protos.js @@ -0,0 +1,61975 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_run_protos || ($protobuf.roots._google_cloud_run_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.run = (function() { + + /** + * Namespace run. + * @memberof google.cloud + * @namespace + */ + var run = {}; + + run.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.cloud.run + * @namespace + */ + var v2 = {}; + + v2.Builds = (function() { + + /** + * Constructs a new Builds service. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Builds + * @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 Builds(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Builds.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Builds; + + /** + * Creates new Builds service using the specified rpc implementation. + * @function create + * @memberof google.cloud.run.v2.Builds + * @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 {Builds} RPC service. Useful where requests and/or responses are streamed. + */ + Builds.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.run.v2.Builds|submitBuild}. + * @memberof google.cloud.run.v2.Builds + * @typedef SubmitBuildCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.SubmitBuildResponse} [response] SubmitBuildResponse + */ + + /** + * Calls SubmitBuild. + * @function submitBuild + * @memberof google.cloud.run.v2.Builds + * @instance + * @param {google.cloud.run.v2.ISubmitBuildRequest} request SubmitBuildRequest message or plain object + * @param {google.cloud.run.v2.Builds.SubmitBuildCallback} callback Node-style callback called with the error, if any, and SubmitBuildResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Builds.prototype.submitBuild = function submitBuild(request, callback) { + return this.rpcCall(submitBuild, $root.google.cloud.run.v2.SubmitBuildRequest, $root.google.cloud.run.v2.SubmitBuildResponse, request, callback); + }, "name", { value: "SubmitBuild" }); + + /** + * Calls SubmitBuild. + * @function submitBuild + * @memberof google.cloud.run.v2.Builds + * @instance + * @param {google.cloud.run.v2.ISubmitBuildRequest} request SubmitBuildRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Builds; + })(); + + v2.SubmitBuildRequest = (function() { + + /** + * Properties of a SubmitBuildRequest. + * @memberof google.cloud.run.v2 + * @interface ISubmitBuildRequest + * @property {string|null} [parent] SubmitBuildRequest parent + * @property {google.cloud.run.v2.IStorageSource|null} [storageSource] SubmitBuildRequest storageSource + * @property {string|null} [imageUri] SubmitBuildRequest imageUri + * @property {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null} [buildpackBuild] SubmitBuildRequest buildpackBuild + * @property {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null} [dockerBuild] SubmitBuildRequest dockerBuild + * @property {string|null} [serviceAccount] SubmitBuildRequest serviceAccount + * @property {string|null} [workerPool] SubmitBuildRequest workerPool + * @property {Array.|null} [tags] SubmitBuildRequest tags + * @property {string|null} [machineType] SubmitBuildRequest machineType + * @property {google.api.LaunchStage|null} [releaseTrack] SubmitBuildRequest releaseTrack + * @property {string|null} [client] SubmitBuildRequest client + */ + + /** + * Constructs a new SubmitBuildRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a SubmitBuildRequest. + * @implements ISubmitBuildRequest + * @constructor + * @param {google.cloud.run.v2.ISubmitBuildRequest=} [properties] Properties to set + */ + function SubmitBuildRequest(properties) { + 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]]; + } + + /** + * SubmitBuildRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.parent = ""; + + /** + * SubmitBuildRequest storageSource. + * @member {google.cloud.run.v2.IStorageSource|null|undefined} storageSource + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.storageSource = null; + + /** + * SubmitBuildRequest imageUri. + * @member {string} imageUri + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.imageUri = ""; + + /** + * SubmitBuildRequest buildpackBuild. + * @member {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null|undefined} buildpackBuild + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.buildpackBuild = null; + + /** + * SubmitBuildRequest dockerBuild. + * @member {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null|undefined} dockerBuild + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.dockerBuild = null; + + /** + * SubmitBuildRequest serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.serviceAccount = ""; + + /** + * SubmitBuildRequest workerPool. + * @member {string} workerPool + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.workerPool = ""; + + /** + * SubmitBuildRequest tags. + * @member {Array.} tags + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.tags = $util.emptyArray; + + /** + * SubmitBuildRequest machineType. + * @member {string} machineType + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.machineType = ""; + + /** + * SubmitBuildRequest releaseTrack. + * @member {google.api.LaunchStage} releaseTrack + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.releaseTrack = 0; + + /** + * SubmitBuildRequest client. + * @member {string} client + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + SubmitBuildRequest.prototype.client = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubmitBuildRequest source. + * @member {"storageSource"|undefined} source + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + Object.defineProperty(SubmitBuildRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["storageSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubmitBuildRequest buildType. + * @member {"buildpackBuild"|"dockerBuild"|undefined} buildType + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + */ + Object.defineProperty(SubmitBuildRequest.prototype, "buildType", { + get: $util.oneOfGetter($oneOfFields = ["buildpackBuild", "dockerBuild"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubmitBuildRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @static + * @param {google.cloud.run.v2.ISubmitBuildRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest instance + */ + SubmitBuildRequest.create = function create(properties) { + return new SubmitBuildRequest(properties); + }; + + /** + * Encodes the specified SubmitBuildRequest message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @static + * @param {google.cloud.run.v2.ISubmitBuildRequest} message SubmitBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitBuildRequest.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.storageSource != null && Object.hasOwnProperty.call(message, "storageSource")) + $root.google.cloud.run.v2.StorageSource.encode(message.storageSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); + if (message.buildpackBuild != null && Object.hasOwnProperty.call(message, "buildpackBuild")) + $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.encode(message.buildpackBuild, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.dockerBuild != null && Object.hasOwnProperty.call(message, "dockerBuild")) + $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.encode(message.dockerBuild, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceAccount); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.workerPool); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.machineType); + if (message.releaseTrack != null && Object.hasOwnProperty.call(message, "releaseTrack")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.releaseTrack); + if (message.client != null && Object.hasOwnProperty.call(message, "client")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.client); + return writer; + }; + + /** + * Encodes the specified SubmitBuildRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @static + * @param {google.cloud.run.v2.ISubmitBuildRequest} message SubmitBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubmitBuildRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitBuildRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.storageSource = $root.google.cloud.run.v2.StorageSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.imageUri = reader.string(); + break; + } + case 4: { + message.buildpackBuild = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.decode(reader, reader.uint32()); + break; + } + case 5: { + message.dockerBuild = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.decode(reader, reader.uint32()); + break; + } + case 6: { + message.serviceAccount = reader.string(); + break; + } + case 7: { + message.workerPool = reader.string(); + break; + } + case 8: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 9: { + message.machineType = reader.string(); + break; + } + case 10: { + message.releaseTrack = reader.int32(); + break; + } + case 11: { + message.client = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubmitBuildRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitBuildRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubmitBuildRequest message. + * @function verify + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubmitBuildRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.storageSource != null && message.hasOwnProperty("storageSource")) { + properties.source = 1; + { + var error = $root.google.cloud.run.v2.StorageSource.verify(message.storageSource); + if (error) + return "storageSource." + error; + } + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.buildpackBuild != null && message.hasOwnProperty("buildpackBuild")) { + properties.buildType = 1; + { + var error = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify(message.buildpackBuild); + if (error) + return "buildpackBuild." + error; + } + } + if (message.dockerBuild != null && message.hasOwnProperty("dockerBuild")) { + if (properties.buildType === 1) + return "buildType: multiple values"; + properties.buildType = 1; + { + var error = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify(message.dockerBuild); + if (error) + return "dockerBuild." + error; + } + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + 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"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.releaseTrack != null && message.hasOwnProperty("releaseTrack")) + switch (message.releaseTrack) { + default: + return "releaseTrack: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.client != null && message.hasOwnProperty("client")) + if (!$util.isString(message.client)) + return "client: string expected"; + return null; + }; + + /** + * Creates a SubmitBuildRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest + */ + SubmitBuildRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.SubmitBuildRequest) + return object; + var message = new $root.google.cloud.run.v2.SubmitBuildRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.storageSource != null) { + if (typeof object.storageSource !== "object") + throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.storageSource: object expected"); + message.storageSource = $root.google.cloud.run.v2.StorageSource.fromObject(object.storageSource); + } + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.buildpackBuild != null) { + if (typeof object.buildpackBuild !== "object") + throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.buildpackBuild: object expected"); + message.buildpackBuild = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.fromObject(object.buildpackBuild); + } + if (object.dockerBuild != null) { + if (typeof object.dockerBuild !== "object") + throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.dockerBuild: object expected"); + message.dockerBuild = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.fromObject(object.dockerBuild); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.machineType != null) + message.machineType = String(object.machineType); + switch (object.releaseTrack) { + default: + if (typeof object.releaseTrack === "number") { + message.releaseTrack = object.releaseTrack; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.releaseTrack = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.releaseTrack = 6; + break; + case "PRELAUNCH": + case 7: + message.releaseTrack = 7; + break; + case "EARLY_ACCESS": + case 1: + message.releaseTrack = 1; + break; + case "ALPHA": + case 2: + message.releaseTrack = 2; + break; + case "BETA": + case 3: + message.releaseTrack = 3; + break; + case "GA": + case 4: + message.releaseTrack = 4; + break; + case "DEPRECATED": + case 5: + message.releaseTrack = 5; + break; + } + if (object.client != null) + message.client = String(object.client); + return message; + }; + + /** + * Creates a plain object from a SubmitBuildRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @static + * @param {google.cloud.run.v2.SubmitBuildRequest} message SubmitBuildRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubmitBuildRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tags = []; + if (options.defaults) { + object.parent = ""; + object.imageUri = ""; + object.serviceAccount = ""; + object.workerPool = ""; + object.machineType = ""; + object.releaseTrack = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.client = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.storageSource != null && message.hasOwnProperty("storageSource")) { + object.storageSource = $root.google.cloud.run.v2.StorageSource.toObject(message.storageSource, options); + if (options.oneofs) + object.source = "storageSource"; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.buildpackBuild != null && message.hasOwnProperty("buildpackBuild")) { + object.buildpackBuild = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.toObject(message.buildpackBuild, options); + if (options.oneofs) + object.buildType = "buildpackBuild"; + } + if (message.dockerBuild != null && message.hasOwnProperty("dockerBuild")) { + object.dockerBuild = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.toObject(message.dockerBuild, options); + if (options.oneofs) + object.buildType = "dockerBuild"; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.releaseTrack != null && message.hasOwnProperty("releaseTrack")) + object.releaseTrack = options.enums === String ? $root.google.api.LaunchStage[message.releaseTrack] === undefined ? message.releaseTrack : $root.google.api.LaunchStage[message.releaseTrack] : message.releaseTrack; + if (message.client != null && message.hasOwnProperty("client")) + object.client = message.client; + return object; + }; + + /** + * Converts this SubmitBuildRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @instance + * @returns {Object.} JSON object + */ + SubmitBuildRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubmitBuildRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubmitBuildRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildRequest"; + }; + + SubmitBuildRequest.DockerBuild = (function() { + + /** + * Properties of a DockerBuild. + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @interface IDockerBuild + */ + + /** + * Constructs a new DockerBuild. + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @classdesc Represents a DockerBuild. + * @implements IDockerBuild + * @constructor + * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild=} [properties] Properties to set + */ + function DockerBuild(properties) { + if (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 DockerBuild instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild + * @static + * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild=} [properties] Properties to set + * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild instance + */ + DockerBuild.create = function create(properties) { + return new DockerBuild(properties); + }; + + /** + * Encodes the specified DockerBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild + * @static + * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild} message DockerBuild message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DockerBuild.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DockerBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild + * @static + * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild} message DockerBuild message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DockerBuild.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DockerBuild message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DockerBuild.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DockerBuild message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DockerBuild.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DockerBuild message. + * @function verify + * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DockerBuild.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DockerBuild message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild + */ + DockerBuild.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild) + return object; + return new $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild(); + }; + + /** + * Creates a plain object from a DockerBuild message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild + * @static + * @param {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} message DockerBuild + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DockerBuild.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DockerBuild to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild + * @instance + * @returns {Object.} JSON object + */ + DockerBuild.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DockerBuild + * @function getTypeUrl + * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DockerBuild.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildRequest.DockerBuild"; + }; + + return DockerBuild; + })(); + + SubmitBuildRequest.BuildpacksBuild = (function() { + + /** + * Properties of a BuildpacksBuild. + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @interface IBuildpacksBuild + * @property {string|null} [runtime] BuildpacksBuild runtime + * @property {string|null} [functionTarget] BuildpacksBuild functionTarget + * @property {string|null} [cacheImageUri] BuildpacksBuild cacheImageUri + * @property {string|null} [baseImage] BuildpacksBuild baseImage + * @property {Object.|null} [environmentVariables] BuildpacksBuild environmentVariables + * @property {boolean|null} [enableAutomaticUpdates] BuildpacksBuild enableAutomaticUpdates + * @property {string|null} [projectDescriptor] BuildpacksBuild projectDescriptor + */ + + /** + * Constructs a new BuildpacksBuild. + * @memberof google.cloud.run.v2.SubmitBuildRequest + * @classdesc Represents a BuildpacksBuild. + * @implements IBuildpacksBuild + * @constructor + * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild=} [properties] Properties to set + */ + function BuildpacksBuild(properties) { + this.environmentVariables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildpacksBuild runtime. + * @member {string} runtime + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @instance + */ + BuildpacksBuild.prototype.runtime = ""; + + /** + * BuildpacksBuild functionTarget. + * @member {string} functionTarget + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @instance + */ + BuildpacksBuild.prototype.functionTarget = ""; + + /** + * BuildpacksBuild cacheImageUri. + * @member {string} cacheImageUri + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @instance + */ + BuildpacksBuild.prototype.cacheImageUri = ""; + + /** + * BuildpacksBuild baseImage. + * @member {string} baseImage + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @instance + */ + BuildpacksBuild.prototype.baseImage = ""; + + /** + * BuildpacksBuild environmentVariables. + * @member {Object.} environmentVariables + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @instance + */ + BuildpacksBuild.prototype.environmentVariables = $util.emptyObject; + + /** + * BuildpacksBuild enableAutomaticUpdates. + * @member {boolean} enableAutomaticUpdates + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @instance + */ + BuildpacksBuild.prototype.enableAutomaticUpdates = false; + + /** + * BuildpacksBuild projectDescriptor. + * @member {string} projectDescriptor + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @instance + */ + BuildpacksBuild.prototype.projectDescriptor = ""; + + /** + * Creates a new BuildpacksBuild instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @static + * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild=} [properties] Properties to set + * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild instance + */ + BuildpacksBuild.create = function create(properties) { + return new BuildpacksBuild(properties); + }; + + /** + * Encodes the specified BuildpacksBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @static + * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild} message BuildpacksBuild message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildpacksBuild.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runtime != null && Object.hasOwnProperty.call(message, "runtime")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.runtime); + if (message.functionTarget != null && Object.hasOwnProperty.call(message, "functionTarget")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.functionTarget); + if (message.cacheImageUri != null && Object.hasOwnProperty.call(message, "cacheImageUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.cacheImageUri); + if (message.baseImage != null && Object.hasOwnProperty.call(message, "baseImage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.baseImage); + if (message.environmentVariables != null && Object.hasOwnProperty.call(message, "environmentVariables")) + for (var keys = Object.keys(message.environmentVariables), 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.environmentVariables[keys[i]]).ldelim(); + if (message.enableAutomaticUpdates != null && Object.hasOwnProperty.call(message, "enableAutomaticUpdates")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableAutomaticUpdates); + if (message.projectDescriptor != null && Object.hasOwnProperty.call(message, "projectDescriptor")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.projectDescriptor); + return writer; + }; + + /** + * Encodes the specified BuildpacksBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @static + * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild} message BuildpacksBuild message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildpacksBuild.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildpacksBuild message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildpacksBuild.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.runtime = reader.string(); + break; + } + case 2: { + message.functionTarget = reader.string(); + break; + } + case 3: { + message.cacheImageUri = reader.string(); + break; + } + case 4: { + message.baseImage = reader.string(); + break; + } + case 5: { + if (message.environmentVariables === $util.emptyObject) + message.environmentVariables = {}; + 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.environmentVariables[key] = value; + break; + } + case 6: { + message.enableAutomaticUpdates = reader.bool(); + break; + } + case 7: { + message.projectDescriptor = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildpacksBuild message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildpacksBuild.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildpacksBuild message. + * @function verify + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildpacksBuild.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runtime != null && message.hasOwnProperty("runtime")) + if (!$util.isString(message.runtime)) + return "runtime: string expected"; + if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) + if (!$util.isString(message.functionTarget)) + return "functionTarget: string expected"; + if (message.cacheImageUri != null && message.hasOwnProperty("cacheImageUri")) + if (!$util.isString(message.cacheImageUri)) + return "cacheImageUri: string expected"; + if (message.baseImage != null && message.hasOwnProperty("baseImage")) + if (!$util.isString(message.baseImage)) + return "baseImage: string expected"; + if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) { + if (!$util.isObject(message.environmentVariables)) + return "environmentVariables: object expected"; + var key = Object.keys(message.environmentVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.environmentVariables[key[i]])) + return "environmentVariables: string{k:string} expected"; + } + if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) + if (typeof message.enableAutomaticUpdates !== "boolean") + return "enableAutomaticUpdates: boolean expected"; + if (message.projectDescriptor != null && message.hasOwnProperty("projectDescriptor")) + if (!$util.isString(message.projectDescriptor)) + return "projectDescriptor: string expected"; + return null; + }; + + /** + * Creates a BuildpacksBuild message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild + */ + BuildpacksBuild.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild) + return object; + var message = new $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild(); + if (object.runtime != null) + message.runtime = String(object.runtime); + if (object.functionTarget != null) + message.functionTarget = String(object.functionTarget); + if (object.cacheImageUri != null) + message.cacheImageUri = String(object.cacheImageUri); + if (object.baseImage != null) + message.baseImage = String(object.baseImage); + if (object.environmentVariables) { + if (typeof object.environmentVariables !== "object") + throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.environmentVariables: object expected"); + message.environmentVariables = {}; + for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i) + message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]); + } + if (object.enableAutomaticUpdates != null) + message.enableAutomaticUpdates = Boolean(object.enableAutomaticUpdates); + if (object.projectDescriptor != null) + message.projectDescriptor = String(object.projectDescriptor); + return message; + }; + + /** + * Creates a plain object from a BuildpacksBuild message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @static + * @param {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} message BuildpacksBuild + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildpacksBuild.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.environmentVariables = {}; + if (options.defaults) { + object.runtime = ""; + object.functionTarget = ""; + object.cacheImageUri = ""; + object.baseImage = ""; + object.enableAutomaticUpdates = false; + object.projectDescriptor = ""; + } + if (message.runtime != null && message.hasOwnProperty("runtime")) + object.runtime = message.runtime; + if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) + object.functionTarget = message.functionTarget; + if (message.cacheImageUri != null && message.hasOwnProperty("cacheImageUri")) + object.cacheImageUri = message.cacheImageUri; + if (message.baseImage != null && message.hasOwnProperty("baseImage")) + object.baseImage = message.baseImage; + var keys2; + if (message.environmentVariables && (keys2 = Object.keys(message.environmentVariables)).length) { + object.environmentVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.environmentVariables[keys2[j]] = message.environmentVariables[keys2[j]]; + } + if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) + object.enableAutomaticUpdates = message.enableAutomaticUpdates; + if (message.projectDescriptor != null && message.hasOwnProperty("projectDescriptor")) + object.projectDescriptor = message.projectDescriptor; + return object; + }; + + /** + * Converts this BuildpacksBuild to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @instance + * @returns {Object.} JSON object + */ + BuildpacksBuild.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuildpacksBuild + * @function getTypeUrl + * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuildpacksBuild.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild"; + }; + + return BuildpacksBuild; + })(); + + return SubmitBuildRequest; + })(); + + v2.SubmitBuildResponse = (function() { + + /** + * Properties of a SubmitBuildResponse. + * @memberof google.cloud.run.v2 + * @interface ISubmitBuildResponse + * @property {google.longrunning.IOperation|null} [buildOperation] SubmitBuildResponse buildOperation + * @property {string|null} [baseImageUri] SubmitBuildResponse baseImageUri + * @property {string|null} [baseImageWarning] SubmitBuildResponse baseImageWarning + */ + + /** + * Constructs a new SubmitBuildResponse. + * @memberof google.cloud.run.v2 + * @classdesc Represents a SubmitBuildResponse. + * @implements ISubmitBuildResponse + * @constructor + * @param {google.cloud.run.v2.ISubmitBuildResponse=} [properties] Properties to set + */ + function SubmitBuildResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubmitBuildResponse buildOperation. + * @member {google.longrunning.IOperation|null|undefined} buildOperation + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @instance + */ + SubmitBuildResponse.prototype.buildOperation = null; + + /** + * SubmitBuildResponse baseImageUri. + * @member {string} baseImageUri + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @instance + */ + SubmitBuildResponse.prototype.baseImageUri = ""; + + /** + * SubmitBuildResponse baseImageWarning. + * @member {string} baseImageWarning + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @instance + */ + SubmitBuildResponse.prototype.baseImageWarning = ""; + + /** + * Creates a new SubmitBuildResponse instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @static + * @param {google.cloud.run.v2.ISubmitBuildResponse=} [properties] Properties to set + * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse instance + */ + SubmitBuildResponse.create = function create(properties) { + return new SubmitBuildResponse(properties); + }; + + /** + * Encodes the specified SubmitBuildResponse message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @static + * @param {google.cloud.run.v2.ISubmitBuildResponse} message SubmitBuildResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitBuildResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buildOperation != null && Object.hasOwnProperty.call(message, "buildOperation")) + $root.google.longrunning.Operation.encode(message.buildOperation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.baseImageUri != null && Object.hasOwnProperty.call(message, "baseImageUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseImageUri); + if (message.baseImageWarning != null && Object.hasOwnProperty.call(message, "baseImageWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.baseImageWarning); + return writer; + }; + + /** + * Encodes the specified SubmitBuildResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @static + * @param {google.cloud.run.v2.ISubmitBuildResponse} message SubmitBuildResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitBuildResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubmitBuildResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitBuildResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.buildOperation = $root.google.longrunning.Operation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.baseImageUri = reader.string(); + break; + } + case 3: { + message.baseImageWarning = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubmitBuildResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitBuildResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubmitBuildResponse message. + * @function verify + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubmitBuildResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buildOperation != null && message.hasOwnProperty("buildOperation")) { + var error = $root.google.longrunning.Operation.verify(message.buildOperation); + if (error) + return "buildOperation." + error; + } + if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) + if (!$util.isString(message.baseImageUri)) + return "baseImageUri: string expected"; + if (message.baseImageWarning != null && message.hasOwnProperty("baseImageWarning")) + if (!$util.isString(message.baseImageWarning)) + return "baseImageWarning: string expected"; + return null; + }; + + /** + * Creates a SubmitBuildResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse + */ + SubmitBuildResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.SubmitBuildResponse) + return object; + var message = new $root.google.cloud.run.v2.SubmitBuildResponse(); + if (object.buildOperation != null) { + if (typeof object.buildOperation !== "object") + throw TypeError(".google.cloud.run.v2.SubmitBuildResponse.buildOperation: object expected"); + message.buildOperation = $root.google.longrunning.Operation.fromObject(object.buildOperation); + } + if (object.baseImageUri != null) + message.baseImageUri = String(object.baseImageUri); + if (object.baseImageWarning != null) + message.baseImageWarning = String(object.baseImageWarning); + return message; + }; + + /** + * Creates a plain object from a SubmitBuildResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @static + * @param {google.cloud.run.v2.SubmitBuildResponse} message SubmitBuildResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubmitBuildResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.buildOperation = null; + object.baseImageUri = ""; + object.baseImageWarning = ""; + } + if (message.buildOperation != null && message.hasOwnProperty("buildOperation")) + object.buildOperation = $root.google.longrunning.Operation.toObject(message.buildOperation, options); + if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) + object.baseImageUri = message.baseImageUri; + if (message.baseImageWarning != null && message.hasOwnProperty("baseImageWarning")) + object.baseImageWarning = message.baseImageWarning; + return object; + }; + + /** + * Converts this SubmitBuildResponse to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @instance + * @returns {Object.} JSON object + */ + SubmitBuildResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubmitBuildResponse + * @function getTypeUrl + * @memberof google.cloud.run.v2.SubmitBuildResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubmitBuildResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildResponse"; + }; + + return SubmitBuildResponse; + })(); + + v2.StorageSource = (function() { + + /** + * Properties of a StorageSource. + * @memberof google.cloud.run.v2 + * @interface IStorageSource + * @property {string|null} [bucket] StorageSource bucket + * @property {string|null} [object] StorageSource object + * @property {number|Long|null} [generation] StorageSource generation + */ + + /** + * Constructs a new StorageSource. + * @memberof google.cloud.run.v2 + * @classdesc Represents a StorageSource. + * @implements IStorageSource + * @constructor + * @param {google.cloud.run.v2.IStorageSource=} [properties] Properties to set + */ + function StorageSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StorageSource bucket. + * @member {string} bucket + * @memberof google.cloud.run.v2.StorageSource + * @instance + */ + StorageSource.prototype.bucket = ""; + + /** + * StorageSource object. + * @member {string} object + * @memberof google.cloud.run.v2.StorageSource + * @instance + */ + StorageSource.prototype.object = ""; + + /** + * StorageSource generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.StorageSource + * @instance + */ + StorageSource.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new StorageSource instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.StorageSource + * @static + * @param {google.cloud.run.v2.IStorageSource=} [properties] Properties to set + * @returns {google.cloud.run.v2.StorageSource} StorageSource instance + */ + StorageSource.create = function create(properties) { + return new StorageSource(properties); + }; + + /** + * Encodes the specified StorageSource message. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.StorageSource + * @static + * @param {google.cloud.run.v2.IStorageSource} message StorageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + return writer; + }; + + /** + * Encodes the specified StorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.StorageSource + * @static + * @param {google.cloud.run.v2.IStorageSource} message StorageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StorageSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.StorageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.StorageSource} StorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StorageSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StorageSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.StorageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.StorageSource} StorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StorageSource message. + * @function verify + * @memberof google.cloud.run.v2.StorageSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StorageSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + return null; + }; + + /** + * Creates a StorageSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.StorageSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.StorageSource} StorageSource + */ + StorageSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.StorageSource) + return object; + var message = new $root.google.cloud.run.v2.StorageSource(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StorageSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.StorageSource + * @static + * @param {google.cloud.run.v2.StorageSource} message StorageSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StorageSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + return object; + }; + + /** + * Converts this StorageSource to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.StorageSource + * @instance + * @returns {Object.} JSON object + */ + StorageSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StorageSource + * @function getTypeUrl + * @memberof google.cloud.run.v2.StorageSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StorageSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.StorageSource"; + }; + + return StorageSource; + })(); + + v2.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.cloud.run.v2 + * @interface ICondition + * @property {string|null} [type] Condition type + * @property {google.cloud.run.v2.Condition.State|null} [state] Condition state + * @property {string|null} [message] Condition message + * @property {google.protobuf.ITimestamp|null} [lastTransitionTime] Condition lastTransitionTime + * @property {google.cloud.run.v2.Condition.Severity|null} [severity] Condition severity + * @property {google.cloud.run.v2.Condition.CommonReason|null} [reason] Condition reason + * @property {google.cloud.run.v2.Condition.RevisionReason|null} [revisionReason] Condition revisionReason + * @property {google.cloud.run.v2.Condition.ExecutionReason|null} [executionReason] Condition executionReason + */ + + /** + * Constructs a new Condition. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.cloud.run.v2.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Condition type. + * @member {string} type + * @memberof google.cloud.run.v2.Condition + * @instance + */ + Condition.prototype.type = ""; + + /** + * Condition state. + * @member {google.cloud.run.v2.Condition.State} state + * @memberof google.cloud.run.v2.Condition + * @instance + */ + Condition.prototype.state = 0; + + /** + * Condition message. + * @member {string} message + * @memberof google.cloud.run.v2.Condition + * @instance + */ + Condition.prototype.message = ""; + + /** + * Condition lastTransitionTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastTransitionTime + * @memberof google.cloud.run.v2.Condition + * @instance + */ + Condition.prototype.lastTransitionTime = null; + + /** + * Condition severity. + * @member {google.cloud.run.v2.Condition.Severity} severity + * @memberof google.cloud.run.v2.Condition + * @instance + */ + Condition.prototype.severity = 0; + + /** + * Condition reason. + * @member {google.cloud.run.v2.Condition.CommonReason|null|undefined} reason + * @memberof google.cloud.run.v2.Condition + * @instance + */ + Condition.prototype.reason = null; + + /** + * Condition revisionReason. + * @member {google.cloud.run.v2.Condition.RevisionReason|null|undefined} revisionReason + * @memberof google.cloud.run.v2.Condition + * @instance + */ + Condition.prototype.revisionReason = null; + + /** + * Condition executionReason. + * @member {google.cloud.run.v2.Condition.ExecutionReason|null|undefined} executionReason + * @memberof google.cloud.run.v2.Condition + * @instance + */ + Condition.prototype.executionReason = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Condition reasons. + * @member {"reason"|"revisionReason"|"executionReason"|undefined} reasons + * @memberof google.cloud.run.v2.Condition + * @instance + */ + Object.defineProperty(Condition.prototype, "reasons", { + get: $util.oneOfGetter($oneOfFields = ["reason", "revisionReason", "executionReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Condition + * @static + * @param {google.cloud.run.v2.ICondition=} [properties] Properties to set + * @returns {google.cloud.run.v2.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Condition + * @static + * @param {google.cloud.run.v2.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); + if (message.lastTransitionTime != null && Object.hasOwnProperty.call(message, "lastTransitionTime")) + $root.google.protobuf.Timestamp.encode(message.lastTransitionTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.severity); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.reason); + if (message.revisionReason != null && Object.hasOwnProperty.call(message, "revisionReason")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.revisionReason); + if (message.executionReason != null && Object.hasOwnProperty.call(message, "executionReason")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.executionReason); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Condition + * @static + * @param {google.cloud.run.v2.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.message = reader.string(); + break; + } + case 4: { + message.lastTransitionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.severity = reader.int32(); + break; + } + case 6: { + message.reason = reader.int32(); + break; + } + case 9: { + message.revisionReason = reader.int32(); + break; + } + case 11: { + message.executionReason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.cloud.run.v2.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.lastTransitionTime != null && message.hasOwnProperty("lastTransitionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastTransitionTime); + if (error) + return "lastTransitionTime." + error; + } + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.reason != null && message.hasOwnProperty("reason")) { + properties.reasons = 1; + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + break; + } + } + if (message.revisionReason != null && message.hasOwnProperty("revisionReason")) { + if (properties.reasons === 1) + return "reasons: multiple values"; + properties.reasons = 1; + switch (message.revisionReason) { + default: + return "revisionReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + } + if (message.executionReason != null && message.hasOwnProperty("executionReason")) { + if (properties.reasons === 1) + return "reasons: multiple values"; + properties.reasons = 1; + switch (message.executionReason) { + default: + return "executionReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Condition) + return object; + var message = new $root.google.cloud.run.v2.Condition(); + if (object.type != null) + message.type = String(object.type); + 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 "CONDITION_PENDING": + case 1: + message.state = 1; + break; + case "CONDITION_RECONCILING": + case 2: + message.state = 2; + break; + case "CONDITION_FAILED": + case 3: + message.state = 3; + break; + case "CONDITION_SUCCEEDED": + case 4: + message.state = 4; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.lastTransitionTime != null) { + if (typeof object.lastTransitionTime !== "object") + throw TypeError(".google.cloud.run.v2.Condition.lastTransitionTime: object expected"); + message.lastTransitionTime = $root.google.protobuf.Timestamp.fromObject(object.lastTransitionTime); + } + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "ERROR": + case 1: + message.severity = 1; + break; + case "WARNING": + case 2: + message.severity = 2; + break; + case "INFO": + case 3: + message.severity = 3; + break; + } + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "COMMON_REASON_UNDEFINED": + case 0: + message.reason = 0; + break; + case "UNKNOWN": + case 1: + message.reason = 1; + break; + case "REVISION_FAILED": + case 3: + message.reason = 3; + break; + case "PROGRESS_DEADLINE_EXCEEDED": + case 4: + message.reason = 4; + break; + case "CONTAINER_MISSING": + case 6: + message.reason = 6; + break; + case "CONTAINER_PERMISSION_DENIED": + case 7: + message.reason = 7; + break; + case "CONTAINER_IMAGE_UNAUTHORIZED": + case 8: + message.reason = 8; + break; + case "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED": + case 9: + message.reason = 9; + break; + case "ENCRYPTION_KEY_PERMISSION_DENIED": + case 10: + message.reason = 10; + break; + case "ENCRYPTION_KEY_CHECK_FAILED": + case 11: + message.reason = 11; + break; + case "SECRETS_ACCESS_CHECK_FAILED": + case 12: + message.reason = 12; + break; + case "WAITING_FOR_OPERATION": + case 13: + message.reason = 13; + break; + case "IMMEDIATE_RETRY": + case 14: + message.reason = 14; + break; + case "POSTPONED_RETRY": + case 15: + message.reason = 15; + break; + case "INTERNAL": + case 16: + message.reason = 16; + break; + case "VPC_NETWORK_NOT_FOUND": + case 17: + message.reason = 17; + break; + } + switch (object.revisionReason) { + default: + if (typeof object.revisionReason === "number") { + message.revisionReason = object.revisionReason; + break; + } + break; + case "REVISION_REASON_UNDEFINED": + case 0: + message.revisionReason = 0; + break; + case "PENDING": + case 1: + message.revisionReason = 1; + break; + case "RESERVE": + case 2: + message.revisionReason = 2; + break; + case "RETIRED": + case 3: + message.revisionReason = 3; + break; + case "RETIRING": + case 4: + message.revisionReason = 4; + break; + case "RECREATING": + case 5: + message.revisionReason = 5; + break; + case "HEALTH_CHECK_CONTAINER_ERROR": + case 6: + message.revisionReason = 6; + break; + case "CUSTOMIZED_PATH_RESPONSE_PENDING": + case 7: + message.revisionReason = 7; + break; + case "MIN_INSTANCES_NOT_PROVISIONED": + case 8: + message.revisionReason = 8; + break; + case "ACTIVE_REVISION_LIMIT_REACHED": + case 9: + message.revisionReason = 9; + break; + case "NO_DEPLOYMENT": + case 10: + message.revisionReason = 10; + break; + case "HEALTH_CHECK_SKIPPED": + case 11: + message.revisionReason = 11; + break; + case "MIN_INSTANCES_WARMING": + case 12: + message.revisionReason = 12; + break; + } + switch (object.executionReason) { + default: + if (typeof object.executionReason === "number") { + message.executionReason = object.executionReason; + break; + } + break; + case "EXECUTION_REASON_UNDEFINED": + case 0: + message.executionReason = 0; + break; + case "JOB_STATUS_SERVICE_POLLING_ERROR": + case 1: + message.executionReason = 1; + break; + case "NON_ZERO_EXIT_CODE": + case 2: + message.executionReason = 2; + break; + case "CANCELLED": + case 3: + message.executionReason = 3; + break; + case "CANCELLING": + case 4: + message.executionReason = 4; + break; + case "DELETED": + case 5: + message.executionReason = 5; + break; + case "DELAYED_START_PENDING": + case 6: + message.executionReason = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Condition + * @static + * @param {google.cloud.run.v2.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.message = ""; + object.lastTransitionTime = null; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.run.v2.Condition.State[message.state] === undefined ? message.state : $root.google.cloud.run.v2.Condition.State[message.state] : message.state; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.lastTransitionTime != null && message.hasOwnProperty("lastTransitionTime")) + object.lastTransitionTime = $root.google.protobuf.Timestamp.toObject(message.lastTransitionTime, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.run.v2.Condition.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.run.v2.Condition.Severity[message.severity] : message.severity; + if (message.reason != null && message.hasOwnProperty("reason")) { + object.reason = options.enums === String ? $root.google.cloud.run.v2.Condition.CommonReason[message.reason] === undefined ? message.reason : $root.google.cloud.run.v2.Condition.CommonReason[message.reason] : message.reason; + if (options.oneofs) + object.reasons = "reason"; + } + if (message.revisionReason != null && message.hasOwnProperty("revisionReason")) { + object.revisionReason = options.enums === String ? $root.google.cloud.run.v2.Condition.RevisionReason[message.revisionReason] === undefined ? message.revisionReason : $root.google.cloud.run.v2.Condition.RevisionReason[message.revisionReason] : message.revisionReason; + if (options.oneofs) + object.reasons = "revisionReason"; + } + if (message.executionReason != null && message.hasOwnProperty("executionReason")) { + object.executionReason = options.enums === String ? $root.google.cloud.run.v2.Condition.ExecutionReason[message.executionReason] === undefined ? message.executionReason : $root.google.cloud.run.v2.Condition.ExecutionReason[message.executionReason] : message.executionReason; + if (options.oneofs) + object.reasons = "executionReason"; + } + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Condition + * @function getTypeUrl + * @memberof google.cloud.run.v2.Condition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.Condition"; + }; + + /** + * State enum. + * @name google.cloud.run.v2.Condition.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CONDITION_PENDING=1 CONDITION_PENDING value + * @property {number} CONDITION_RECONCILING=2 CONDITION_RECONCILING value + * @property {number} CONDITION_FAILED=3 CONDITION_FAILED value + * @property {number} CONDITION_SUCCEEDED=4 CONDITION_SUCCEEDED value + */ + Condition.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONDITION_PENDING"] = 1; + values[valuesById[2] = "CONDITION_RECONCILING"] = 2; + values[valuesById[3] = "CONDITION_FAILED"] = 3; + values[valuesById[4] = "CONDITION_SUCCEEDED"] = 4; + return values; + })(); + + /** + * Severity enum. + * @name google.cloud.run.v2.Condition.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} ERROR=1 ERROR value + * @property {number} WARNING=2 WARNING value + * @property {number} INFO=3 INFO value + */ + Condition.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ERROR"] = 1; + values[valuesById[2] = "WARNING"] = 2; + values[valuesById[3] = "INFO"] = 3; + return values; + })(); + + /** + * CommonReason enum. + * @name google.cloud.run.v2.Condition.CommonReason + * @enum {number} + * @property {number} COMMON_REASON_UNDEFINED=0 COMMON_REASON_UNDEFINED value + * @property {number} UNKNOWN=1 UNKNOWN value + * @property {number} REVISION_FAILED=3 REVISION_FAILED value + * @property {number} PROGRESS_DEADLINE_EXCEEDED=4 PROGRESS_DEADLINE_EXCEEDED value + * @property {number} CONTAINER_MISSING=6 CONTAINER_MISSING value + * @property {number} CONTAINER_PERMISSION_DENIED=7 CONTAINER_PERMISSION_DENIED value + * @property {number} CONTAINER_IMAGE_UNAUTHORIZED=8 CONTAINER_IMAGE_UNAUTHORIZED value + * @property {number} CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED=9 CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED value + * @property {number} ENCRYPTION_KEY_PERMISSION_DENIED=10 ENCRYPTION_KEY_PERMISSION_DENIED value + * @property {number} ENCRYPTION_KEY_CHECK_FAILED=11 ENCRYPTION_KEY_CHECK_FAILED value + * @property {number} SECRETS_ACCESS_CHECK_FAILED=12 SECRETS_ACCESS_CHECK_FAILED value + * @property {number} WAITING_FOR_OPERATION=13 WAITING_FOR_OPERATION value + * @property {number} IMMEDIATE_RETRY=14 IMMEDIATE_RETRY value + * @property {number} POSTPONED_RETRY=15 POSTPONED_RETRY value + * @property {number} INTERNAL=16 INTERNAL value + * @property {number} VPC_NETWORK_NOT_FOUND=17 VPC_NETWORK_NOT_FOUND value + */ + Condition.CommonReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMMON_REASON_UNDEFINED"] = 0; + values[valuesById[1] = "UNKNOWN"] = 1; + values[valuesById[3] = "REVISION_FAILED"] = 3; + values[valuesById[4] = "PROGRESS_DEADLINE_EXCEEDED"] = 4; + values[valuesById[6] = "CONTAINER_MISSING"] = 6; + values[valuesById[7] = "CONTAINER_PERMISSION_DENIED"] = 7; + values[valuesById[8] = "CONTAINER_IMAGE_UNAUTHORIZED"] = 8; + values[valuesById[9] = "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED"] = 9; + values[valuesById[10] = "ENCRYPTION_KEY_PERMISSION_DENIED"] = 10; + values[valuesById[11] = "ENCRYPTION_KEY_CHECK_FAILED"] = 11; + values[valuesById[12] = "SECRETS_ACCESS_CHECK_FAILED"] = 12; + values[valuesById[13] = "WAITING_FOR_OPERATION"] = 13; + values[valuesById[14] = "IMMEDIATE_RETRY"] = 14; + values[valuesById[15] = "POSTPONED_RETRY"] = 15; + values[valuesById[16] = "INTERNAL"] = 16; + values[valuesById[17] = "VPC_NETWORK_NOT_FOUND"] = 17; + return values; + })(); + + /** + * RevisionReason enum. + * @name google.cloud.run.v2.Condition.RevisionReason + * @enum {number} + * @property {number} REVISION_REASON_UNDEFINED=0 REVISION_REASON_UNDEFINED value + * @property {number} PENDING=1 PENDING value + * @property {number} RESERVE=2 RESERVE value + * @property {number} RETIRED=3 RETIRED value + * @property {number} RETIRING=4 RETIRING value + * @property {number} RECREATING=5 RECREATING value + * @property {number} HEALTH_CHECK_CONTAINER_ERROR=6 HEALTH_CHECK_CONTAINER_ERROR value + * @property {number} CUSTOMIZED_PATH_RESPONSE_PENDING=7 CUSTOMIZED_PATH_RESPONSE_PENDING value + * @property {number} MIN_INSTANCES_NOT_PROVISIONED=8 MIN_INSTANCES_NOT_PROVISIONED value + * @property {number} ACTIVE_REVISION_LIMIT_REACHED=9 ACTIVE_REVISION_LIMIT_REACHED value + * @property {number} NO_DEPLOYMENT=10 NO_DEPLOYMENT value + * @property {number} HEALTH_CHECK_SKIPPED=11 HEALTH_CHECK_SKIPPED value + * @property {number} MIN_INSTANCES_WARMING=12 MIN_INSTANCES_WARMING value + */ + Condition.RevisionReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REVISION_REASON_UNDEFINED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RESERVE"] = 2; + values[valuesById[3] = "RETIRED"] = 3; + values[valuesById[4] = "RETIRING"] = 4; + values[valuesById[5] = "RECREATING"] = 5; + values[valuesById[6] = "HEALTH_CHECK_CONTAINER_ERROR"] = 6; + values[valuesById[7] = "CUSTOMIZED_PATH_RESPONSE_PENDING"] = 7; + values[valuesById[8] = "MIN_INSTANCES_NOT_PROVISIONED"] = 8; + values[valuesById[9] = "ACTIVE_REVISION_LIMIT_REACHED"] = 9; + values[valuesById[10] = "NO_DEPLOYMENT"] = 10; + values[valuesById[11] = "HEALTH_CHECK_SKIPPED"] = 11; + values[valuesById[12] = "MIN_INSTANCES_WARMING"] = 12; + return values; + })(); + + /** + * ExecutionReason enum. + * @name google.cloud.run.v2.Condition.ExecutionReason + * @enum {number} + * @property {number} EXECUTION_REASON_UNDEFINED=0 EXECUTION_REASON_UNDEFINED value + * @property {number} JOB_STATUS_SERVICE_POLLING_ERROR=1 JOB_STATUS_SERVICE_POLLING_ERROR value + * @property {number} NON_ZERO_EXIT_CODE=2 NON_ZERO_EXIT_CODE value + * @property {number} CANCELLED=3 CANCELLED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} DELETED=5 DELETED value + * @property {number} DELAYED_START_PENDING=6 DELAYED_START_PENDING value + */ + Condition.ExecutionReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_REASON_UNDEFINED"] = 0; + values[valuesById[1] = "JOB_STATUS_SERVICE_POLLING_ERROR"] = 1; + values[valuesById[2] = "NON_ZERO_EXIT_CODE"] = 2; + values[valuesById[3] = "CANCELLED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "DELETED"] = 5; + values[valuesById[6] = "DELAYED_START_PENDING"] = 6; + return values; + })(); + + return Condition; + })(); + + v2.ContainerStatus = (function() { + + /** + * Properties of a ContainerStatus. + * @memberof google.cloud.run.v2 + * @interface IContainerStatus + * @property {string|null} [name] ContainerStatus name + * @property {string|null} [imageDigest] ContainerStatus imageDigest + */ + + /** + * Constructs a new ContainerStatus. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ContainerStatus. + * @implements IContainerStatus + * @constructor + * @param {google.cloud.run.v2.IContainerStatus=} [properties] Properties to set + */ + function ContainerStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContainerStatus name. + * @member {string} name + * @memberof google.cloud.run.v2.ContainerStatus + * @instance + */ + ContainerStatus.prototype.name = ""; + + /** + * ContainerStatus imageDigest. + * @member {string} imageDigest + * @memberof google.cloud.run.v2.ContainerStatus + * @instance + */ + ContainerStatus.prototype.imageDigest = ""; + + /** + * Creates a new ContainerStatus instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.IContainerStatus=} [properties] Properties to set + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus instance + */ + ContainerStatus.create = function create(properties) { + return new ContainerStatus(properties); + }; + + /** + * Encodes the specified ContainerStatus message. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.IContainerStatus} message ContainerStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.imageDigest != null && Object.hasOwnProperty.call(message, "imageDigest")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageDigest); + return writer; + }; + + /** + * Encodes the specified ContainerStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.IContainerStatus} message ContainerStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ContainerStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.imageDigest = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContainerStatus message. + * @function verify + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContainerStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.imageDigest != null && message.hasOwnProperty("imageDigest")) + if (!$util.isString(message.imageDigest)) + return "imageDigest: string expected"; + return null; + }; + + /** + * Creates a ContainerStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus + */ + ContainerStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ContainerStatus) + return object; + var message = new $root.google.cloud.run.v2.ContainerStatus(); + if (object.name != null) + message.name = String(object.name); + if (object.imageDigest != null) + message.imageDigest = String(object.imageDigest); + return message; + }; + + /** + * Creates a plain object from a ContainerStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.ContainerStatus} message ContainerStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContainerStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.imageDigest = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.imageDigest != null && message.hasOwnProperty("imageDigest")) + object.imageDigest = message.imageDigest; + return object; + }; + + /** + * Converts this ContainerStatus to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ContainerStatus + * @instance + * @returns {Object.} JSON object + */ + ContainerStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContainerStatus + * @function getTypeUrl + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContainerStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ContainerStatus"; + }; + + return ContainerStatus; + })(); + + v2.Executions = (function() { + + /** + * Constructs a new Executions service. + * @memberof google.cloud.run.v2 + * @classdesc Represents an Executions + * @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 Executions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Executions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Executions; + + /** + * Creates new Executions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.run.v2.Executions + * @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 {Executions} RPC service. Useful where requests and/or responses are streamed. + */ + Executions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.run.v2.Executions|getExecution}. + * @memberof google.cloud.run.v2.Executions + * @typedef GetExecutionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.Execution} [response] Execution + */ + + /** + * Calls GetExecution. + * @function getExecution + * @memberof google.cloud.run.v2.Executions + * @instance + * @param {google.cloud.run.v2.IGetExecutionRequest} request GetExecutionRequest message or plain object + * @param {google.cloud.run.v2.Executions.GetExecutionCallback} callback Node-style callback called with the error, if any, and Execution + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Executions.prototype.getExecution = function getExecution(request, callback) { + return this.rpcCall(getExecution, $root.google.cloud.run.v2.GetExecutionRequest, $root.google.cloud.run.v2.Execution, request, callback); + }, "name", { value: "GetExecution" }); + + /** + * Calls GetExecution. + * @function getExecution + * @memberof google.cloud.run.v2.Executions + * @instance + * @param {google.cloud.run.v2.IGetExecutionRequest} request GetExecutionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Executions|listExecutions}. + * @memberof google.cloud.run.v2.Executions + * @typedef ListExecutionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.ListExecutionsResponse} [response] ListExecutionsResponse + */ + + /** + * Calls ListExecutions. + * @function listExecutions + * @memberof google.cloud.run.v2.Executions + * @instance + * @param {google.cloud.run.v2.IListExecutionsRequest} request ListExecutionsRequest message or plain object + * @param {google.cloud.run.v2.Executions.ListExecutionsCallback} callback Node-style callback called with the error, if any, and ListExecutionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Executions.prototype.listExecutions = function listExecutions(request, callback) { + return this.rpcCall(listExecutions, $root.google.cloud.run.v2.ListExecutionsRequest, $root.google.cloud.run.v2.ListExecutionsResponse, request, callback); + }, "name", { value: "ListExecutions" }); + + /** + * Calls ListExecutions. + * @function listExecutions + * @memberof google.cloud.run.v2.Executions + * @instance + * @param {google.cloud.run.v2.IListExecutionsRequest} request ListExecutionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Executions|deleteExecution}. + * @memberof google.cloud.run.v2.Executions + * @typedef DeleteExecutionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteExecution. + * @function deleteExecution + * @memberof google.cloud.run.v2.Executions + * @instance + * @param {google.cloud.run.v2.IDeleteExecutionRequest} request DeleteExecutionRequest message or plain object + * @param {google.cloud.run.v2.Executions.DeleteExecutionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Executions.prototype.deleteExecution = function deleteExecution(request, callback) { + return this.rpcCall(deleteExecution, $root.google.cloud.run.v2.DeleteExecutionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteExecution" }); + + /** + * Calls DeleteExecution. + * @function deleteExecution + * @memberof google.cloud.run.v2.Executions + * @instance + * @param {google.cloud.run.v2.IDeleteExecutionRequest} request DeleteExecutionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Executions|cancelExecution}. + * @memberof google.cloud.run.v2.Executions + * @typedef CancelExecutionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CancelExecution. + * @function cancelExecution + * @memberof google.cloud.run.v2.Executions + * @instance + * @param {google.cloud.run.v2.ICancelExecutionRequest} request CancelExecutionRequest message or plain object + * @param {google.cloud.run.v2.Executions.CancelExecutionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Executions.prototype.cancelExecution = function cancelExecution(request, callback) { + return this.rpcCall(cancelExecution, $root.google.cloud.run.v2.CancelExecutionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CancelExecution" }); + + /** + * Calls CancelExecution. + * @function cancelExecution + * @memberof google.cloud.run.v2.Executions + * @instance + * @param {google.cloud.run.v2.ICancelExecutionRequest} request CancelExecutionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Executions; + })(); + + v2.GetExecutionRequest = (function() { + + /** + * Properties of a GetExecutionRequest. + * @memberof google.cloud.run.v2 + * @interface IGetExecutionRequest + * @property {string|null} [name] GetExecutionRequest name + */ + + /** + * Constructs a new GetExecutionRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GetExecutionRequest. + * @implements IGetExecutionRequest + * @constructor + * @param {google.cloud.run.v2.IGetExecutionRequest=} [properties] Properties to set + */ + function GetExecutionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExecutionRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.GetExecutionRequest + * @instance + */ + GetExecutionRequest.prototype.name = ""; + + /** + * Creates a new GetExecutionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GetExecutionRequest + * @static + * @param {google.cloud.run.v2.IGetExecutionRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest instance + */ + GetExecutionRequest.create = function create(properties) { + return new GetExecutionRequest(properties); + }; + + /** + * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GetExecutionRequest + * @static + * @param {google.cloud.run.v2.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExecutionRequest.encode = function encode(message, writer) { + 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 GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GetExecutionRequest + * @static + * @param {google.cloud.run.v2.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExecutionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.GetExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExecutionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetExecutionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetExecutionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GetExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExecutionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExecutionRequest message. + * @function verify + * @memberof google.cloud.run.v2.GetExecutionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExecutionRequest.verify = function verify(message) { + if (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 GetExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.GetExecutionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest + */ + GetExecutionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GetExecutionRequest) + return object; + var message = new $root.google.cloud.run.v2.GetExecutionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExecutionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.GetExecutionRequest + * @static + * @param {google.cloud.run.v2.GetExecutionRequest} message GetExecutionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExecutionRequest.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 GetExecutionRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.GetExecutionRequest + * @instance + * @returns {Object.} JSON object + */ + GetExecutionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExecutionRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.GetExecutionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExecutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.GetExecutionRequest"; + }; + + return GetExecutionRequest; + })(); + + v2.ListExecutionsRequest = (function() { + + /** + * Properties of a ListExecutionsRequest. + * @memberof google.cloud.run.v2 + * @interface IListExecutionsRequest + * @property {string|null} [parent] ListExecutionsRequest parent + * @property {number|null} [pageSize] ListExecutionsRequest pageSize + * @property {string|null} [pageToken] ListExecutionsRequest pageToken + * @property {boolean|null} [showDeleted] ListExecutionsRequest showDeleted + */ + + /** + * Constructs a new ListExecutionsRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListExecutionsRequest. + * @implements IListExecutionsRequest + * @constructor + * @param {google.cloud.run.v2.IListExecutionsRequest=} [properties] Properties to set + */ + function ListExecutionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExecutionsRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @instance + */ + ListExecutionsRequest.prototype.parent = ""; + + /** + * ListExecutionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @instance + */ + ListExecutionsRequest.prototype.pageSize = 0; + + /** + * ListExecutionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @instance + */ + ListExecutionsRequest.prototype.pageToken = ""; + + /** + * ListExecutionsRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @instance + */ + ListExecutionsRequest.prototype.showDeleted = false; + + /** + * Creates a new ListExecutionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @static + * @param {google.cloud.run.v2.IListExecutionsRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest instance + */ + ListExecutionsRequest.create = function create(properties) { + return new ListExecutionsRequest(properties); + }; + + /** + * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @static + * @param {google.cloud.run.v2.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExecutionsRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @static + * @param {google.cloud.run.v2.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExecutionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExecutionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExecutionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListExecutionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExecutionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExecutionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExecutionsRequest message. + * @function verify + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExecutionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListExecutionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest + */ + ListExecutionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListExecutionsRequest) + return object; + var message = new $root.google.cloud.run.v2.ListExecutionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListExecutionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @static + * @param {google.cloud.run.v2.ListExecutionsRequest} message ListExecutionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExecutionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + 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.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListExecutionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListExecutionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExecutionsRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListExecutionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExecutionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListExecutionsRequest"; + }; + + return ListExecutionsRequest; + })(); + + v2.ListExecutionsResponse = (function() { + + /** + * Properties of a ListExecutionsResponse. + * @memberof google.cloud.run.v2 + * @interface IListExecutionsResponse + * @property {Array.|null} [executions] ListExecutionsResponse executions + * @property {string|null} [nextPageToken] ListExecutionsResponse nextPageToken + */ + + /** + * Constructs a new ListExecutionsResponse. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListExecutionsResponse. + * @implements IListExecutionsResponse + * @constructor + * @param {google.cloud.run.v2.IListExecutionsResponse=} [properties] Properties to set + */ + function ListExecutionsResponse(properties) { + this.executions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExecutionsResponse executions. + * @member {Array.} executions + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @instance + */ + ListExecutionsResponse.prototype.executions = $util.emptyArray; + + /** + * ListExecutionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @instance + */ + ListExecutionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExecutionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @static + * @param {google.cloud.run.v2.IListExecutionsResponse=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse instance + */ + ListExecutionsResponse.create = function create(properties) { + return new ListExecutionsResponse(properties); + }; + + /** + * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @static + * @param {google.cloud.run.v2.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExecutionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.executions != null && message.executions.length) + for (var i = 0; i < message.executions.length; ++i) + $root.google.cloud.run.v2.Execution.encode(message.executions[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 ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @static + * @param {google.cloud.run.v2.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExecutionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExecutionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExecutionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListExecutionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.executions && message.executions.length)) + message.executions = []; + message.executions.push($root.google.cloud.run.v2.Execution.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExecutionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExecutionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExecutionsResponse message. + * @function verify + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExecutionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.executions != null && message.hasOwnProperty("executions")) { + if (!Array.isArray(message.executions)) + return "executions: array expected"; + for (var i = 0; i < message.executions.length; ++i) { + var error = $root.google.cloud.run.v2.Execution.verify(message.executions[i]); + if (error) + return "executions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExecutionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse + */ + ListExecutionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListExecutionsResponse) + return object; + var message = new $root.google.cloud.run.v2.ListExecutionsResponse(); + if (object.executions) { + if (!Array.isArray(object.executions)) + throw TypeError(".google.cloud.run.v2.ListExecutionsResponse.executions: array expected"); + message.executions = []; + for (var i = 0; i < object.executions.length; ++i) { + if (typeof object.executions[i] !== "object") + throw TypeError(".google.cloud.run.v2.ListExecutionsResponse.executions: object expected"); + message.executions[i] = $root.google.cloud.run.v2.Execution.fromObject(object.executions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExecutionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @static + * @param {google.cloud.run.v2.ListExecutionsResponse} message ListExecutionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExecutionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.executions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.executions && message.executions.length) { + object.executions = []; + for (var j = 0; j < message.executions.length; ++j) + object.executions[j] = $root.google.cloud.run.v2.Execution.toObject(message.executions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExecutionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListExecutionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExecutionsResponse + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListExecutionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExecutionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListExecutionsResponse"; + }; + + return ListExecutionsResponse; + })(); + + v2.DeleteExecutionRequest = (function() { + + /** + * Properties of a DeleteExecutionRequest. + * @memberof google.cloud.run.v2 + * @interface IDeleteExecutionRequest + * @property {string|null} [name] DeleteExecutionRequest name + * @property {boolean|null} [validateOnly] DeleteExecutionRequest validateOnly + * @property {string|null} [etag] DeleteExecutionRequest etag + */ + + /** + * Constructs a new DeleteExecutionRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a DeleteExecutionRequest. + * @implements IDeleteExecutionRequest + * @constructor + * @param {google.cloud.run.v2.IDeleteExecutionRequest=} [properties] Properties to set + */ + function DeleteExecutionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteExecutionRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @instance + */ + DeleteExecutionRequest.prototype.name = ""; + + /** + * DeleteExecutionRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @instance + */ + DeleteExecutionRequest.prototype.validateOnly = false; + + /** + * DeleteExecutionRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @instance + */ + DeleteExecutionRequest.prototype.etag = ""; + + /** + * Creates a new DeleteExecutionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @static + * @param {google.cloud.run.v2.IDeleteExecutionRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest instance + */ + DeleteExecutionRequest.create = function create(properties) { + return new DeleteExecutionRequest(properties); + }; + + /** + * Encodes the specified DeleteExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @static + * @param {google.cloud.run.v2.IDeleteExecutionRequest} message DeleteExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExecutionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @static + * @param {google.cloud.run.v2.IDeleteExecutionRequest} message DeleteExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExecutionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExecutionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteExecutionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteExecutionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExecutionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExecutionRequest message. + * @function verify + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExecutionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest + */ + DeleteExecutionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.DeleteExecutionRequest) + return object; + var message = new $root.google.cloud.run.v2.DeleteExecutionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteExecutionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @static + * @param {google.cloud.run.v2.DeleteExecutionRequest} message DeleteExecutionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExecutionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteExecutionRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExecutionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExecutionRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.DeleteExecutionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExecutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.DeleteExecutionRequest"; + }; + + return DeleteExecutionRequest; + })(); + + v2.CancelExecutionRequest = (function() { + + /** + * Properties of a CancelExecutionRequest. + * @memberof google.cloud.run.v2 + * @interface ICancelExecutionRequest + * @property {string|null} [name] CancelExecutionRequest name + * @property {boolean|null} [validateOnly] CancelExecutionRequest validateOnly + * @property {string|null} [etag] CancelExecutionRequest etag + */ + + /** + * Constructs a new CancelExecutionRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a CancelExecutionRequest. + * @implements ICancelExecutionRequest + * @constructor + * @param {google.cloud.run.v2.ICancelExecutionRequest=} [properties] Properties to set + */ + function CancelExecutionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelExecutionRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @instance + */ + CancelExecutionRequest.prototype.name = ""; + + /** + * CancelExecutionRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @instance + */ + CancelExecutionRequest.prototype.validateOnly = false; + + /** + * CancelExecutionRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @instance + */ + CancelExecutionRequest.prototype.etag = ""; + + /** + * Creates a new CancelExecutionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {google.cloud.run.v2.ICancelExecutionRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest instance + */ + CancelExecutionRequest.create = function create(properties) { + return new CancelExecutionRequest(properties); + }; + + /** + * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {google.cloud.run.v2.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelExecutionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {google.cloud.run.v2.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelExecutionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelExecutionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CancelExecutionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelExecutionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelExecutionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelExecutionRequest message. + * @function verify + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelExecutionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a CancelExecutionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest + */ + CancelExecutionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.CancelExecutionRequest) + return object; + var message = new $root.google.cloud.run.v2.CancelExecutionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {google.cloud.run.v2.CancelExecutionRequest} message CancelExecutionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelExecutionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this CancelExecutionRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @instance + * @returns {Object.} JSON object + */ + CancelExecutionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelExecutionRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.CancelExecutionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelExecutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.CancelExecutionRequest"; + }; + + return CancelExecutionRequest; + })(); + + v2.Execution = (function() { + + /** + * Properties of an Execution. + * @memberof google.cloud.run.v2 + * @interface IExecution + * @property {string|null} [name] Execution name + * @property {string|null} [uid] Execution uid + * @property {string|null} [creator] Execution creator + * @property {number|Long|null} [generation] Execution generation + * @property {Object.|null} [labels] Execution labels + * @property {Object.|null} [annotations] Execution annotations + * @property {google.protobuf.ITimestamp|null} [createTime] Execution createTime + * @property {google.protobuf.ITimestamp|null} [startTime] Execution startTime + * @property {google.protobuf.ITimestamp|null} [completionTime] Execution completionTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Execution updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Execution deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Execution expireTime + * @property {google.api.LaunchStage|null} [launchStage] Execution launchStage + * @property {string|null} [job] Execution job + * @property {number|null} [parallelism] Execution parallelism + * @property {number|null} [taskCount] Execution taskCount + * @property {google.cloud.run.v2.ITaskTemplate|null} [template] Execution template + * @property {boolean|null} [reconciling] Execution reconciling + * @property {Array.|null} [conditions] Execution conditions + * @property {number|Long|null} [observedGeneration] Execution observedGeneration + * @property {number|null} [runningCount] Execution runningCount + * @property {number|null} [succeededCount] Execution succeededCount + * @property {number|null} [failedCount] Execution failedCount + * @property {number|null} [cancelledCount] Execution cancelledCount + * @property {number|null} [retriedCount] Execution retriedCount + * @property {string|null} [logUri] Execution logUri + * @property {boolean|null} [satisfiesPzs] Execution satisfiesPzs + * @property {string|null} [etag] Execution etag + */ + + /** + * Constructs a new Execution. + * @memberof google.cloud.run.v2 + * @classdesc Represents an Execution. + * @implements IExecution + * @constructor + * @param {google.cloud.run.v2.IExecution=} [properties] Properties to set + */ + function Execution(properties) { + this.labels = {}; + this.annotations = {}; + this.conditions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Execution name. + * @member {string} name + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.name = ""; + + /** + * Execution uid. + * @member {string} uid + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.uid = ""; + + /** + * Execution creator. + * @member {string} creator + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.creator = ""; + + /** + * Execution generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Execution labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.labels = $util.emptyObject; + + /** + * Execution annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.annotations = $util.emptyObject; + + /** + * Execution createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.createTime = null; + + /** + * Execution startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.startTime = null; + + /** + * Execution completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.completionTime = null; + + /** + * Execution updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.updateTime = null; + + /** + * Execution deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.deleteTime = null; + + /** + * Execution expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.expireTime = null; + + /** + * Execution launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.launchStage = 0; + + /** + * Execution job. + * @member {string} job + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.job = ""; + + /** + * Execution parallelism. + * @member {number} parallelism + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.parallelism = 0; + + /** + * Execution taskCount. + * @member {number} taskCount + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.taskCount = 0; + + /** + * Execution template. + * @member {google.cloud.run.v2.ITaskTemplate|null|undefined} template + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.template = null; + + /** + * Execution reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.reconciling = false; + + /** + * Execution conditions. + * @member {Array.} conditions + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.conditions = $util.emptyArray; + + /** + * Execution observedGeneration. + * @member {number|Long} observedGeneration + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Execution runningCount. + * @member {number} runningCount + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.runningCount = 0; + + /** + * Execution succeededCount. + * @member {number} succeededCount + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.succeededCount = 0; + + /** + * Execution failedCount. + * @member {number} failedCount + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.failedCount = 0; + + /** + * Execution cancelledCount. + * @member {number} cancelledCount + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.cancelledCount = 0; + + /** + * Execution retriedCount. + * @member {number} retriedCount + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.retriedCount = 0; + + /** + * Execution logUri. + * @member {string} logUri + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.logUri = ""; + + /** + * Execution satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.satisfiesPzs = false; + + /** + * Execution etag. + * @member {string} etag + * @memberof google.cloud.run.v2.Execution + * @instance + */ + Execution.prototype.etag = ""; + + /** + * Creates a new Execution instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Execution + * @static + * @param {google.cloud.run.v2.IExecution=} [properties] Properties to set + * @returns {google.cloud.run.v2.Execution} Execution instance + */ + Execution.create = function create(properties) { + return new Execution(properties); + }; + + /** + * Encodes the specified Execution message. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Execution + * @static + * @param {google.cloud.run.v2.IExecution} message Execution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Execution.encode = function encode(message, writer) { + if (!writer) + 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.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.launchStage); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.job); + if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.parallelism); + if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.taskCount); + if (message.template != null && Object.hasOwnProperty.call(message, "template")) + $root.google.cloud.run.v2.TaskTemplate.encode(message.template, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) + writer.uint32(/* id 18, wireType 0 =*/144).int64(message.observedGeneration); + if (message.runningCount != null && Object.hasOwnProperty.call(message, "runningCount")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.runningCount); + if (message.succeededCount != null && Object.hasOwnProperty.call(message, "succeededCount")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.succeededCount); + if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.failedCount); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.cancelledCount != null && Object.hasOwnProperty.call(message, "cancelledCount")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.cancelledCount); + if (message.retriedCount != null && Object.hasOwnProperty.call(message, "retriedCount")) + writer.uint32(/* id 25, wireType 0 =*/200).int32(message.retriedCount); + if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.logUri); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.satisfiesPzs); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 32, wireType 2 =*/258).string(message.creator); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Execution + * @static + * @param {google.cloud.run.v2.IExecution} message Execution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Execution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Execution message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.Execution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.Execution} Execution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Execution.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Execution(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 32: { + message.creator = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 22: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.launchStage = reader.int32(); + break; + } + case 12: { + message.job = reader.string(); + break; + } + case 13: { + message.parallelism = reader.int32(); + break; + } + case 14: { + message.taskCount = reader.int32(); + break; + } + case 15: { + message.template = $root.google.cloud.run.v2.TaskTemplate.decode(reader, reader.uint32()); + break; + } + case 16: { + message.reconciling = reader.bool(); + break; + } + case 17: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); + break; + } + case 18: { + message.observedGeneration = reader.int64(); + break; + } + case 19: { + message.runningCount = reader.int32(); + break; + } + case 20: { + message.succeededCount = reader.int32(); + break; + } + case 21: { + message.failedCount = reader.int32(); + break; + } + case 24: { + message.cancelledCount = reader.int32(); + break; + } + case 25: { + message.retriedCount = reader.int32(); + break; + } + case 26: { + message.logUri = reader.string(); + break; + } + case 27: { + message.satisfiesPzs = reader.bool(); + break; + } + case 99: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Execution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.Execution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.Execution} Execution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Execution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Execution message. + * @function verify + * @memberof google.cloud.run.v2.Execution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Execution.verify = function verify(message) { + if (typeof message !== "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.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + 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.job != null && message.hasOwnProperty("job")) + if (!$util.isString(message.job)) + return "job: string expected"; + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + if (!$util.isInteger(message.parallelism)) + return "parallelism: integer expected"; + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (!$util.isInteger(message.taskCount)) + return "taskCount: integer expected"; + if (message.template != null && message.hasOwnProperty("template")) { + var error = $root.google.cloud.run.v2.TaskTemplate.verify(message.template); + if (error) + return "template." + error; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) + return "observedGeneration: integer|Long expected"; + if (message.runningCount != null && message.hasOwnProperty("runningCount")) + if (!$util.isInteger(message.runningCount)) + return "runningCount: integer expected"; + if (message.succeededCount != null && message.hasOwnProperty("succeededCount")) + if (!$util.isInteger(message.succeededCount)) + return "succeededCount: integer expected"; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + if (!$util.isInteger(message.failedCount)) + return "failedCount: integer expected"; + if (message.cancelledCount != null && message.hasOwnProperty("cancelledCount")) + if (!$util.isInteger(message.cancelledCount)) + return "cancelledCount: integer expected"; + if (message.retriedCount != null && message.hasOwnProperty("retriedCount")) + if (!$util.isInteger(message.retriedCount)) + return "retriedCount: integer expected"; + if (message.logUri != null && message.hasOwnProperty("logUri")) + if (!$util.isString(message.logUri)) + return "logUri: string expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an Execution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Execution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Execution} Execution + */ + Execution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Execution) + return object; + var message = new $root.google.cloud.run.v2.Execution(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.creator != null) + message.creator = String(object.creator); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.Execution.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.Execution.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.run.v2.Execution.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.run.v2.Execution.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".google.cloud.run.v2.Execution.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.run.v2.Execution.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.run.v2.Execution.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.run.v2.Execution.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + 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.job != null) + message.job = String(object.job); + if (object.parallelism != null) + message.parallelism = object.parallelism | 0; + if (object.taskCount != null) + message.taskCount = object.taskCount | 0; + if (object.template != null) { + if (typeof object.template !== "object") + throw TypeError(".google.cloud.run.v2.Execution.template: object expected"); + message.template = $root.google.cloud.run.v2.TaskTemplate.fromObject(object.template); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.run.v2.Execution.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.run.v2.Execution.conditions: object expected"); + message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); + } + } + if (object.observedGeneration != null) + if ($util.Long) + (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; + else if (typeof object.observedGeneration === "string") + message.observedGeneration = parseInt(object.observedGeneration, 10); + else if (typeof object.observedGeneration === "number") + message.observedGeneration = object.observedGeneration; + else if (typeof object.observedGeneration === "object") + message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); + if (object.runningCount != null) + message.runningCount = object.runningCount | 0; + if (object.succeededCount != null) + message.succeededCount = object.succeededCount | 0; + if (object.failedCount != null) + message.failedCount = object.failedCount | 0; + if (object.cancelledCount != null) + message.cancelledCount = object.cancelledCount | 0; + if (object.retriedCount != null) + message.retriedCount = object.retriedCount | 0; + if (object.logUri != null) + message.logUri = String(object.logUri); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an Execution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Execution + * @static + * @param {google.cloud.run.v2.Execution} message Execution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Execution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditions = []; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.createTime = null; + object.completionTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.job = ""; + object.parallelism = 0; + object.taskCount = 0; + object.template = null; + object.reconciling = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.observedGeneration = options.longs === String ? "0" : 0; + object.runningCount = 0; + object.succeededCount = 0; + object.failedCount = 0; + object.startTime = null; + object.cancelledCount = 0; + object.retriedCount = 0; + object.logUri = ""; + object.satisfiesPzs = false; + object.creator = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + 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.job != null && message.hasOwnProperty("job")) + object.job = message.job; + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + object.parallelism = message.parallelism; + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + object.taskCount = message.taskCount; + if (message.template != null && message.hasOwnProperty("template")) + object.template = $root.google.cloud.run.v2.TaskTemplate.toObject(message.template, options); + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); + } + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (typeof message.observedGeneration === "number") + object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; + else + object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; + if (message.runningCount != null && message.hasOwnProperty("runningCount")) + object.runningCount = message.runningCount; + if (message.succeededCount != null && message.hasOwnProperty("succeededCount")) + object.succeededCount = message.succeededCount; + if (message.failedCount != null && message.hasOwnProperty("failedCount")) + object.failedCount = message.failedCount; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.cancelledCount != null && message.hasOwnProperty("cancelledCount")) + object.cancelledCount = message.cancelledCount; + if (message.retriedCount != null && message.hasOwnProperty("retriedCount")) + object.retriedCount = message.retriedCount; + if (message.logUri != null && message.hasOwnProperty("logUri")) + object.logUri = message.logUri; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Execution to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.Execution + * @instance + * @returns {Object.} JSON object + */ + Execution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Execution + * @function getTypeUrl + * @memberof google.cloud.run.v2.Execution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Execution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.Execution"; + }; + + return Execution; + })(); + + v2.TaskTemplate = (function() { + + /** + * Properties of a TaskTemplate. + * @memberof google.cloud.run.v2 + * @interface ITaskTemplate + * @property {Array.|null} [containers] TaskTemplate containers + * @property {Array.|null} [volumes] TaskTemplate volumes + * @property {number|null} [maxRetries] TaskTemplate maxRetries + * @property {google.protobuf.IDuration|null} [timeout] TaskTemplate timeout + * @property {string|null} [serviceAccount] TaskTemplate serviceAccount + * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] TaskTemplate executionEnvironment + * @property {string|null} [encryptionKey] TaskTemplate encryptionKey + * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] TaskTemplate vpcAccess + * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] TaskTemplate nodeSelector + * @property {boolean|null} [gpuZonalRedundancyDisabled] TaskTemplate gpuZonalRedundancyDisabled + */ + + /** + * Constructs a new TaskTemplate. + * @memberof google.cloud.run.v2 + * @classdesc Represents a TaskTemplate. + * @implements ITaskTemplate + * @constructor + * @param {google.cloud.run.v2.ITaskTemplate=} [properties] Properties to set + */ + function TaskTemplate(properties) { + this.containers = []; + 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]]; + } + + /** + * TaskTemplate containers. + * @member {Array.} containers + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + TaskTemplate.prototype.containers = $util.emptyArray; + + /** + * TaskTemplate volumes. + * @member {Array.} volumes + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + TaskTemplate.prototype.volumes = $util.emptyArray; + + /** + * TaskTemplate maxRetries. + * @member {number|null|undefined} maxRetries + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + TaskTemplate.prototype.maxRetries = null; + + /** + * TaskTemplate timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + TaskTemplate.prototype.timeout = null; + + /** + * TaskTemplate serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + TaskTemplate.prototype.serviceAccount = ""; + + /** + * TaskTemplate executionEnvironment. + * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + TaskTemplate.prototype.executionEnvironment = 0; + + /** + * TaskTemplate encryptionKey. + * @member {string} encryptionKey + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + TaskTemplate.prototype.encryptionKey = ""; + + /** + * TaskTemplate vpcAccess. + * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + TaskTemplate.prototype.vpcAccess = null; + + /** + * TaskTemplate nodeSelector. + * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + TaskTemplate.prototype.nodeSelector = null; + + /** + * TaskTemplate gpuZonalRedundancyDisabled. + * @member {boolean|null|undefined} gpuZonalRedundancyDisabled + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + TaskTemplate.prototype.gpuZonalRedundancyDisabled = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TaskTemplate retries. + * @member {"maxRetries"|undefined} retries + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + */ + Object.defineProperty(TaskTemplate.prototype, "retries", { + get: $util.oneOfGetter($oneOfFields = ["maxRetries"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TaskTemplate.prototype, "_gpuZonalRedundancyDisabled", { + get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TaskTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.TaskTemplate + * @static + * @param {google.cloud.run.v2.ITaskTemplate=} [properties] Properties to set + * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate instance + */ + TaskTemplate.create = function create(properties) { + return new TaskTemplate(properties); + }; + + /** + * Encodes the specified TaskTemplate message. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.TaskTemplate + * @static + * @param {google.cloud.run.v2.ITaskTemplate} message TaskTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxRetries != null && Object.hasOwnProperty.call(message, "maxRetries")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxRetries); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.executionEnvironment); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.encryptionKey); + if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) + $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) + $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.gpuZonalRedundancyDisabled); + return writer; + }; + + /** + * Encodes the specified TaskTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.TaskTemplate + * @static + * @param {google.cloud.run.v2.ITaskTemplate} message TaskTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.TaskTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskTemplate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TaskTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); + break; + } + case 3: { + message.maxRetries = reader.int32(); + break; + } + case 4: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.serviceAccount = reader.string(); + break; + } + case 6: { + message.executionEnvironment = reader.int32(); + break; + } + case 7: { + message.encryptionKey = reader.string(); + break; + } + case 8: { + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); + break; + } + case 11: { + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); + break; + } + case 12: { + message.gpuZonalRedundancyDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.TaskTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskTemplate message. + * @function verify + * @memberof google.cloud.run.v2.TaskTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + 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.run.v2.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) { + properties.retries = 1; + if (!$util.isInteger(message.maxRetries)) + return "maxRetries: integer expected"; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) + switch (message.executionEnvironment) { + default: + return "executionEnvironment: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + if (!$util.isString(message.encryptionKey)) + return "encryptionKey: string expected"; + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { + var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); + if (error) + return "vpcAccess." + error; + } + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { + var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); + if (error) + return "nodeSelector." + error; + } + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + properties._gpuZonalRedundancyDisabled = 1; + if (typeof message.gpuZonalRedundancyDisabled !== "boolean") + return "gpuZonalRedundancyDisabled: boolean expected"; + } + return null; + }; + + /** + * Creates a TaskTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.TaskTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate + */ + TaskTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.TaskTemplate) + return object; + var message = new $root.google.cloud.run.v2.TaskTemplate(); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.run.v2.TaskTemplate.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.run.v2.TaskTemplate.containers: object expected"); + message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); + } + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.run.v2.TaskTemplate.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.run.v2.TaskTemplate.volumes: object expected"); + message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); + } + } + if (object.maxRetries != null) + message.maxRetries = object.maxRetries | 0; + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.run.v2.TaskTemplate.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + switch (object.executionEnvironment) { + default: + if (typeof object.executionEnvironment === "number") { + message.executionEnvironment = object.executionEnvironment; + break; + } + break; + case "EXECUTION_ENVIRONMENT_UNSPECIFIED": + case 0: + message.executionEnvironment = 0; + break; + case "EXECUTION_ENVIRONMENT_GEN1": + case 1: + message.executionEnvironment = 1; + break; + case "EXECUTION_ENVIRONMENT_GEN2": + case 2: + message.executionEnvironment = 2; + break; + } + if (object.encryptionKey != null) + message.encryptionKey = String(object.encryptionKey); + if (object.vpcAccess != null) { + if (typeof object.vpcAccess !== "object") + throw TypeError(".google.cloud.run.v2.TaskTemplate.vpcAccess: object expected"); + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); + } + if (object.nodeSelector != null) { + if (typeof object.nodeSelector !== "object") + throw TypeError(".google.cloud.run.v2.TaskTemplate.nodeSelector: object expected"); + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); + } + if (object.gpuZonalRedundancyDisabled != null) + message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); + return message; + }; + + /** + * Creates a plain object from a TaskTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.TaskTemplate + * @static + * @param {google.cloud.run.v2.TaskTemplate} message TaskTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.containers = []; + object.volumes = []; + } + if (options.defaults) { + object.timeout = null; + object.serviceAccount = ""; + object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; + object.encryptionKey = ""; + object.vpcAccess = null; + object.nodeSelector = null; + } + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); + } + if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) { + object.maxRetries = message.maxRetries; + if (options.oneofs) + object.retries = "maxRetries"; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) + object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = message.encryptionKey; + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) + object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) + object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; + if (options.oneofs) + object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; + } + return object; + }; + + /** + * Converts this TaskTemplate to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.TaskTemplate + * @instance + * @returns {Object.} JSON object + */ + TaskTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskTemplate + * @function getTypeUrl + * @memberof google.cloud.run.v2.TaskTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.TaskTemplate"; + }; + + return TaskTemplate; + })(); + + v2.Container = (function() { + + /** + * Properties of a Container. + * @memberof google.cloud.run.v2 + * @interface IContainer + * @property {string|null} [name] Container name + * @property {string|null} [image] Container image + * @property {google.cloud.run.v2.ISourceCode|null} [sourceCode] Container sourceCode + * @property {Array.|null} [command] Container command + * @property {Array.|null} [args] Container args + * @property {Array.|null} [env] Container env + * @property {google.cloud.run.v2.IResourceRequirements|null} [resources] Container resources + * @property {Array.|null} [ports] Container ports + * @property {Array.|null} [volumeMounts] Container volumeMounts + * @property {string|null} [workingDir] Container workingDir + * @property {google.cloud.run.v2.IProbe|null} [livenessProbe] Container livenessProbe + * @property {google.cloud.run.v2.IProbe|null} [startupProbe] Container startupProbe + * @property {google.cloud.run.v2.IProbe|null} [readinessProbe] Container readinessProbe + * @property {Array.|null} [dependsOn] Container dependsOn + * @property {string|null} [baseImageUri] Container baseImageUri + * @property {google.cloud.run.v2.IBuildInfo|null} [buildInfo] Container buildInfo + */ + + /** + * Constructs a new Container. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Container. + * @implements IContainer + * @constructor + * @param {google.cloud.run.v2.IContainer=} [properties] Properties to set + */ + function Container(properties) { + this.command = []; + this.args = []; + this.env = []; + this.ports = []; + this.volumeMounts = []; + this.dependsOn = []; + if (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 name. + * @member {string} name + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.name = ""; + + /** + * Container image. + * @member {string} image + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.image = ""; + + /** + * Container sourceCode. + * @member {google.cloud.run.v2.ISourceCode|null|undefined} sourceCode + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.sourceCode = null; + + /** + * Container command. + * @member {Array.} command + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.command = $util.emptyArray; + + /** + * Container args. + * @member {Array.} args + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.args = $util.emptyArray; + + /** + * Container env. + * @member {Array.} env + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.env = $util.emptyArray; + + /** + * Container resources. + * @member {google.cloud.run.v2.IResourceRequirements|null|undefined} resources + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.resources = null; + + /** + * Container ports. + * @member {Array.} ports + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.ports = $util.emptyArray; + + /** + * Container volumeMounts. + * @member {Array.} volumeMounts + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.volumeMounts = $util.emptyArray; + + /** + * Container workingDir. + * @member {string} workingDir + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.workingDir = ""; + + /** + * Container livenessProbe. + * @member {google.cloud.run.v2.IProbe|null|undefined} livenessProbe + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.livenessProbe = null; + + /** + * Container startupProbe. + * @member {google.cloud.run.v2.IProbe|null|undefined} startupProbe + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.startupProbe = null; + + /** + * Container readinessProbe. + * @member {google.cloud.run.v2.IProbe|null|undefined} readinessProbe + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.readinessProbe = null; + + /** + * Container dependsOn. + * @member {Array.} dependsOn + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.dependsOn = $util.emptyArray; + + /** + * Container baseImageUri. + * @member {string} baseImageUri + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.baseImageUri = ""; + + /** + * Container buildInfo. + * @member {google.cloud.run.v2.IBuildInfo|null|undefined} buildInfo + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.buildInfo = null; + + /** + * Creates a new Container instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Container + * @static + * @param {google.cloud.run.v2.IContainer=} [properties] Properties to set + * @returns {google.cloud.run.v2.Container} Container instance + */ + Container.create = function create(properties) { + return new Container(properties); + }; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.run.v2.Container.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Container + * @static + * @param {google.cloud.run.v2.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.image); + if (message.command != null && message.command.length) + for (var i = 0; i < message.command.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.command[i]); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.args[i]); + if (message.env != null && message.env.length) + for (var i = 0; i < message.env.length; ++i) + $root.google.cloud.run.v2.EnvVar.encode(message.env[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.resources != null && Object.hasOwnProperty.call(message, "resources")) + $root.google.cloud.run.v2.ResourceRequirements.encode(message.resources, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ports != null && message.ports.length) + for (var i = 0; i < message.ports.length; ++i) + $root.google.cloud.run.v2.ContainerPort.encode(message.ports[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.volumeMounts != null && message.volumeMounts.length) + for (var i = 0; i < message.volumeMounts.length; ++i) + $root.google.cloud.run.v2.VolumeMount.encode(message.volumeMounts[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.workingDir != null && Object.hasOwnProperty.call(message, "workingDir")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.workingDir); + if (message.livenessProbe != null && Object.hasOwnProperty.call(message, "livenessProbe")) + $root.google.cloud.run.v2.Probe.encode(message.livenessProbe, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.startupProbe != null && Object.hasOwnProperty.call(message, "startupProbe")) + $root.google.cloud.run.v2.Probe.encode(message.startupProbe, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.dependsOn != null && message.dependsOn.length) + for (var i = 0; i < message.dependsOn.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.dependsOn[i]); + if (message.baseImageUri != null && Object.hasOwnProperty.call(message, "baseImageUri")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.baseImageUri); + if (message.readinessProbe != null && Object.hasOwnProperty.call(message, "readinessProbe")) + $root.google.cloud.run.v2.Probe.encode(message.readinessProbe, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.buildInfo != null && Object.hasOwnProperty.call(message, "buildInfo")) + $root.google.cloud.run.v2.BuildInfo.encode(message.buildInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sourceCode != null && Object.hasOwnProperty.call(message, "sourceCode")) + $root.google.cloud.run.v2.SourceCode.encode(message.sourceCode, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.run.v2.Container.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Container + * @static + * @param {google.cloud.run.v2.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.run.v2.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Container(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.image = reader.string(); + break; + } + case 17: { + message.sourceCode = $root.google.cloud.run.v2.SourceCode.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.command && message.command.length)) + message.command = []; + message.command.push(reader.string()); + break; + } + case 4: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 5: { + if (!(message.env && message.env.length)) + message.env = []; + message.env.push($root.google.cloud.run.v2.EnvVar.decode(reader, reader.uint32())); + break; + } + case 6: { + message.resources = $root.google.cloud.run.v2.ResourceRequirements.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.ports && message.ports.length)) + message.ports = []; + message.ports.push($root.google.cloud.run.v2.ContainerPort.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.volumeMounts && message.volumeMounts.length)) + message.volumeMounts = []; + message.volumeMounts.push($root.google.cloud.run.v2.VolumeMount.decode(reader, reader.uint32())); + break; + } + case 9: { + message.workingDir = reader.string(); + break; + } + case 10: { + message.livenessProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); + break; + } + case 11: { + message.startupProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); + break; + } + case 14: { + message.readinessProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.dependsOn && message.dependsOn.length)) + message.dependsOn = []; + message.dependsOn.push(reader.string()); + break; + } + case 13: { + message.baseImageUri = reader.string(); + break; + } + case 15: { + message.buildInfo = $root.google.cloud.run.v2.BuildInfo.decode(reader, reader.uint32()); + 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.run.v2.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + if (message.sourceCode != null && message.hasOwnProperty("sourceCode")) { + var error = $root.google.cloud.run.v2.SourceCode.verify(message.sourceCode); + if (error) + return "sourceCode." + error; + } + if (message.command != null && message.hasOwnProperty("command")) { + if (!Array.isArray(message.command)) + return "command: array expected"; + for (var i = 0; i < message.command.length; ++i) + if (!$util.isString(message.command[i])) + return "command: string[] expected"; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) + if (!$util.isString(message.args[i])) + return "args: string[] expected"; + } + if (message.env != null && message.hasOwnProperty("env")) { + if (!Array.isArray(message.env)) + return "env: array expected"; + for (var i = 0; i < message.env.length; ++i) { + var error = $root.google.cloud.run.v2.EnvVar.verify(message.env[i]); + if (error) + return "env." + error; + } + } + if (message.resources != null && message.hasOwnProperty("resources")) { + var error = $root.google.cloud.run.v2.ResourceRequirements.verify(message.resources); + if (error) + return "resources." + error; + } + if (message.ports != null && message.hasOwnProperty("ports")) { + if (!Array.isArray(message.ports)) + return "ports: array expected"; + for (var i = 0; i < message.ports.length; ++i) { + var error = $root.google.cloud.run.v2.ContainerPort.verify(message.ports[i]); + if (error) + return "ports." + error; + } + } + if (message.volumeMounts != null && message.hasOwnProperty("volumeMounts")) { + if (!Array.isArray(message.volumeMounts)) + return "volumeMounts: array expected"; + for (var i = 0; i < message.volumeMounts.length; ++i) { + var error = $root.google.cloud.run.v2.VolumeMount.verify(message.volumeMounts[i]); + if (error) + return "volumeMounts." + error; + } + } + if (message.workingDir != null && message.hasOwnProperty("workingDir")) + if (!$util.isString(message.workingDir)) + return "workingDir: string expected"; + if (message.livenessProbe != null && message.hasOwnProperty("livenessProbe")) { + var error = $root.google.cloud.run.v2.Probe.verify(message.livenessProbe); + if (error) + return "livenessProbe." + error; + } + if (message.startupProbe != null && message.hasOwnProperty("startupProbe")) { + var error = $root.google.cloud.run.v2.Probe.verify(message.startupProbe); + if (error) + return "startupProbe." + error; + } + if (message.readinessProbe != null && message.hasOwnProperty("readinessProbe")) { + var error = $root.google.cloud.run.v2.Probe.verify(message.readinessProbe); + if (error) + return "readinessProbe." + error; + } + if (message.dependsOn != null && message.hasOwnProperty("dependsOn")) { + if (!Array.isArray(message.dependsOn)) + return "dependsOn: array expected"; + for (var i = 0; i < message.dependsOn.length; ++i) + if (!$util.isString(message.dependsOn[i])) + return "dependsOn: string[] expected"; + } + if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) + if (!$util.isString(message.baseImageUri)) + return "baseImageUri: string expected"; + if (message.buildInfo != null && message.hasOwnProperty("buildInfo")) { + var error = $root.google.cloud.run.v2.BuildInfo.verify(message.buildInfo); + if (error) + return "buildInfo." + error; + } + return null; + }; + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Container + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Container} Container + */ + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Container) + return object; + var message = new $root.google.cloud.run.v2.Container(); + if (object.name != null) + message.name = String(object.name); + if (object.image != null) + message.image = String(object.image); + if (object.sourceCode != null) { + if (typeof object.sourceCode !== "object") + throw TypeError(".google.cloud.run.v2.Container.sourceCode: object expected"); + message.sourceCode = $root.google.cloud.run.v2.SourceCode.fromObject(object.sourceCode); + } + if (object.command) { + if (!Array.isArray(object.command)) + throw TypeError(".google.cloud.run.v2.Container.command: array expected"); + message.command = []; + for (var i = 0; i < object.command.length; ++i) + message.command[i] = String(object.command[i]); + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.run.v2.Container.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.env) { + if (!Array.isArray(object.env)) + throw TypeError(".google.cloud.run.v2.Container.env: array expected"); + message.env = []; + for (var i = 0; i < object.env.length; ++i) { + if (typeof object.env[i] !== "object") + throw TypeError(".google.cloud.run.v2.Container.env: object expected"); + message.env[i] = $root.google.cloud.run.v2.EnvVar.fromObject(object.env[i]); + } + } + if (object.resources != null) { + if (typeof object.resources !== "object") + throw TypeError(".google.cloud.run.v2.Container.resources: object expected"); + message.resources = $root.google.cloud.run.v2.ResourceRequirements.fromObject(object.resources); + } + if (object.ports) { + if (!Array.isArray(object.ports)) + throw TypeError(".google.cloud.run.v2.Container.ports: array expected"); + message.ports = []; + for (var i = 0; i < object.ports.length; ++i) { + if (typeof object.ports[i] !== "object") + throw TypeError(".google.cloud.run.v2.Container.ports: object expected"); + message.ports[i] = $root.google.cloud.run.v2.ContainerPort.fromObject(object.ports[i]); + } + } + if (object.volumeMounts) { + if (!Array.isArray(object.volumeMounts)) + throw TypeError(".google.cloud.run.v2.Container.volumeMounts: array expected"); + message.volumeMounts = []; + for (var i = 0; i < object.volumeMounts.length; ++i) { + if (typeof object.volumeMounts[i] !== "object") + throw TypeError(".google.cloud.run.v2.Container.volumeMounts: object expected"); + message.volumeMounts[i] = $root.google.cloud.run.v2.VolumeMount.fromObject(object.volumeMounts[i]); + } + } + if (object.workingDir != null) + message.workingDir = String(object.workingDir); + if (object.livenessProbe != null) { + if (typeof object.livenessProbe !== "object") + throw TypeError(".google.cloud.run.v2.Container.livenessProbe: object expected"); + message.livenessProbe = $root.google.cloud.run.v2.Probe.fromObject(object.livenessProbe); + } + if (object.startupProbe != null) { + if (typeof object.startupProbe !== "object") + throw TypeError(".google.cloud.run.v2.Container.startupProbe: object expected"); + message.startupProbe = $root.google.cloud.run.v2.Probe.fromObject(object.startupProbe); + } + if (object.readinessProbe != null) { + if (typeof object.readinessProbe !== "object") + throw TypeError(".google.cloud.run.v2.Container.readinessProbe: object expected"); + message.readinessProbe = $root.google.cloud.run.v2.Probe.fromObject(object.readinessProbe); + } + if (object.dependsOn) { + if (!Array.isArray(object.dependsOn)) + throw TypeError(".google.cloud.run.v2.Container.dependsOn: array expected"); + message.dependsOn = []; + for (var i = 0; i < object.dependsOn.length; ++i) + message.dependsOn[i] = String(object.dependsOn[i]); + } + if (object.baseImageUri != null) + message.baseImageUri = String(object.baseImageUri); + if (object.buildInfo != null) { + if (typeof object.buildInfo !== "object") + throw TypeError(".google.cloud.run.v2.Container.buildInfo: object expected"); + message.buildInfo = $root.google.cloud.run.v2.BuildInfo.fromObject(object.buildInfo); + } + return message; + }; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Container + * @static + * @param {google.cloud.run.v2.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.command = []; + object.args = []; + object.env = []; + object.ports = []; + object.volumeMounts = []; + object.dependsOn = []; + } + if (options.defaults) { + object.name = ""; + object.image = ""; + object.resources = null; + object.workingDir = ""; + object.livenessProbe = null; + object.startupProbe = null; + object.baseImageUri = ""; + object.readinessProbe = null; + object.buildInfo = null; + object.sourceCode = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + if (message.command && message.command.length) { + object.command = []; + for (var j = 0; j < message.command.length; ++j) + object.command[j] = message.command[j]; + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = message.args[j]; + } + if (message.env && message.env.length) { + object.env = []; + for (var j = 0; j < message.env.length; ++j) + object.env[j] = $root.google.cloud.run.v2.EnvVar.toObject(message.env[j], options); + } + if (message.resources != null && message.hasOwnProperty("resources")) + object.resources = $root.google.cloud.run.v2.ResourceRequirements.toObject(message.resources, options); + if (message.ports && message.ports.length) { + object.ports = []; + for (var j = 0; j < message.ports.length; ++j) + object.ports[j] = $root.google.cloud.run.v2.ContainerPort.toObject(message.ports[j], options); + } + if (message.volumeMounts && message.volumeMounts.length) { + object.volumeMounts = []; + for (var j = 0; j < message.volumeMounts.length; ++j) + object.volumeMounts[j] = $root.google.cloud.run.v2.VolumeMount.toObject(message.volumeMounts[j], options); + } + if (message.workingDir != null && message.hasOwnProperty("workingDir")) + object.workingDir = message.workingDir; + if (message.livenessProbe != null && message.hasOwnProperty("livenessProbe")) + object.livenessProbe = $root.google.cloud.run.v2.Probe.toObject(message.livenessProbe, options); + if (message.startupProbe != null && message.hasOwnProperty("startupProbe")) + object.startupProbe = $root.google.cloud.run.v2.Probe.toObject(message.startupProbe, options); + if (message.dependsOn && message.dependsOn.length) { + object.dependsOn = []; + for (var j = 0; j < message.dependsOn.length; ++j) + object.dependsOn[j] = message.dependsOn[j]; + } + if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) + object.baseImageUri = message.baseImageUri; + if (message.readinessProbe != null && message.hasOwnProperty("readinessProbe")) + object.readinessProbe = $root.google.cloud.run.v2.Probe.toObject(message.readinessProbe, options); + if (message.buildInfo != null && message.hasOwnProperty("buildInfo")) + object.buildInfo = $root.google.cloud.run.v2.BuildInfo.toObject(message.buildInfo, options); + if (message.sourceCode != null && message.hasOwnProperty("sourceCode")) + object.sourceCode = $root.google.cloud.run.v2.SourceCode.toObject(message.sourceCode, options); + return object; + }; + + /** + * Converts this Container to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Container"; + }; + + return Container; + })(); + + v2.ResourceRequirements = (function() { + + /** + * Properties of a ResourceRequirements. + * @memberof google.cloud.run.v2 + * @interface IResourceRequirements + * @property {Object.|null} [limits] ResourceRequirements limits + * @property {boolean|null} [cpuIdle] ResourceRequirements cpuIdle + * @property {boolean|null} [startupCpuBoost] ResourceRequirements startupCpuBoost + */ + + /** + * Constructs a new ResourceRequirements. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ResourceRequirements. + * @implements IResourceRequirements + * @constructor + * @param {google.cloud.run.v2.IResourceRequirements=} [properties] Properties to set + */ + function ResourceRequirements(properties) { + this.limits = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceRequirements limits. + * @member {Object.} limits + * @memberof google.cloud.run.v2.ResourceRequirements + * @instance + */ + ResourceRequirements.prototype.limits = $util.emptyObject; + + /** + * ResourceRequirements cpuIdle. + * @member {boolean} cpuIdle + * @memberof google.cloud.run.v2.ResourceRequirements + * @instance + */ + ResourceRequirements.prototype.cpuIdle = false; + + /** + * ResourceRequirements startupCpuBoost. + * @member {boolean} startupCpuBoost + * @memberof google.cloud.run.v2.ResourceRequirements + * @instance + */ + ResourceRequirements.prototype.startupCpuBoost = false; + + /** + * Creates a new ResourceRequirements instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ResourceRequirements + * @static + * @param {google.cloud.run.v2.IResourceRequirements=} [properties] Properties to set + * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements instance + */ + ResourceRequirements.create = function create(properties) { + return new ResourceRequirements(properties); + }; + + /** + * Encodes the specified ResourceRequirements message. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ResourceRequirements + * @static + * @param {google.cloud.run.v2.IResourceRequirements} message ResourceRequirements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceRequirements.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.limits != null && Object.hasOwnProperty.call(message, "limits")) + for (var keys = Object.keys(message.limits), 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.limits[keys[i]]).ldelim(); + if (message.cpuIdle != null && Object.hasOwnProperty.call(message, "cpuIdle")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.cpuIdle); + if (message.startupCpuBoost != null && Object.hasOwnProperty.call(message, "startupCpuBoost")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.startupCpuBoost); + return writer; + }; + + /** + * Encodes the specified ResourceRequirements message, length delimited. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ResourceRequirements + * @static + * @param {google.cloud.run.v2.IResourceRequirements} message ResourceRequirements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceRequirements.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceRequirements message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ResourceRequirements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceRequirements.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ResourceRequirements(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.limits === $util.emptyObject) + message.limits = {}; + 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.limits[key] = value; + break; + } + case 2: { + message.cpuIdle = reader.bool(); + break; + } + case 3: { + message.startupCpuBoost = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceRequirements message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ResourceRequirements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceRequirements.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceRequirements message. + * @function verify + * @memberof google.cloud.run.v2.ResourceRequirements + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceRequirements.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.limits != null && message.hasOwnProperty("limits")) { + if (!$util.isObject(message.limits)) + return "limits: object expected"; + var key = Object.keys(message.limits); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.limits[key[i]])) + return "limits: string{k:string} expected"; + } + if (message.cpuIdle != null && message.hasOwnProperty("cpuIdle")) + if (typeof message.cpuIdle !== "boolean") + return "cpuIdle: boolean expected"; + if (message.startupCpuBoost != null && message.hasOwnProperty("startupCpuBoost")) + if (typeof message.startupCpuBoost !== "boolean") + return "startupCpuBoost: boolean expected"; + return null; + }; + + /** + * Creates a ResourceRequirements message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ResourceRequirements + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements + */ + ResourceRequirements.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ResourceRequirements) + return object; + var message = new $root.google.cloud.run.v2.ResourceRequirements(); + if (object.limits) { + if (typeof object.limits !== "object") + throw TypeError(".google.cloud.run.v2.ResourceRequirements.limits: object expected"); + message.limits = {}; + for (var keys = Object.keys(object.limits), i = 0; i < keys.length; ++i) + message.limits[keys[i]] = String(object.limits[keys[i]]); + } + if (object.cpuIdle != null) + message.cpuIdle = Boolean(object.cpuIdle); + if (object.startupCpuBoost != null) + message.startupCpuBoost = Boolean(object.startupCpuBoost); + return message; + }; + + /** + * Creates a plain object from a ResourceRequirements message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ResourceRequirements + * @static + * @param {google.cloud.run.v2.ResourceRequirements} message ResourceRequirements + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceRequirements.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.limits = {}; + if (options.defaults) { + object.cpuIdle = false; + object.startupCpuBoost = false; + } + var keys2; + if (message.limits && (keys2 = Object.keys(message.limits)).length) { + object.limits = {}; + for (var j = 0; j < keys2.length; ++j) + object.limits[keys2[j]] = message.limits[keys2[j]]; + } + if (message.cpuIdle != null && message.hasOwnProperty("cpuIdle")) + object.cpuIdle = message.cpuIdle; + if (message.startupCpuBoost != null && message.hasOwnProperty("startupCpuBoost")) + object.startupCpuBoost = message.startupCpuBoost; + return object; + }; + + /** + * Converts this ResourceRequirements to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ResourceRequirements + * @instance + * @returns {Object.} JSON object + */ + ResourceRequirements.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceRequirements + * @function getTypeUrl + * @memberof google.cloud.run.v2.ResourceRequirements + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceRequirements.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ResourceRequirements"; + }; + + return ResourceRequirements; + })(); + + v2.EnvVar = (function() { + + /** + * Properties of an EnvVar. + * @memberof google.cloud.run.v2 + * @interface IEnvVar + * @property {string|null} [name] EnvVar name + * @property {string|null} [value] EnvVar value + * @property {google.cloud.run.v2.IEnvVarSource|null} [valueSource] EnvVar valueSource + */ + + /** + * Constructs a new EnvVar. + * @memberof google.cloud.run.v2 + * @classdesc Represents an EnvVar. + * @implements IEnvVar + * @constructor + * @param {google.cloud.run.v2.IEnvVar=} [properties] Properties to set + */ + function EnvVar(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnvVar name. + * @member {string} name + * @memberof google.cloud.run.v2.EnvVar + * @instance + */ + EnvVar.prototype.name = ""; + + /** + * EnvVar value. + * @member {string|null|undefined} value + * @memberof google.cloud.run.v2.EnvVar + * @instance + */ + EnvVar.prototype.value = null; + + /** + * EnvVar valueSource. + * @member {google.cloud.run.v2.IEnvVarSource|null|undefined} valueSource + * @memberof google.cloud.run.v2.EnvVar + * @instance + */ + EnvVar.prototype.valueSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EnvVar values. + * @member {"value"|"valueSource"|undefined} values + * @memberof google.cloud.run.v2.EnvVar + * @instance + */ + Object.defineProperty(EnvVar.prototype, "values", { + get: $util.oneOfGetter($oneOfFields = ["value", "valueSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EnvVar instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.EnvVar + * @static + * @param {google.cloud.run.v2.IEnvVar=} [properties] Properties to set + * @returns {google.cloud.run.v2.EnvVar} EnvVar instance + */ + EnvVar.create = function create(properties) { + return new EnvVar(properties); + }; + + /** + * Encodes the specified EnvVar message. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.EnvVar + * @static + * @param {google.cloud.run.v2.IEnvVar} message EnvVar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvVar.encode = function encode(message, writer) { + if (!writer) + 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 && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.valueSource != null && Object.hasOwnProperty.call(message, "valueSource")) + $root.google.cloud.run.v2.EnvVarSource.encode(message.valueSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnvVar message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.EnvVar + * @static + * @param {google.cloud.run.v2.IEnvVar} message EnvVar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvVar.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnvVar message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.EnvVar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.EnvVar} EnvVar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvVar.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.EnvVar(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + case 3: { + message.valueSource = $root.google.cloud.run.v2.EnvVarSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnvVar message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.EnvVar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.EnvVar} EnvVar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvVar.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnvVar message. + * @function verify + * @memberof google.cloud.run.v2.EnvVar + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnvVar.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.value != null && message.hasOwnProperty("value")) { + properties.values = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + if (message.valueSource != null && message.hasOwnProperty("valueSource")) { + if (properties.values === 1) + return "values: multiple values"; + properties.values = 1; + { + var error = $root.google.cloud.run.v2.EnvVarSource.verify(message.valueSource); + if (error) + return "valueSource." + error; + } + } + return null; + }; + + /** + * Creates an EnvVar message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.EnvVar + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.EnvVar} EnvVar + */ + EnvVar.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.EnvVar) + return object; + var message = new $root.google.cloud.run.v2.EnvVar(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + if (object.valueSource != null) { + if (typeof object.valueSource !== "object") + throw TypeError(".google.cloud.run.v2.EnvVar.valueSource: object expected"); + message.valueSource = $root.google.cloud.run.v2.EnvVarSource.fromObject(object.valueSource); + } + return message; + }; + + /** + * Creates a plain object from an EnvVar message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.EnvVar + * @static + * @param {google.cloud.run.v2.EnvVar} message EnvVar + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnvVar.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object.values = "value"; + } + if (message.valueSource != null && message.hasOwnProperty("valueSource")) { + object.valueSource = $root.google.cloud.run.v2.EnvVarSource.toObject(message.valueSource, options); + if (options.oneofs) + object.values = "valueSource"; + } + return object; + }; + + /** + * Converts this EnvVar to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.EnvVar + * @instance + * @returns {Object.} JSON object + */ + EnvVar.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnvVar + * @function getTypeUrl + * @memberof google.cloud.run.v2.EnvVar + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnvVar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.EnvVar"; + }; + + return EnvVar; + })(); + + v2.EnvVarSource = (function() { + + /** + * Properties of an EnvVarSource. + * @memberof google.cloud.run.v2 + * @interface IEnvVarSource + * @property {google.cloud.run.v2.ISecretKeySelector|null} [secretKeyRef] EnvVarSource secretKeyRef + */ + + /** + * Constructs a new EnvVarSource. + * @memberof google.cloud.run.v2 + * @classdesc Represents an EnvVarSource. + * @implements IEnvVarSource + * @constructor + * @param {google.cloud.run.v2.IEnvVarSource=} [properties] Properties to set + */ + function EnvVarSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnvVarSource secretKeyRef. + * @member {google.cloud.run.v2.ISecretKeySelector|null|undefined} secretKeyRef + * @memberof google.cloud.run.v2.EnvVarSource + * @instance + */ + EnvVarSource.prototype.secretKeyRef = null; + + /** + * Creates a new EnvVarSource instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.EnvVarSource + * @static + * @param {google.cloud.run.v2.IEnvVarSource=} [properties] Properties to set + * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource instance + */ + EnvVarSource.create = function create(properties) { + return new EnvVarSource(properties); + }; + + /** + * Encodes the specified EnvVarSource message. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.EnvVarSource + * @static + * @param {google.cloud.run.v2.IEnvVarSource} message EnvVarSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvVarSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secretKeyRef != null && Object.hasOwnProperty.call(message, "secretKeyRef")) + $root.google.cloud.run.v2.SecretKeySelector.encode(message.secretKeyRef, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnvVarSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.EnvVarSource + * @static + * @param {google.cloud.run.v2.IEnvVarSource} message EnvVarSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvVarSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnvVarSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.EnvVarSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvVarSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.EnvVarSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.secretKeyRef = $root.google.cloud.run.v2.SecretKeySelector.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnvVarSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.EnvVarSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvVarSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnvVarSource message. + * @function verify + * @memberof google.cloud.run.v2.EnvVarSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnvVarSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secretKeyRef != null && message.hasOwnProperty("secretKeyRef")) { + var error = $root.google.cloud.run.v2.SecretKeySelector.verify(message.secretKeyRef); + if (error) + return "secretKeyRef." + error; + } + return null; + }; + + /** + * Creates an EnvVarSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.EnvVarSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource + */ + EnvVarSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.EnvVarSource) + return object; + var message = new $root.google.cloud.run.v2.EnvVarSource(); + if (object.secretKeyRef != null) { + if (typeof object.secretKeyRef !== "object") + throw TypeError(".google.cloud.run.v2.EnvVarSource.secretKeyRef: object expected"); + message.secretKeyRef = $root.google.cloud.run.v2.SecretKeySelector.fromObject(object.secretKeyRef); + } + return message; + }; + + /** + * Creates a plain object from an EnvVarSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.EnvVarSource + * @static + * @param {google.cloud.run.v2.EnvVarSource} message EnvVarSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnvVarSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.secretKeyRef = null; + if (message.secretKeyRef != null && message.hasOwnProperty("secretKeyRef")) + object.secretKeyRef = $root.google.cloud.run.v2.SecretKeySelector.toObject(message.secretKeyRef, options); + return object; + }; + + /** + * Converts this EnvVarSource to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.EnvVarSource + * @instance + * @returns {Object.} JSON object + */ + EnvVarSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnvVarSource + * @function getTypeUrl + * @memberof google.cloud.run.v2.EnvVarSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnvVarSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.EnvVarSource"; + }; + + return EnvVarSource; + })(); + + v2.SecretKeySelector = (function() { + + /** + * Properties of a SecretKeySelector. + * @memberof google.cloud.run.v2 + * @interface ISecretKeySelector + * @property {string|null} [secret] SecretKeySelector secret + * @property {string|null} [version] SecretKeySelector version + */ + + /** + * Constructs a new SecretKeySelector. + * @memberof google.cloud.run.v2 + * @classdesc Represents a SecretKeySelector. + * @implements ISecretKeySelector + * @constructor + * @param {google.cloud.run.v2.ISecretKeySelector=} [properties] Properties to set + */ + function SecretKeySelector(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecretKeySelector secret. + * @member {string} secret + * @memberof google.cloud.run.v2.SecretKeySelector + * @instance + */ + SecretKeySelector.prototype.secret = ""; + + /** + * SecretKeySelector version. + * @member {string} version + * @memberof google.cloud.run.v2.SecretKeySelector + * @instance + */ + SecretKeySelector.prototype.version = ""; + + /** + * Creates a new SecretKeySelector instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.SecretKeySelector + * @static + * @param {google.cloud.run.v2.ISecretKeySelector=} [properties] Properties to set + * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector instance + */ + SecretKeySelector.create = function create(properties) { + return new SecretKeySelector(properties); + }; + + /** + * Encodes the specified SecretKeySelector message. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.SecretKeySelector + * @static + * @param {google.cloud.run.v2.ISecretKeySelector} message SecretKeySelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretKeySelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secret); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified SecretKeySelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.SecretKeySelector + * @static + * @param {google.cloud.run.v2.ISecretKeySelector} message SecretKeySelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretKeySelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecretKeySelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.SecretKeySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretKeySelector.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SecretKeySelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.secret = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecretKeySelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.SecretKeySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretKeySelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecretKeySelector message. + * @function verify + * @memberof google.cloud.run.v2.SecretKeySelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecretKeySelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secret != null && message.hasOwnProperty("secret")) + if (!$util.isString(message.secret)) + return "secret: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a SecretKeySelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.SecretKeySelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector + */ + SecretKeySelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.SecretKeySelector) + return object; + var message = new $root.google.cloud.run.v2.SecretKeySelector(); + if (object.secret != null) + message.secret = String(object.secret); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a SecretKeySelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.SecretKeySelector + * @static + * @param {google.cloud.run.v2.SecretKeySelector} message SecretKeySelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecretKeySelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.secret = ""; + object.version = ""; + } + if (message.secret != null && message.hasOwnProperty("secret")) + object.secret = message.secret; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this SecretKeySelector to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.SecretKeySelector + * @instance + * @returns {Object.} JSON object + */ + SecretKeySelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecretKeySelector + * @function getTypeUrl + * @memberof google.cloud.run.v2.SecretKeySelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecretKeySelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.SecretKeySelector"; + }; + + return SecretKeySelector; + })(); + + v2.ContainerPort = (function() { + + /** + * Properties of a ContainerPort. + * @memberof google.cloud.run.v2 + * @interface IContainerPort + * @property {string|null} [name] ContainerPort name + * @property {number|null} [containerPort] ContainerPort containerPort + */ + + /** + * Constructs a new ContainerPort. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ContainerPort. + * @implements IContainerPort + * @constructor + * @param {google.cloud.run.v2.IContainerPort=} [properties] Properties to set + */ + function ContainerPort(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContainerPort name. + * @member {string} name + * @memberof google.cloud.run.v2.ContainerPort + * @instance + */ + ContainerPort.prototype.name = ""; + + /** + * ContainerPort containerPort. + * @member {number} containerPort + * @memberof google.cloud.run.v2.ContainerPort + * @instance + */ + ContainerPort.prototype.containerPort = 0; + + /** + * Creates a new ContainerPort instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ContainerPort + * @static + * @param {google.cloud.run.v2.IContainerPort=} [properties] Properties to set + * @returns {google.cloud.run.v2.ContainerPort} ContainerPort instance + */ + ContainerPort.create = function create(properties) { + return new ContainerPort(properties); + }; + + /** + * Encodes the specified ContainerPort message. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ContainerPort + * @static + * @param {google.cloud.run.v2.IContainerPort} message ContainerPort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerPort.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.containerPort != null && Object.hasOwnProperty.call(message, "containerPort")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.containerPort); + return writer; + }; + + /** + * Encodes the specified ContainerPort message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ContainerPort + * @static + * @param {google.cloud.run.v2.IContainerPort} message ContainerPort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerPort.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContainerPort message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ContainerPort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ContainerPort} ContainerPort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerPort.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ContainerPort(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.containerPort = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContainerPort message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ContainerPort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ContainerPort} ContainerPort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerPort.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContainerPort message. + * @function verify + * @memberof google.cloud.run.v2.ContainerPort + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContainerPort.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.containerPort != null && message.hasOwnProperty("containerPort")) + if (!$util.isInteger(message.containerPort)) + return "containerPort: integer expected"; + return null; + }; + + /** + * Creates a ContainerPort message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ContainerPort + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ContainerPort} ContainerPort + */ + ContainerPort.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ContainerPort) + return object; + var message = new $root.google.cloud.run.v2.ContainerPort(); + if (object.name != null) + message.name = String(object.name); + if (object.containerPort != null) + message.containerPort = object.containerPort | 0; + return message; + }; + + /** + * Creates a plain object from a ContainerPort message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ContainerPort + * @static + * @param {google.cloud.run.v2.ContainerPort} message ContainerPort + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContainerPort.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.containerPort = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.containerPort != null && message.hasOwnProperty("containerPort")) + object.containerPort = message.containerPort; + return object; + }; + + /** + * Converts this ContainerPort to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ContainerPort + * @instance + * @returns {Object.} JSON object + */ + ContainerPort.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContainerPort + * @function getTypeUrl + * @memberof google.cloud.run.v2.ContainerPort + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContainerPort.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ContainerPort"; + }; + + return ContainerPort; + })(); + + v2.VolumeMount = (function() { + + /** + * Properties of a VolumeMount. + * @memberof google.cloud.run.v2 + * @interface IVolumeMount + * @property {string|null} [name] VolumeMount name + * @property {string|null} [mountPath] VolumeMount mountPath + * @property {string|null} [subPath] VolumeMount subPath + */ + + /** + * Constructs a new VolumeMount. + * @memberof google.cloud.run.v2 + * @classdesc Represents a VolumeMount. + * @implements IVolumeMount + * @constructor + * @param {google.cloud.run.v2.IVolumeMount=} [properties] Properties to set + */ + function VolumeMount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VolumeMount name. + * @member {string} name + * @memberof google.cloud.run.v2.VolumeMount + * @instance + */ + VolumeMount.prototype.name = ""; + + /** + * VolumeMount mountPath. + * @member {string} mountPath + * @memberof google.cloud.run.v2.VolumeMount + * @instance + */ + VolumeMount.prototype.mountPath = ""; + + /** + * VolumeMount subPath. + * @member {string} subPath + * @memberof google.cloud.run.v2.VolumeMount + * @instance + */ + VolumeMount.prototype.subPath = ""; + + /** + * Creates a new VolumeMount instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.VolumeMount + * @static + * @param {google.cloud.run.v2.IVolumeMount=} [properties] Properties to set + * @returns {google.cloud.run.v2.VolumeMount} VolumeMount instance + */ + VolumeMount.create = function create(properties) { + return new VolumeMount(properties); + }; + + /** + * Encodes the specified VolumeMount message. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.VolumeMount + * @static + * @param {google.cloud.run.v2.IVolumeMount} message VolumeMount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VolumeMount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mountPath); + if (message.subPath != null && Object.hasOwnProperty.call(message, "subPath")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.subPath); + return writer; + }; + + /** + * Encodes the specified VolumeMount message, length delimited. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.VolumeMount + * @static + * @param {google.cloud.run.v2.IVolumeMount} message VolumeMount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VolumeMount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VolumeMount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.VolumeMount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.VolumeMount} VolumeMount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VolumeMount.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VolumeMount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.mountPath = reader.string(); + break; + } + case 4: { + message.subPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VolumeMount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.VolumeMount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.VolumeMount} VolumeMount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VolumeMount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VolumeMount message. + * @function verify + * @memberof google.cloud.run.v2.VolumeMount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VolumeMount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + if (!$util.isString(message.mountPath)) + return "mountPath: string expected"; + if (message.subPath != null && message.hasOwnProperty("subPath")) + if (!$util.isString(message.subPath)) + return "subPath: string expected"; + return null; + }; + + /** + * Creates a VolumeMount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.VolumeMount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.VolumeMount} VolumeMount + */ + VolumeMount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.VolumeMount) + return object; + var message = new $root.google.cloud.run.v2.VolumeMount(); + if (object.name != null) + message.name = String(object.name); + if (object.mountPath != null) + message.mountPath = String(object.mountPath); + if (object.subPath != null) + message.subPath = String(object.subPath); + return message; + }; + + /** + * Creates a plain object from a VolumeMount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.VolumeMount + * @static + * @param {google.cloud.run.v2.VolumeMount} message VolumeMount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VolumeMount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.mountPath = ""; + object.subPath = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + object.mountPath = message.mountPath; + if (message.subPath != null && message.hasOwnProperty("subPath")) + object.subPath = message.subPath; + return object; + }; + + /** + * Converts this VolumeMount to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.VolumeMount + * @instance + * @returns {Object.} JSON object + */ + VolumeMount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VolumeMount + * @function getTypeUrl + * @memberof google.cloud.run.v2.VolumeMount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VolumeMount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.VolumeMount"; + }; + + return VolumeMount; + })(); + + v2.Volume = (function() { + + /** + * Properties of a Volume. + * @memberof google.cloud.run.v2 + * @interface IVolume + * @property {string|null} [name] Volume name + * @property {google.cloud.run.v2.ISecretVolumeSource|null} [secret] Volume secret + * @property {google.cloud.run.v2.ICloudSqlInstance|null} [cloudSqlInstance] Volume cloudSqlInstance + * @property {google.cloud.run.v2.IEmptyDirVolumeSource|null} [emptyDir] Volume emptyDir + * @property {google.cloud.run.v2.INFSVolumeSource|null} [nfs] Volume nfs + * @property {google.cloud.run.v2.IGCSVolumeSource|null} [gcs] Volume gcs + */ + + /** + * Constructs a new Volume. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Volume. + * @implements IVolume + * @constructor + * @param {google.cloud.run.v2.IVolume=} [properties] Properties to set + */ + function Volume(properties) { + if (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 name. + * @member {string} name + * @memberof google.cloud.run.v2.Volume + * @instance + */ + Volume.prototype.name = ""; + + /** + * Volume secret. + * @member {google.cloud.run.v2.ISecretVolumeSource|null|undefined} secret + * @memberof google.cloud.run.v2.Volume + * @instance + */ + Volume.prototype.secret = null; + + /** + * Volume cloudSqlInstance. + * @member {google.cloud.run.v2.ICloudSqlInstance|null|undefined} cloudSqlInstance + * @memberof google.cloud.run.v2.Volume + * @instance + */ + Volume.prototype.cloudSqlInstance = null; + + /** + * Volume emptyDir. + * @member {google.cloud.run.v2.IEmptyDirVolumeSource|null|undefined} emptyDir + * @memberof google.cloud.run.v2.Volume + * @instance + */ + Volume.prototype.emptyDir = null; + + /** + * Volume nfs. + * @member {google.cloud.run.v2.INFSVolumeSource|null|undefined} nfs + * @memberof google.cloud.run.v2.Volume + * @instance + */ + Volume.prototype.nfs = null; + + /** + * Volume gcs. + * @member {google.cloud.run.v2.IGCSVolumeSource|null|undefined} gcs + * @memberof google.cloud.run.v2.Volume + * @instance + */ + Volume.prototype.gcs = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Volume volumeType. + * @member {"secret"|"cloudSqlInstance"|"emptyDir"|"nfs"|"gcs"|undefined} volumeType + * @memberof google.cloud.run.v2.Volume + * @instance + */ + Object.defineProperty(Volume.prototype, "volumeType", { + get: $util.oneOfGetter($oneOfFields = ["secret", "cloudSqlInstance", "emptyDir", "nfs", "gcs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Volume instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Volume + * @static + * @param {google.cloud.run.v2.IVolume=} [properties] Properties to set + * @returns {google.cloud.run.v2.Volume} Volume instance + */ + Volume.create = function create(properties) { + return new Volume(properties); + }; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.cloud.run.v2.Volume.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Volume + * @static + * @param {google.cloud.run.v2.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + $root.google.cloud.run.v2.SecretVolumeSource.encode(message.secret, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cloudSqlInstance != null && Object.hasOwnProperty.call(message, "cloudSqlInstance")) + $root.google.cloud.run.v2.CloudSqlInstance.encode(message.cloudSqlInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.emptyDir != null && Object.hasOwnProperty.call(message, "emptyDir")) + $root.google.cloud.run.v2.EmptyDirVolumeSource.encode(message.emptyDir, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) + $root.google.cloud.run.v2.NFSVolumeSource.encode(message.nfs, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) + $root.google.cloud.run.v2.GCSVolumeSource.encode(message.gcs, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.run.v2.Volume.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Volume + * @static + * @param {google.cloud.run.v2.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.run.v2.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Volume(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.secret = $root.google.cloud.run.v2.SecretVolumeSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.decode(reader, reader.uint32()); + break; + } + case 5: { + message.nfs = $root.google.cloud.run.v2.NFSVolumeSource.decode(reader, reader.uint32()); + break; + } + case 6: { + message.gcs = $root.google.cloud.run.v2.GCSVolumeSource.decode(reader, reader.uint32()); + 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.run.v2.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.secret != null && message.hasOwnProperty("secret")) { + properties.volumeType = 1; + { + var error = $root.google.cloud.run.v2.SecretVolumeSource.verify(message.secret); + if (error) + return "secret." + error; + } + } + if (message.cloudSqlInstance != null && message.hasOwnProperty("cloudSqlInstance")) { + if (properties.volumeType === 1) + return "volumeType: multiple values"; + properties.volumeType = 1; + { + var error = $root.google.cloud.run.v2.CloudSqlInstance.verify(message.cloudSqlInstance); + if (error) + return "cloudSqlInstance." + error; + } + } + if (message.emptyDir != null && message.hasOwnProperty("emptyDir")) { + if (properties.volumeType === 1) + return "volumeType: multiple values"; + properties.volumeType = 1; + { + var error = $root.google.cloud.run.v2.EmptyDirVolumeSource.verify(message.emptyDir); + if (error) + return "emptyDir." + error; + } + } + if (message.nfs != null && message.hasOwnProperty("nfs")) { + if (properties.volumeType === 1) + return "volumeType: multiple values"; + properties.volumeType = 1; + { + var error = $root.google.cloud.run.v2.NFSVolumeSource.verify(message.nfs); + if (error) + return "nfs." + error; + } + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + if (properties.volumeType === 1) + return "volumeType: multiple values"; + properties.volumeType = 1; + { + var error = $root.google.cloud.run.v2.GCSVolumeSource.verify(message.gcs); + if (error) + return "gcs." + error; + } + } + return null; + }; + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Volume + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Volume} Volume + */ + Volume.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Volume) + return object; + var message = new $root.google.cloud.run.v2.Volume(); + if (object.name != null) + message.name = String(object.name); + if (object.secret != null) { + if (typeof object.secret !== "object") + throw TypeError(".google.cloud.run.v2.Volume.secret: object expected"); + message.secret = $root.google.cloud.run.v2.SecretVolumeSource.fromObject(object.secret); + } + if (object.cloudSqlInstance != null) { + if (typeof object.cloudSqlInstance !== "object") + throw TypeError(".google.cloud.run.v2.Volume.cloudSqlInstance: object expected"); + message.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.fromObject(object.cloudSqlInstance); + } + if (object.emptyDir != null) { + if (typeof object.emptyDir !== "object") + throw TypeError(".google.cloud.run.v2.Volume.emptyDir: object expected"); + message.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.fromObject(object.emptyDir); + } + if (object.nfs != null) { + if (typeof object.nfs !== "object") + throw TypeError(".google.cloud.run.v2.Volume.nfs: object expected"); + message.nfs = $root.google.cloud.run.v2.NFSVolumeSource.fromObject(object.nfs); + } + if (object.gcs != null) { + if (typeof object.gcs !== "object") + throw TypeError(".google.cloud.run.v2.Volume.gcs: object expected"); + message.gcs = $root.google.cloud.run.v2.GCSVolumeSource.fromObject(object.gcs); + } + return message; + }; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Volume + * @static + * @param {google.cloud.run.v2.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.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.secret != null && message.hasOwnProperty("secret")) { + object.secret = $root.google.cloud.run.v2.SecretVolumeSource.toObject(message.secret, options); + if (options.oneofs) + object.volumeType = "secret"; + } + if (message.cloudSqlInstance != null && message.hasOwnProperty("cloudSqlInstance")) { + object.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.toObject(message.cloudSqlInstance, options); + if (options.oneofs) + object.volumeType = "cloudSqlInstance"; + } + if (message.emptyDir != null && message.hasOwnProperty("emptyDir")) { + object.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.toObject(message.emptyDir, options); + if (options.oneofs) + object.volumeType = "emptyDir"; + } + if (message.nfs != null && message.hasOwnProperty("nfs")) { + object.nfs = $root.google.cloud.run.v2.NFSVolumeSource.toObject(message.nfs, options); + if (options.oneofs) + object.volumeType = "nfs"; + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + object.gcs = $root.google.cloud.run.v2.GCSVolumeSource.toObject(message.gcs, options); + if (options.oneofs) + object.volumeType = "gcs"; + } + return object; + }; + + /** + * Converts this Volume to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Volume"; + }; + + return Volume; + })(); + + v2.SecretVolumeSource = (function() { + + /** + * Properties of a SecretVolumeSource. + * @memberof google.cloud.run.v2 + * @interface ISecretVolumeSource + * @property {string|null} [secret] SecretVolumeSource secret + * @property {Array.|null} [items] SecretVolumeSource items + * @property {number|null} [defaultMode] SecretVolumeSource defaultMode + */ + + /** + * Constructs a new SecretVolumeSource. + * @memberof google.cloud.run.v2 + * @classdesc Represents a SecretVolumeSource. + * @implements ISecretVolumeSource + * @constructor + * @param {google.cloud.run.v2.ISecretVolumeSource=} [properties] Properties to set + */ + function SecretVolumeSource(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]]; + } + + /** + * SecretVolumeSource secret. + * @member {string} secret + * @memberof google.cloud.run.v2.SecretVolumeSource + * @instance + */ + SecretVolumeSource.prototype.secret = ""; + + /** + * SecretVolumeSource items. + * @member {Array.} items + * @memberof google.cloud.run.v2.SecretVolumeSource + * @instance + */ + SecretVolumeSource.prototype.items = $util.emptyArray; + + /** + * SecretVolumeSource defaultMode. + * @member {number} defaultMode + * @memberof google.cloud.run.v2.SecretVolumeSource + * @instance + */ + SecretVolumeSource.prototype.defaultMode = 0; + + /** + * Creates a new SecretVolumeSource instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.SecretVolumeSource + * @static + * @param {google.cloud.run.v2.ISecretVolumeSource=} [properties] Properties to set + * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource instance + */ + SecretVolumeSource.create = function create(properties) { + return new SecretVolumeSource(properties); + }; + + /** + * Encodes the specified SecretVolumeSource message. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.SecretVolumeSource + * @static + * @param {google.cloud.run.v2.ISecretVolumeSource} message SecretVolumeSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretVolumeSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secret); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.run.v2.VersionToPath.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.defaultMode != null && Object.hasOwnProperty.call(message, "defaultMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.defaultMode); + return writer; + }; + + /** + * Encodes the specified SecretVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.SecretVolumeSource + * @static + * @param {google.cloud.run.v2.ISecretVolumeSource} message SecretVolumeSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecretVolumeSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.SecretVolumeSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretVolumeSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SecretVolumeSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.secret = reader.string(); + break; + } + case 2: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.run.v2.VersionToPath.decode(reader, reader.uint32())); + break; + } + case 3: { + message.defaultMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecretVolumeSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.SecretVolumeSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretVolumeSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecretVolumeSource message. + * @function verify + * @memberof google.cloud.run.v2.SecretVolumeSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecretVolumeSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secret != null && message.hasOwnProperty("secret")) + if (!$util.isString(message.secret)) + return "secret: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.run.v2.VersionToPath.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.defaultMode != null && message.hasOwnProperty("defaultMode")) + if (!$util.isInteger(message.defaultMode)) + return "defaultMode: integer expected"; + return null; + }; + + /** + * Creates a SecretVolumeSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.SecretVolumeSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource + */ + SecretVolumeSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.SecretVolumeSource) + return object; + var message = new $root.google.cloud.run.v2.SecretVolumeSource(); + if (object.secret != null) + message.secret = String(object.secret); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.run.v2.SecretVolumeSource.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.run.v2.SecretVolumeSource.items: object expected"); + message.items[i] = $root.google.cloud.run.v2.VersionToPath.fromObject(object.items[i]); + } + } + if (object.defaultMode != null) + message.defaultMode = object.defaultMode | 0; + return message; + }; + + /** + * Creates a plain object from a SecretVolumeSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.SecretVolumeSource + * @static + * @param {google.cloud.run.v2.SecretVolumeSource} message SecretVolumeSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecretVolumeSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) { + object.secret = ""; + object.defaultMode = 0; + } + if (message.secret != null && message.hasOwnProperty("secret")) + object.secret = message.secret; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.run.v2.VersionToPath.toObject(message.items[j], options); + } + if (message.defaultMode != null && message.hasOwnProperty("defaultMode")) + object.defaultMode = message.defaultMode; + return object; + }; + + /** + * Converts this SecretVolumeSource to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.SecretVolumeSource + * @instance + * @returns {Object.} JSON object + */ + SecretVolumeSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecretVolumeSource + * @function getTypeUrl + * @memberof google.cloud.run.v2.SecretVolumeSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecretVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.SecretVolumeSource"; + }; + + return SecretVolumeSource; + })(); + + v2.VersionToPath = (function() { + + /** + * Properties of a VersionToPath. + * @memberof google.cloud.run.v2 + * @interface IVersionToPath + * @property {string|null} [path] VersionToPath path + * @property {string|null} [version] VersionToPath version + * @property {number|null} [mode] VersionToPath mode + */ + + /** + * Constructs a new VersionToPath. + * @memberof google.cloud.run.v2 + * @classdesc Represents a VersionToPath. + * @implements IVersionToPath + * @constructor + * @param {google.cloud.run.v2.IVersionToPath=} [properties] Properties to set + */ + function VersionToPath(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VersionToPath path. + * @member {string} path + * @memberof google.cloud.run.v2.VersionToPath + * @instance + */ + VersionToPath.prototype.path = ""; + + /** + * VersionToPath version. + * @member {string} version + * @memberof google.cloud.run.v2.VersionToPath + * @instance + */ + VersionToPath.prototype.version = ""; + + /** + * VersionToPath mode. + * @member {number} mode + * @memberof google.cloud.run.v2.VersionToPath + * @instance + */ + VersionToPath.prototype.mode = 0; + + /** + * Creates a new VersionToPath instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.VersionToPath + * @static + * @param {google.cloud.run.v2.IVersionToPath=} [properties] Properties to set + * @returns {google.cloud.run.v2.VersionToPath} VersionToPath instance + */ + VersionToPath.create = function create(properties) { + return new VersionToPath(properties); + }; + + /** + * Encodes the specified VersionToPath message. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.VersionToPath + * @static + * @param {google.cloud.run.v2.IVersionToPath} message VersionToPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionToPath.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.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mode); + return writer; + }; + + /** + * Encodes the specified VersionToPath message, length delimited. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.VersionToPath + * @static + * @param {google.cloud.run.v2.IVersionToPath} message VersionToPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionToPath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionToPath message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.VersionToPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.VersionToPath} VersionToPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionToPath.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VersionToPath(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + message.mode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionToPath message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.VersionToPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.VersionToPath} VersionToPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionToPath.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionToPath message. + * @function verify + * @memberof google.cloud.run.v2.VersionToPath + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionToPath.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + if (!$util.isInteger(message.mode)) + return "mode: integer expected"; + return null; + }; + + /** + * Creates a VersionToPath message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.VersionToPath + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.VersionToPath} VersionToPath + */ + VersionToPath.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.VersionToPath) + return object; + var message = new $root.google.cloud.run.v2.VersionToPath(); + if (object.path != null) + message.path = String(object.path); + if (object.version != null) + message.version = String(object.version); + if (object.mode != null) + message.mode = object.mode | 0; + return message; + }; + + /** + * Creates a plain object from a VersionToPath message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.VersionToPath + * @static + * @param {google.cloud.run.v2.VersionToPath} message VersionToPath + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionToPath.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.path = ""; + object.version = ""; + object.mode = 0; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = message.mode; + return object; + }; + + /** + * Converts this VersionToPath to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.VersionToPath + * @instance + * @returns {Object.} JSON object + */ + VersionToPath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionToPath + * @function getTypeUrl + * @memberof google.cloud.run.v2.VersionToPath + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionToPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.VersionToPath"; + }; + + return VersionToPath; + })(); + + v2.CloudSqlInstance = (function() { + + /** + * Properties of a CloudSqlInstance. + * @memberof google.cloud.run.v2 + * @interface ICloudSqlInstance + * @property {Array.|null} [instances] CloudSqlInstance instances + */ + + /** + * Constructs a new CloudSqlInstance. + * @memberof google.cloud.run.v2 + * @classdesc Represents a CloudSqlInstance. + * @implements ICloudSqlInstance + * @constructor + * @param {google.cloud.run.v2.ICloudSqlInstance=} [properties] Properties to set + */ + function CloudSqlInstance(properties) { + 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]]; + } + + /** + * CloudSqlInstance instances. + * @member {Array.} instances + * @memberof google.cloud.run.v2.CloudSqlInstance + * @instance + */ + CloudSqlInstance.prototype.instances = $util.emptyArray; + + /** + * Creates a new CloudSqlInstance instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.CloudSqlInstance + * @static + * @param {google.cloud.run.v2.ICloudSqlInstance=} [properties] Properties to set + * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance instance + */ + CloudSqlInstance.create = function create(properties) { + return new CloudSqlInstance(properties); + }; + + /** + * Encodes the specified CloudSqlInstance message. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.CloudSqlInstance + * @static + * @param {google.cloud.run.v2.ICloudSqlInstance} message CloudSqlInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instances[i]); + return writer; + }; + + /** + * Encodes the specified CloudSqlInstance message, length delimited. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.CloudSqlInstance + * @static + * @param {google.cloud.run.v2.ICloudSqlInstance} message CloudSqlInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSqlInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.CloudSqlInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CloudSqlInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSqlInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.CloudSqlInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSqlInstance message. + * @function verify + * @memberof google.cloud.run.v2.CloudSqlInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSqlInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + return null; + }; + + /** + * Creates a CloudSqlInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.CloudSqlInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance + */ + CloudSqlInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.CloudSqlInstance) + return object; + var message = new $root.google.cloud.run.v2.CloudSqlInstance(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.run.v2.CloudSqlInstance.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + return message; + }; + + /** + * Creates a plain object from a CloudSqlInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.CloudSqlInstance + * @static + * @param {google.cloud.run.v2.CloudSqlInstance} message CloudSqlInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSqlInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + return object; + }; + + /** + * Converts this CloudSqlInstance to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.CloudSqlInstance + * @instance + * @returns {Object.} JSON object + */ + CloudSqlInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSqlInstance + * @function getTypeUrl + * @memberof google.cloud.run.v2.CloudSqlInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSqlInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.CloudSqlInstance"; + }; + + return CloudSqlInstance; + })(); + + v2.EmptyDirVolumeSource = (function() { + + /** + * Properties of an EmptyDirVolumeSource. + * @memberof google.cloud.run.v2 + * @interface IEmptyDirVolumeSource + * @property {google.cloud.run.v2.EmptyDirVolumeSource.Medium|null} [medium] EmptyDirVolumeSource medium + * @property {string|null} [sizeLimit] EmptyDirVolumeSource sizeLimit + */ + + /** + * Constructs a new EmptyDirVolumeSource. + * @memberof google.cloud.run.v2 + * @classdesc Represents an EmptyDirVolumeSource. + * @implements IEmptyDirVolumeSource + * @constructor + * @param {google.cloud.run.v2.IEmptyDirVolumeSource=} [properties] Properties to set + */ + function EmptyDirVolumeSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmptyDirVolumeSource medium. + * @member {google.cloud.run.v2.EmptyDirVolumeSource.Medium} medium + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @instance + */ + EmptyDirVolumeSource.prototype.medium = 0; + + /** + * EmptyDirVolumeSource sizeLimit. + * @member {string} sizeLimit + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @instance + */ + EmptyDirVolumeSource.prototype.sizeLimit = ""; + + /** + * Creates a new EmptyDirVolumeSource instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {google.cloud.run.v2.IEmptyDirVolumeSource=} [properties] Properties to set + * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource instance + */ + EmptyDirVolumeSource.create = function create(properties) { + return new EmptyDirVolumeSource(properties); + }; + + /** + * Encodes the specified EmptyDirVolumeSource message. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {google.cloud.run.v2.IEmptyDirVolumeSource} message EmptyDirVolumeSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmptyDirVolumeSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.medium != null && Object.hasOwnProperty.call(message, "medium")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.medium); + if (message.sizeLimit != null && Object.hasOwnProperty.call(message, "sizeLimit")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sizeLimit); + return writer; + }; + + /** + * Encodes the specified EmptyDirVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {google.cloud.run.v2.IEmptyDirVolumeSource} message EmptyDirVolumeSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmptyDirVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmptyDirVolumeSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmptyDirVolumeSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.EmptyDirVolumeSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.medium = reader.int32(); + break; + } + case 2: { + message.sizeLimit = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmptyDirVolumeSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmptyDirVolumeSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmptyDirVolumeSource message. + * @function verify + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmptyDirVolumeSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.medium != null && message.hasOwnProperty("medium")) + switch (message.medium) { + default: + return "medium: enum value expected"; + case 0: + case 1: + break; + } + if (message.sizeLimit != null && message.hasOwnProperty("sizeLimit")) + if (!$util.isString(message.sizeLimit)) + return "sizeLimit: string expected"; + return null; + }; + + /** + * Creates an EmptyDirVolumeSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource + */ + EmptyDirVolumeSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.EmptyDirVolumeSource) + return object; + var message = new $root.google.cloud.run.v2.EmptyDirVolumeSource(); + switch (object.medium) { + default: + if (typeof object.medium === "number") { + message.medium = object.medium; + break; + } + break; + case "MEDIUM_UNSPECIFIED": + case 0: + message.medium = 0; + break; + case "MEMORY": + case 1: + message.medium = 1; + break; + } + if (object.sizeLimit != null) + message.sizeLimit = String(object.sizeLimit); + return message; + }; + + /** + * Creates a plain object from an EmptyDirVolumeSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {google.cloud.run.v2.EmptyDirVolumeSource} message EmptyDirVolumeSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmptyDirVolumeSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.medium = options.enums === String ? "MEDIUM_UNSPECIFIED" : 0; + object.sizeLimit = ""; + } + if (message.medium != null && message.hasOwnProperty("medium")) + object.medium = options.enums === String ? $root.google.cloud.run.v2.EmptyDirVolumeSource.Medium[message.medium] === undefined ? message.medium : $root.google.cloud.run.v2.EmptyDirVolumeSource.Medium[message.medium] : message.medium; + if (message.sizeLimit != null && message.hasOwnProperty("sizeLimit")) + object.sizeLimit = message.sizeLimit; + return object; + }; + + /** + * Converts this EmptyDirVolumeSource to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @instance + * @returns {Object.} JSON object + */ + EmptyDirVolumeSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmptyDirVolumeSource + * @function getTypeUrl + * @memberof google.cloud.run.v2.EmptyDirVolumeSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmptyDirVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.EmptyDirVolumeSource"; + }; + + /** + * Medium enum. + * @name google.cloud.run.v2.EmptyDirVolumeSource.Medium + * @enum {number} + * @property {number} MEDIUM_UNSPECIFIED=0 MEDIUM_UNSPECIFIED value + * @property {number} MEMORY=1 MEMORY value + */ + EmptyDirVolumeSource.Medium = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEDIUM_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEMORY"] = 1; + return values; + })(); + + return EmptyDirVolumeSource; + })(); + + v2.NFSVolumeSource = (function() { + + /** + * Properties of a NFSVolumeSource. + * @memberof google.cloud.run.v2 + * @interface INFSVolumeSource + * @property {string|null} [server] NFSVolumeSource server + * @property {string|null} [path] NFSVolumeSource path + * @property {boolean|null} [readOnly] NFSVolumeSource readOnly + */ + + /** + * Constructs a new NFSVolumeSource. + * @memberof google.cloud.run.v2 + * @classdesc Represents a NFSVolumeSource. + * @implements INFSVolumeSource + * @constructor + * @param {google.cloud.run.v2.INFSVolumeSource=} [properties] Properties to set + */ + function NFSVolumeSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NFSVolumeSource server. + * @member {string} server + * @memberof google.cloud.run.v2.NFSVolumeSource + * @instance + */ + NFSVolumeSource.prototype.server = ""; + + /** + * NFSVolumeSource path. + * @member {string} path + * @memberof google.cloud.run.v2.NFSVolumeSource + * @instance + */ + NFSVolumeSource.prototype.path = ""; + + /** + * NFSVolumeSource readOnly. + * @member {boolean} readOnly + * @memberof google.cloud.run.v2.NFSVolumeSource + * @instance + */ + NFSVolumeSource.prototype.readOnly = false; + + /** + * Creates a new NFSVolumeSource instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.NFSVolumeSource + * @static + * @param {google.cloud.run.v2.INFSVolumeSource=} [properties] Properties to set + * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource instance + */ + NFSVolumeSource.create = function create(properties) { + return new NFSVolumeSource(properties); + }; + + /** + * Encodes the specified NFSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.NFSVolumeSource + * @static + * @param {google.cloud.run.v2.INFSVolumeSource} message NFSVolumeSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NFSVolumeSource.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.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.readOnly); + return writer; + }; + + /** + * Encodes the specified NFSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.NFSVolumeSource + * @static + * @param {google.cloud.run.v2.INFSVolumeSource} message NFSVolumeSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NFSVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NFSVolumeSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.NFSVolumeSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NFSVolumeSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.NFSVolumeSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.server = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + case 3: { + message.readOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NFSVolumeSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.NFSVolumeSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NFSVolumeSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NFSVolumeSource message. + * @function verify + * @memberof google.cloud.run.v2.NFSVolumeSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NFSVolumeSource.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.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.readOnly != null && message.hasOwnProperty("readOnly")) + if (typeof message.readOnly !== "boolean") + return "readOnly: boolean expected"; + return null; + }; + + /** + * Creates a NFSVolumeSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.NFSVolumeSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource + */ + NFSVolumeSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.NFSVolumeSource) + return object; + var message = new $root.google.cloud.run.v2.NFSVolumeSource(); + if (object.server != null) + message.server = String(object.server); + if (object.path != null) + message.path = String(object.path); + if (object.readOnly != null) + message.readOnly = Boolean(object.readOnly); + return message; + }; + + /** + * Creates a plain object from a NFSVolumeSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.NFSVolumeSource + * @static + * @param {google.cloud.run.v2.NFSVolumeSource} message NFSVolumeSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NFSVolumeSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.server = ""; + object.path = ""; + object.readOnly = false; + } + if (message.server != null && message.hasOwnProperty("server")) + object.server = message.server; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.readOnly != null && message.hasOwnProperty("readOnly")) + object.readOnly = message.readOnly; + return object; + }; + + /** + * Converts this NFSVolumeSource to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.NFSVolumeSource + * @instance + * @returns {Object.} JSON object + */ + NFSVolumeSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NFSVolumeSource + * @function getTypeUrl + * @memberof google.cloud.run.v2.NFSVolumeSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NFSVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.NFSVolumeSource"; + }; + + return NFSVolumeSource; + })(); + + v2.GCSVolumeSource = (function() { + + /** + * Properties of a GCSVolumeSource. + * @memberof google.cloud.run.v2 + * @interface IGCSVolumeSource + * @property {string|null} [bucket] GCSVolumeSource bucket + * @property {boolean|null} [readOnly] GCSVolumeSource readOnly + * @property {Array.|null} [mountOptions] GCSVolumeSource mountOptions + */ + + /** + * Constructs a new GCSVolumeSource. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GCSVolumeSource. + * @implements IGCSVolumeSource + * @constructor + * @param {google.cloud.run.v2.IGCSVolumeSource=} [properties] Properties to set + */ + function GCSVolumeSource(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]]; + } + + /** + * GCSVolumeSource bucket. + * @member {string} bucket + * @memberof google.cloud.run.v2.GCSVolumeSource + * @instance + */ + GCSVolumeSource.prototype.bucket = ""; + + /** + * GCSVolumeSource readOnly. + * @member {boolean} readOnly + * @memberof google.cloud.run.v2.GCSVolumeSource + * @instance + */ + GCSVolumeSource.prototype.readOnly = false; + + /** + * GCSVolumeSource mountOptions. + * @member {Array.} mountOptions + * @memberof google.cloud.run.v2.GCSVolumeSource + * @instance + */ + GCSVolumeSource.prototype.mountOptions = $util.emptyArray; + + /** + * Creates a new GCSVolumeSource instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GCSVolumeSource + * @static + * @param {google.cloud.run.v2.IGCSVolumeSource=} [properties] Properties to set + * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource instance + */ + GCSVolumeSource.create = function create(properties) { + return new GCSVolumeSource(properties); + }; + + /** + * Encodes the specified GCSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GCSVolumeSource + * @static + * @param {google.cloud.run.v2.IGCSVolumeSource} message GCSVolumeSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCSVolumeSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.readOnly); + if (message.mountOptions != null && message.mountOptions.length) + for (var i = 0; i < message.mountOptions.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mountOptions[i]); + return writer; + }; + + /** + * Encodes the specified GCSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GCSVolumeSource + * @static + * @param {google.cloud.run.v2.IGCSVolumeSource} message GCSVolumeSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCSVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCSVolumeSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.GCSVolumeSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCSVolumeSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GCSVolumeSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.readOnly = reader.bool(); + break; + } + case 3: { + if (!(message.mountOptions && message.mountOptions.length)) + message.mountOptions = []; + message.mountOptions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCSVolumeSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GCSVolumeSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCSVolumeSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCSVolumeSource message. + * @function verify + * @memberof google.cloud.run.v2.GCSVolumeSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCSVolumeSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.readOnly != null && message.hasOwnProperty("readOnly")) + if (typeof message.readOnly !== "boolean") + return "readOnly: boolean 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 GCSVolumeSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.GCSVolumeSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource + */ + GCSVolumeSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GCSVolumeSource) + return object; + var message = new $root.google.cloud.run.v2.GCSVolumeSource(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.readOnly != null) + message.readOnly = Boolean(object.readOnly); + if (object.mountOptions) { + if (!Array.isArray(object.mountOptions)) + throw TypeError(".google.cloud.run.v2.GCSVolumeSource.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 GCSVolumeSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.GCSVolumeSource + * @static + * @param {google.cloud.run.v2.GCSVolumeSource} message GCSVolumeSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCSVolumeSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mountOptions = []; + if (options.defaults) { + object.bucket = ""; + object.readOnly = false; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.readOnly != null && message.hasOwnProperty("readOnly")) + object.readOnly = message.readOnly; + if (message.mountOptions && message.mountOptions.length) { + object.mountOptions = []; + for (var j = 0; j < message.mountOptions.length; ++j) + object.mountOptions[j] = message.mountOptions[j]; + } + return object; + }; + + /** + * Converts this GCSVolumeSource to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.GCSVolumeSource + * @instance + * @returns {Object.} JSON object + */ + GCSVolumeSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCSVolumeSource + * @function getTypeUrl + * @memberof google.cloud.run.v2.GCSVolumeSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCSVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.GCSVolumeSource"; + }; + + return GCSVolumeSource; + })(); + + v2.Probe = (function() { + + /** + * Properties of a Probe. + * @memberof google.cloud.run.v2 + * @interface IProbe + * @property {number|null} [initialDelaySeconds] Probe initialDelaySeconds + * @property {number|null} [timeoutSeconds] Probe timeoutSeconds + * @property {number|null} [periodSeconds] Probe periodSeconds + * @property {number|null} [failureThreshold] Probe failureThreshold + * @property {google.cloud.run.v2.IHTTPGetAction|null} [httpGet] Probe httpGet + * @property {google.cloud.run.v2.ITCPSocketAction|null} [tcpSocket] Probe tcpSocket + * @property {google.cloud.run.v2.IGRPCAction|null} [grpc] Probe grpc + */ + + /** + * Constructs a new Probe. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Probe. + * @implements IProbe + * @constructor + * @param {google.cloud.run.v2.IProbe=} [properties] Properties to set + */ + function Probe(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Probe initialDelaySeconds. + * @member {number} initialDelaySeconds + * @memberof google.cloud.run.v2.Probe + * @instance + */ + Probe.prototype.initialDelaySeconds = 0; + + /** + * Probe timeoutSeconds. + * @member {number} timeoutSeconds + * @memberof google.cloud.run.v2.Probe + * @instance + */ + Probe.prototype.timeoutSeconds = 0; + + /** + * Probe periodSeconds. + * @member {number} periodSeconds + * @memberof google.cloud.run.v2.Probe + * @instance + */ + Probe.prototype.periodSeconds = 0; + + /** + * Probe failureThreshold. + * @member {number} failureThreshold + * @memberof google.cloud.run.v2.Probe + * @instance + */ + Probe.prototype.failureThreshold = 0; + + /** + * Probe httpGet. + * @member {google.cloud.run.v2.IHTTPGetAction|null|undefined} httpGet + * @memberof google.cloud.run.v2.Probe + * @instance + */ + Probe.prototype.httpGet = null; + + /** + * Probe tcpSocket. + * @member {google.cloud.run.v2.ITCPSocketAction|null|undefined} tcpSocket + * @memberof google.cloud.run.v2.Probe + * @instance + */ + Probe.prototype.tcpSocket = null; + + /** + * Probe grpc. + * @member {google.cloud.run.v2.IGRPCAction|null|undefined} grpc + * @memberof google.cloud.run.v2.Probe + * @instance + */ + Probe.prototype.grpc = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Probe probeType. + * @member {"httpGet"|"tcpSocket"|"grpc"|undefined} probeType + * @memberof google.cloud.run.v2.Probe + * @instance + */ + Object.defineProperty(Probe.prototype, "probeType", { + get: $util.oneOfGetter($oneOfFields = ["httpGet", "tcpSocket", "grpc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Probe instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Probe + * @static + * @param {google.cloud.run.v2.IProbe=} [properties] Properties to set + * @returns {google.cloud.run.v2.Probe} Probe instance + */ + Probe.create = function create(properties) { + return new Probe(properties); + }; + + /** + * Encodes the specified Probe message. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Probe + * @static + * @param {google.cloud.run.v2.IProbe} message Probe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Probe.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialDelaySeconds != null && Object.hasOwnProperty.call(message, "initialDelaySeconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.initialDelaySeconds); + if (message.timeoutSeconds != null && Object.hasOwnProperty.call(message, "timeoutSeconds")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.timeoutSeconds); + if (message.periodSeconds != null && Object.hasOwnProperty.call(message, "periodSeconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.periodSeconds); + if (message.failureThreshold != null && Object.hasOwnProperty.call(message, "failureThreshold")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureThreshold); + if (message.httpGet != null && Object.hasOwnProperty.call(message, "httpGet")) + $root.google.cloud.run.v2.HTTPGetAction.encode(message.httpGet, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.tcpSocket != null && Object.hasOwnProperty.call(message, "tcpSocket")) + $root.google.cloud.run.v2.TCPSocketAction.encode(message.tcpSocket, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.grpc != null && Object.hasOwnProperty.call(message, "grpc")) + $root.google.cloud.run.v2.GRPCAction.encode(message.grpc, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Probe message, length delimited. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Probe + * @static + * @param {google.cloud.run.v2.IProbe} message Probe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Probe.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Probe message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.Probe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.Probe} Probe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Probe.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Probe(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialDelaySeconds = reader.int32(); + break; + } + case 2: { + message.timeoutSeconds = reader.int32(); + break; + } + case 3: { + message.periodSeconds = reader.int32(); + break; + } + case 4: { + message.failureThreshold = reader.int32(); + break; + } + case 5: { + message.httpGet = $root.google.cloud.run.v2.HTTPGetAction.decode(reader, reader.uint32()); + break; + } + case 6: { + message.tcpSocket = $root.google.cloud.run.v2.TCPSocketAction.decode(reader, reader.uint32()); + break; + } + case 7: { + message.grpc = $root.google.cloud.run.v2.GRPCAction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Probe message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.Probe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.Probe} Probe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Probe.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Probe message. + * @function verify + * @memberof google.cloud.run.v2.Probe + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Probe.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.initialDelaySeconds != null && message.hasOwnProperty("initialDelaySeconds")) + if (!$util.isInteger(message.initialDelaySeconds)) + return "initialDelaySeconds: integer expected"; + if (message.timeoutSeconds != null && message.hasOwnProperty("timeoutSeconds")) + if (!$util.isInteger(message.timeoutSeconds)) + return "timeoutSeconds: integer expected"; + if (message.periodSeconds != null && message.hasOwnProperty("periodSeconds")) + if (!$util.isInteger(message.periodSeconds)) + return "periodSeconds: integer expected"; + if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) + if (!$util.isInteger(message.failureThreshold)) + return "failureThreshold: integer expected"; + if (message.httpGet != null && message.hasOwnProperty("httpGet")) { + properties.probeType = 1; + { + var error = $root.google.cloud.run.v2.HTTPGetAction.verify(message.httpGet); + if (error) + return "httpGet." + error; + } + } + if (message.tcpSocket != null && message.hasOwnProperty("tcpSocket")) { + if (properties.probeType === 1) + return "probeType: multiple values"; + properties.probeType = 1; + { + var error = $root.google.cloud.run.v2.TCPSocketAction.verify(message.tcpSocket); + if (error) + return "tcpSocket." + error; + } + } + if (message.grpc != null && message.hasOwnProperty("grpc")) { + if (properties.probeType === 1) + return "probeType: multiple values"; + properties.probeType = 1; + { + var error = $root.google.cloud.run.v2.GRPCAction.verify(message.grpc); + if (error) + return "grpc." + error; + } + } + return null; + }; + + /** + * Creates a Probe message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Probe + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Probe} Probe + */ + Probe.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Probe) + return object; + var message = new $root.google.cloud.run.v2.Probe(); + if (object.initialDelaySeconds != null) + message.initialDelaySeconds = object.initialDelaySeconds | 0; + if (object.timeoutSeconds != null) + message.timeoutSeconds = object.timeoutSeconds | 0; + if (object.periodSeconds != null) + message.periodSeconds = object.periodSeconds | 0; + if (object.failureThreshold != null) + message.failureThreshold = object.failureThreshold | 0; + if (object.httpGet != null) { + if (typeof object.httpGet !== "object") + throw TypeError(".google.cloud.run.v2.Probe.httpGet: object expected"); + message.httpGet = $root.google.cloud.run.v2.HTTPGetAction.fromObject(object.httpGet); + } + if (object.tcpSocket != null) { + if (typeof object.tcpSocket !== "object") + throw TypeError(".google.cloud.run.v2.Probe.tcpSocket: object expected"); + message.tcpSocket = $root.google.cloud.run.v2.TCPSocketAction.fromObject(object.tcpSocket); + } + if (object.grpc != null) { + if (typeof object.grpc !== "object") + throw TypeError(".google.cloud.run.v2.Probe.grpc: object expected"); + message.grpc = $root.google.cloud.run.v2.GRPCAction.fromObject(object.grpc); + } + return message; + }; + + /** + * Creates a plain object from a Probe message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Probe + * @static + * @param {google.cloud.run.v2.Probe} message Probe + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Probe.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialDelaySeconds = 0; + object.timeoutSeconds = 0; + object.periodSeconds = 0; + object.failureThreshold = 0; + } + if (message.initialDelaySeconds != null && message.hasOwnProperty("initialDelaySeconds")) + object.initialDelaySeconds = message.initialDelaySeconds; + if (message.timeoutSeconds != null && message.hasOwnProperty("timeoutSeconds")) + object.timeoutSeconds = message.timeoutSeconds; + if (message.periodSeconds != null && message.hasOwnProperty("periodSeconds")) + object.periodSeconds = message.periodSeconds; + if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) + object.failureThreshold = message.failureThreshold; + if (message.httpGet != null && message.hasOwnProperty("httpGet")) { + object.httpGet = $root.google.cloud.run.v2.HTTPGetAction.toObject(message.httpGet, options); + if (options.oneofs) + object.probeType = "httpGet"; + } + if (message.tcpSocket != null && message.hasOwnProperty("tcpSocket")) { + object.tcpSocket = $root.google.cloud.run.v2.TCPSocketAction.toObject(message.tcpSocket, options); + if (options.oneofs) + object.probeType = "tcpSocket"; + } + if (message.grpc != null && message.hasOwnProperty("grpc")) { + object.grpc = $root.google.cloud.run.v2.GRPCAction.toObject(message.grpc, options); + if (options.oneofs) + object.probeType = "grpc"; + } + return object; + }; + + /** + * Converts this Probe to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.Probe + * @instance + * @returns {Object.} JSON object + */ + Probe.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Probe + * @function getTypeUrl + * @memberof google.cloud.run.v2.Probe + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Probe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.Probe"; + }; + + return Probe; + })(); + + v2.HTTPGetAction = (function() { + + /** + * Properties of a HTTPGetAction. + * @memberof google.cloud.run.v2 + * @interface IHTTPGetAction + * @property {string|null} [path] HTTPGetAction path + * @property {Array.|null} [httpHeaders] HTTPGetAction httpHeaders + * @property {number|null} [port] HTTPGetAction port + */ + + /** + * Constructs a new HTTPGetAction. + * @memberof google.cloud.run.v2 + * @classdesc Represents a HTTPGetAction. + * @implements IHTTPGetAction + * @constructor + * @param {google.cloud.run.v2.IHTTPGetAction=} [properties] Properties to set + */ + function HTTPGetAction(properties) { + this.httpHeaders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HTTPGetAction path. + * @member {string} path + * @memberof google.cloud.run.v2.HTTPGetAction + * @instance + */ + HTTPGetAction.prototype.path = ""; + + /** + * HTTPGetAction httpHeaders. + * @member {Array.} httpHeaders + * @memberof google.cloud.run.v2.HTTPGetAction + * @instance + */ + HTTPGetAction.prototype.httpHeaders = $util.emptyArray; + + /** + * HTTPGetAction port. + * @member {number} port + * @memberof google.cloud.run.v2.HTTPGetAction + * @instance + */ + HTTPGetAction.prototype.port = 0; + + /** + * Creates a new HTTPGetAction instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.HTTPGetAction + * @static + * @param {google.cloud.run.v2.IHTTPGetAction=} [properties] Properties to set + * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction instance + */ + HTTPGetAction.create = function create(properties) { + return new HTTPGetAction(properties); + }; + + /** + * Encodes the specified HTTPGetAction message. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.HTTPGetAction + * @static + * @param {google.cloud.run.v2.IHTTPGetAction} message HTTPGetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTPGetAction.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.httpHeaders != null && message.httpHeaders.length) + for (var i = 0; i < message.httpHeaders.length; ++i) + $root.google.cloud.run.v2.HTTPHeader.encode(message.httpHeaders[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); + return writer; + }; + + /** + * Encodes the specified HTTPGetAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.HTTPGetAction + * @static + * @param {google.cloud.run.v2.IHTTPGetAction} message HTTPGetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTPGetAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HTTPGetAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.HTTPGetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTPGetAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.HTTPGetAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 4: { + if (!(message.httpHeaders && message.httpHeaders.length)) + message.httpHeaders = []; + message.httpHeaders.push($root.google.cloud.run.v2.HTTPHeader.decode(reader, reader.uint32())); + break; + } + case 5: { + message.port = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HTTPGetAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.HTTPGetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTPGetAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HTTPGetAction message. + * @function verify + * @memberof google.cloud.run.v2.HTTPGetAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HTTPGetAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.httpHeaders != null && message.hasOwnProperty("httpHeaders")) { + if (!Array.isArray(message.httpHeaders)) + return "httpHeaders: array expected"; + for (var i = 0; i < message.httpHeaders.length; ++i) { + var error = $root.google.cloud.run.v2.HTTPHeader.verify(message.httpHeaders[i]); + if (error) + return "httpHeaders." + error; + } + } + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + return null; + }; + + /** + * Creates a HTTPGetAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.HTTPGetAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction + */ + HTTPGetAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.HTTPGetAction) + return object; + var message = new $root.google.cloud.run.v2.HTTPGetAction(); + if (object.path != null) + message.path = String(object.path); + if (object.httpHeaders) { + if (!Array.isArray(object.httpHeaders)) + throw TypeError(".google.cloud.run.v2.HTTPGetAction.httpHeaders: array expected"); + message.httpHeaders = []; + for (var i = 0; i < object.httpHeaders.length; ++i) { + if (typeof object.httpHeaders[i] !== "object") + throw TypeError(".google.cloud.run.v2.HTTPGetAction.httpHeaders: object expected"); + message.httpHeaders[i] = $root.google.cloud.run.v2.HTTPHeader.fromObject(object.httpHeaders[i]); + } + } + if (object.port != null) + message.port = object.port | 0; + return message; + }; + + /** + * Creates a plain object from a HTTPGetAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.HTTPGetAction + * @static + * @param {google.cloud.run.v2.HTTPGetAction} message HTTPGetAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HTTPGetAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.httpHeaders = []; + if (options.defaults) { + object.path = ""; + object.port = 0; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.httpHeaders && message.httpHeaders.length) { + object.httpHeaders = []; + for (var j = 0; j < message.httpHeaders.length; ++j) + object.httpHeaders[j] = $root.google.cloud.run.v2.HTTPHeader.toObject(message.httpHeaders[j], options); + } + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + return object; + }; + + /** + * Converts this HTTPGetAction to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.HTTPGetAction + * @instance + * @returns {Object.} JSON object + */ + HTTPGetAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HTTPGetAction + * @function getTypeUrl + * @memberof google.cloud.run.v2.HTTPGetAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HTTPGetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.HTTPGetAction"; + }; + + return HTTPGetAction; + })(); + + v2.HTTPHeader = (function() { + + /** + * Properties of a HTTPHeader. + * @memberof google.cloud.run.v2 + * @interface IHTTPHeader + * @property {string|null} [name] HTTPHeader name + * @property {string|null} [value] HTTPHeader value + */ + + /** + * Constructs a new HTTPHeader. + * @memberof google.cloud.run.v2 + * @classdesc Represents a HTTPHeader. + * @implements IHTTPHeader + * @constructor + * @param {google.cloud.run.v2.IHTTPHeader=} [properties] Properties to set + */ + function HTTPHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HTTPHeader name. + * @member {string} name + * @memberof google.cloud.run.v2.HTTPHeader + * @instance + */ + HTTPHeader.prototype.name = ""; + + /** + * HTTPHeader value. + * @member {string} value + * @memberof google.cloud.run.v2.HTTPHeader + * @instance + */ + HTTPHeader.prototype.value = ""; + + /** + * Creates a new HTTPHeader instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.HTTPHeader + * @static + * @param {google.cloud.run.v2.IHTTPHeader=} [properties] Properties to set + * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader instance + */ + HTTPHeader.create = function create(properties) { + return new HTTPHeader(properties); + }; + + /** + * Encodes the specified HTTPHeader message. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.HTTPHeader + * @static + * @param {google.cloud.run.v2.IHTTPHeader} message HTTPHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTPHeader.encode = function encode(message, writer) { + if (!writer) + 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 && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified HTTPHeader message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.HTTPHeader + * @static + * @param {google.cloud.run.v2.IHTTPHeader} message HTTPHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTPHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HTTPHeader message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.HTTPHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTPHeader.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.HTTPHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HTTPHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.HTTPHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTPHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HTTPHeader message. + * @function verify + * @memberof google.cloud.run.v2.HTTPHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HTTPHeader.verify = function verify(message) { + if (typeof message !== "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 (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a HTTPHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.HTTPHeader + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader + */ + HTTPHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.HTTPHeader) + return object; + var message = new $root.google.cloud.run.v2.HTTPHeader(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a HTTPHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.HTTPHeader + * @static + * @param {google.cloud.run.v2.HTTPHeader} message HTTPHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HTTPHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this HTTPHeader to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.HTTPHeader + * @instance + * @returns {Object.} JSON object + */ + HTTPHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HTTPHeader + * @function getTypeUrl + * @memberof google.cloud.run.v2.HTTPHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HTTPHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.HTTPHeader"; + }; + + return HTTPHeader; + })(); + + v2.TCPSocketAction = (function() { + + /** + * Properties of a TCPSocketAction. + * @memberof google.cloud.run.v2 + * @interface ITCPSocketAction + * @property {number|null} [port] TCPSocketAction port + */ + + /** + * Constructs a new TCPSocketAction. + * @memberof google.cloud.run.v2 + * @classdesc Represents a TCPSocketAction. + * @implements ITCPSocketAction + * @constructor + * @param {google.cloud.run.v2.ITCPSocketAction=} [properties] Properties to set + */ + function TCPSocketAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TCPSocketAction port. + * @member {number} port + * @memberof google.cloud.run.v2.TCPSocketAction + * @instance + */ + TCPSocketAction.prototype.port = 0; + + /** + * Creates a new TCPSocketAction instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.TCPSocketAction + * @static + * @param {google.cloud.run.v2.ITCPSocketAction=} [properties] Properties to set + * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction instance + */ + TCPSocketAction.create = function create(properties) { + return new TCPSocketAction(properties); + }; + + /** + * Encodes the specified TCPSocketAction message. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.TCPSocketAction + * @static + * @param {google.cloud.run.v2.ITCPSocketAction} message TCPSocketAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TCPSocketAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port); + return writer; + }; + + /** + * Encodes the specified TCPSocketAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.TCPSocketAction + * @static + * @param {google.cloud.run.v2.ITCPSocketAction} message TCPSocketAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TCPSocketAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TCPSocketAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.TCPSocketAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TCPSocketAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TCPSocketAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.port = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TCPSocketAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.TCPSocketAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TCPSocketAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TCPSocketAction message. + * @function verify + * @memberof google.cloud.run.v2.TCPSocketAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TCPSocketAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + return null; + }; + + /** + * Creates a TCPSocketAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.TCPSocketAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction + */ + TCPSocketAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.TCPSocketAction) + return object; + var message = new $root.google.cloud.run.v2.TCPSocketAction(); + if (object.port != null) + message.port = object.port | 0; + return message; + }; + + /** + * Creates a plain object from a TCPSocketAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.TCPSocketAction + * @static + * @param {google.cloud.run.v2.TCPSocketAction} message TCPSocketAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TCPSocketAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.port = 0; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + return object; + }; + + /** + * Converts this TCPSocketAction to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.TCPSocketAction + * @instance + * @returns {Object.} JSON object + */ + TCPSocketAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TCPSocketAction + * @function getTypeUrl + * @memberof google.cloud.run.v2.TCPSocketAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TCPSocketAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.TCPSocketAction"; + }; + + return TCPSocketAction; + })(); + + v2.GRPCAction = (function() { + + /** + * Properties of a GRPCAction. + * @memberof google.cloud.run.v2 + * @interface IGRPCAction + * @property {number|null} [port] GRPCAction port + * @property {string|null} [service] GRPCAction service + */ + + /** + * Constructs a new GRPCAction. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GRPCAction. + * @implements IGRPCAction + * @constructor + * @param {google.cloud.run.v2.IGRPCAction=} [properties] Properties to set + */ + function GRPCAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GRPCAction port. + * @member {number} port + * @memberof google.cloud.run.v2.GRPCAction + * @instance + */ + GRPCAction.prototype.port = 0; + + /** + * GRPCAction service. + * @member {string} service + * @memberof google.cloud.run.v2.GRPCAction + * @instance + */ + GRPCAction.prototype.service = ""; + + /** + * Creates a new GRPCAction instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GRPCAction + * @static + * @param {google.cloud.run.v2.IGRPCAction=} [properties] Properties to set + * @returns {google.cloud.run.v2.GRPCAction} GRPCAction instance + */ + GRPCAction.create = function create(properties) { + return new GRPCAction(properties); + }; + + /** + * Encodes the specified GRPCAction message. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GRPCAction + * @static + * @param {google.cloud.run.v2.IGRPCAction} message GRPCAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GRPCAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + return writer; + }; + + /** + * Encodes the specified GRPCAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GRPCAction + * @static + * @param {google.cloud.run.v2.IGRPCAction} message GRPCAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GRPCAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GRPCAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.GRPCAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.GRPCAction} GRPCAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GRPCAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GRPCAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.port = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GRPCAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GRPCAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.GRPCAction} GRPCAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GRPCAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GRPCAction message. + * @function verify + * @memberof google.cloud.run.v2.GRPCAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GRPCAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates a GRPCAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.GRPCAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GRPCAction} GRPCAction + */ + GRPCAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GRPCAction) + return object; + var message = new $root.google.cloud.run.v2.GRPCAction(); + if (object.port != null) + message.port = object.port | 0; + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a GRPCAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.GRPCAction + * @static + * @param {google.cloud.run.v2.GRPCAction} message GRPCAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GRPCAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.port = 0; + object.service = ""; + } + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this GRPCAction to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.GRPCAction + * @instance + * @returns {Object.} JSON object + */ + GRPCAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GRPCAction + * @function getTypeUrl + * @memberof google.cloud.run.v2.GRPCAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GRPCAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.GRPCAction"; + }; + + return GRPCAction; + })(); + + v2.BuildInfo = (function() { + + /** + * Properties of a BuildInfo. + * @memberof google.cloud.run.v2 + * @interface IBuildInfo + * @property {string|null} [functionTarget] BuildInfo functionTarget + * @property {string|null} [sourceLocation] BuildInfo sourceLocation + */ + + /** + * Constructs a new BuildInfo. + * @memberof google.cloud.run.v2 + * @classdesc Represents a BuildInfo. + * @implements IBuildInfo + * @constructor + * @param {google.cloud.run.v2.IBuildInfo=} [properties] Properties to set + */ + function BuildInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildInfo functionTarget. + * @member {string} functionTarget + * @memberof google.cloud.run.v2.BuildInfo + * @instance + */ + BuildInfo.prototype.functionTarget = ""; + + /** + * BuildInfo sourceLocation. + * @member {string} sourceLocation + * @memberof google.cloud.run.v2.BuildInfo + * @instance + */ + BuildInfo.prototype.sourceLocation = ""; + + /** + * Creates a new BuildInfo instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.BuildInfo + * @static + * @param {google.cloud.run.v2.IBuildInfo=} [properties] Properties to set + * @returns {google.cloud.run.v2.BuildInfo} BuildInfo instance + */ + BuildInfo.create = function create(properties) { + return new BuildInfo(properties); + }; + + /** + * Encodes the specified BuildInfo message. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.BuildInfo + * @static + * @param {google.cloud.run.v2.IBuildInfo} message BuildInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.functionTarget != null && Object.hasOwnProperty.call(message, "functionTarget")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.functionTarget); + if (message.sourceLocation != null && Object.hasOwnProperty.call(message, "sourceLocation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLocation); + return writer; + }; + + /** + * Encodes the specified BuildInfo message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.BuildInfo + * @static + * @param {google.cloud.run.v2.IBuildInfo} message BuildInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.BuildInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.BuildInfo} BuildInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.BuildInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.functionTarget = reader.string(); + break; + } + case 2: { + message.sourceLocation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.BuildInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.BuildInfo} BuildInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildInfo message. + * @function verify + * @memberof google.cloud.run.v2.BuildInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) + if (!$util.isString(message.functionTarget)) + return "functionTarget: string expected"; + if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) + if (!$util.isString(message.sourceLocation)) + return "sourceLocation: string expected"; + return null; + }; + + /** + * Creates a BuildInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.BuildInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.BuildInfo} BuildInfo + */ + BuildInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.BuildInfo) + return object; + var message = new $root.google.cloud.run.v2.BuildInfo(); + if (object.functionTarget != null) + message.functionTarget = String(object.functionTarget); + if (object.sourceLocation != null) + message.sourceLocation = String(object.sourceLocation); + return message; + }; + + /** + * Creates a plain object from a BuildInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.BuildInfo + * @static + * @param {google.cloud.run.v2.BuildInfo} message BuildInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.functionTarget = ""; + object.sourceLocation = ""; + } + if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) + object.functionTarget = message.functionTarget; + if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) + object.sourceLocation = message.sourceLocation; + return object; + }; + + /** + * Converts this BuildInfo to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.BuildInfo + * @instance + * @returns {Object.} JSON object + */ + BuildInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuildInfo + * @function getTypeUrl + * @memberof google.cloud.run.v2.BuildInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuildInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.BuildInfo"; + }; + + return BuildInfo; + })(); + + v2.SourceCode = (function() { + + /** + * Properties of a SourceCode. + * @memberof google.cloud.run.v2 + * @interface ISourceCode + * @property {google.cloud.run.v2.SourceCode.ICloudStorageSource|null} [cloudStorageSource] SourceCode cloudStorageSource + */ + + /** + * Constructs a new SourceCode. + * @memberof google.cloud.run.v2 + * @classdesc Represents a SourceCode. + * @implements ISourceCode + * @constructor + * @param {google.cloud.run.v2.ISourceCode=} [properties] Properties to set + */ + function SourceCode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCode cloudStorageSource. + * @member {google.cloud.run.v2.SourceCode.ICloudStorageSource|null|undefined} cloudStorageSource + * @memberof google.cloud.run.v2.SourceCode + * @instance + */ + SourceCode.prototype.cloudStorageSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SourceCode sourceType. + * @member {"cloudStorageSource"|undefined} sourceType + * @memberof google.cloud.run.v2.SourceCode + * @instance + */ + Object.defineProperty(SourceCode.prototype, "sourceType", { + get: $util.oneOfGetter($oneOfFields = ["cloudStorageSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SourceCode instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.SourceCode + * @static + * @param {google.cloud.run.v2.ISourceCode=} [properties] Properties to set + * @returns {google.cloud.run.v2.SourceCode} SourceCode instance + */ + SourceCode.create = function create(properties) { + return new SourceCode(properties); + }; + + /** + * Encodes the specified SourceCode message. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.SourceCode + * @static + * @param {google.cloud.run.v2.ISourceCode} message SourceCode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudStorageSource != null && Object.hasOwnProperty.call(message, "cloudStorageSource")) + $root.google.cloud.run.v2.SourceCode.CloudStorageSource.encode(message.cloudStorageSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCode message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.SourceCode + * @static + * @param {google.cloud.run.v2.ISourceCode} message SourceCode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.SourceCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.SourceCode} SourceCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SourceCode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cloudStorageSource = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.SourceCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.SourceCode} SourceCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCode message. + * @function verify + * @memberof google.cloud.run.v2.SourceCode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudStorageSource != null && message.hasOwnProperty("cloudStorageSource")) { + properties.sourceType = 1; + { + var error = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.verify(message.cloudStorageSource); + if (error) + return "cloudStorageSource." + error; + } + } + return null; + }; + + /** + * Creates a SourceCode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.SourceCode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.SourceCode} SourceCode + */ + SourceCode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.SourceCode) + return object; + var message = new $root.google.cloud.run.v2.SourceCode(); + if (object.cloudStorageSource != null) { + if (typeof object.cloudStorageSource !== "object") + throw TypeError(".google.cloud.run.v2.SourceCode.cloudStorageSource: object expected"); + message.cloudStorageSource = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.fromObject(object.cloudStorageSource); + } + return message; + }; + + /** + * Creates a plain object from a SourceCode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.SourceCode + * @static + * @param {google.cloud.run.v2.SourceCode} message SourceCode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cloudStorageSource != null && message.hasOwnProperty("cloudStorageSource")) { + object.cloudStorageSource = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.toObject(message.cloudStorageSource, options); + if (options.oneofs) + object.sourceType = "cloudStorageSource"; + } + return object; + }; + + /** + * Converts this SourceCode to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.SourceCode + * @instance + * @returns {Object.} JSON object + */ + SourceCode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCode + * @function getTypeUrl + * @memberof google.cloud.run.v2.SourceCode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.SourceCode"; + }; + + SourceCode.CloudStorageSource = (function() { + + /** + * Properties of a CloudStorageSource. + * @memberof google.cloud.run.v2.SourceCode + * @interface ICloudStorageSource + * @property {string|null} [bucket] CloudStorageSource bucket + * @property {string|null} [object] CloudStorageSource object + * @property {number|Long|null} [generation] CloudStorageSource generation + */ + + /** + * Constructs a new CloudStorageSource. + * @memberof google.cloud.run.v2.SourceCode + * @classdesc Represents a CloudStorageSource. + * @implements ICloudStorageSource + * @constructor + * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource=} [properties] Properties to set + */ + function CloudStorageSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudStorageSource bucket. + * @member {string} bucket + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @instance + */ + CloudStorageSource.prototype.bucket = ""; + + /** + * CloudStorageSource object. + * @member {string} object + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @instance + */ + CloudStorageSource.prototype.object = ""; + + /** + * CloudStorageSource generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @instance + */ + CloudStorageSource.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CloudStorageSource instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @static + * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource=} [properties] Properties to set + * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource instance + */ + CloudStorageSource.create = function create(properties) { + return new CloudStorageSource(properties); + }; + + /** + * Encodes the specified CloudStorageSource message. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @static + * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource} message CloudStorageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + return writer; + }; + + /** + * Encodes the specified CloudStorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @static + * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource} message CloudStorageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudStorageSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudStorageSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SourceCode.CloudStorageSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudStorageSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudStorageSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudStorageSource message. + * @function verify + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudStorageSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + return null; + }; + + /** + * Creates a CloudStorageSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource + */ + CloudStorageSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.SourceCode.CloudStorageSource) + return object; + var message = new $root.google.cloud.run.v2.SourceCode.CloudStorageSource(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a CloudStorageSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @static + * @param {google.cloud.run.v2.SourceCode.CloudStorageSource} message CloudStorageSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudStorageSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + return object; + }; + + /** + * Converts this CloudStorageSource to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @instance + * @returns {Object.} JSON object + */ + CloudStorageSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudStorageSource + * @function getTypeUrl + * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudStorageSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.SourceCode.CloudStorageSource"; + }; + + return CloudStorageSource; + })(); + + return SourceCode; + })(); + + v2.VpcAccess = (function() { + + /** + * Properties of a VpcAccess. + * @memberof google.cloud.run.v2 + * @interface IVpcAccess + * @property {string|null} [connector] VpcAccess connector + * @property {google.cloud.run.v2.VpcAccess.VpcEgress|null} [egress] VpcAccess egress + * @property {Array.|null} [networkInterfaces] VpcAccess networkInterfaces + */ + + /** + * Constructs a new VpcAccess. + * @memberof google.cloud.run.v2 + * @classdesc Represents a VpcAccess. + * @implements IVpcAccess + * @constructor + * @param {google.cloud.run.v2.IVpcAccess=} [properties] Properties to set + */ + function VpcAccess(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]]; + } + + /** + * VpcAccess connector. + * @member {string} connector + * @memberof google.cloud.run.v2.VpcAccess + * @instance + */ + VpcAccess.prototype.connector = ""; + + /** + * VpcAccess egress. + * @member {google.cloud.run.v2.VpcAccess.VpcEgress} egress + * @memberof google.cloud.run.v2.VpcAccess + * @instance + */ + VpcAccess.prototype.egress = 0; + + /** + * VpcAccess networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.run.v2.VpcAccess + * @instance + */ + VpcAccess.prototype.networkInterfaces = $util.emptyArray; + + /** + * Creates a new VpcAccess instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.VpcAccess + * @static + * @param {google.cloud.run.v2.IVpcAccess=} [properties] Properties to set + * @returns {google.cloud.run.v2.VpcAccess} VpcAccess instance + */ + VpcAccess.create = function create(properties) { + return new VpcAccess(properties); + }; + + /** + * Encodes the specified VpcAccess message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.VpcAccess + * @static + * @param {google.cloud.run.v2.IVpcAccess} message VpcAccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccess.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connector != null && Object.hasOwnProperty.call(message, "connector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connector); + if (message.egress != null && Object.hasOwnProperty.call(message, "egress")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.egress); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.run.v2.VpcAccess.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VpcAccess message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.VpcAccess + * @static + * @param {google.cloud.run.v2.IVpcAccess} message VpcAccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcAccess message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.VpcAccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.VpcAccess} VpcAccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccess.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VpcAccess(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.connector = reader.string(); + break; + } + case 2: { + message.egress = reader.int32(); + break; + } + case 3: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.run.v2.VpcAccess.NetworkInterface.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcAccess message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.VpcAccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.VpcAccess} VpcAccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcAccess message. + * @function verify + * @memberof google.cloud.run.v2.VpcAccess + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcAccess.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connector != null && message.hasOwnProperty("connector")) + if (!$util.isString(message.connector)) + return "connector: string expected"; + if (message.egress != null && message.hasOwnProperty("egress")) + switch (message.egress) { + default: + return "egress: enum value expected"; + case 0: + case 1: + case 2: + break; + } + 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.run.v2.VpcAccess.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + return null; + }; + + /** + * Creates a VpcAccess message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.VpcAccess + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.VpcAccess} VpcAccess + */ + VpcAccess.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.VpcAccess) + return object; + var message = new $root.google.cloud.run.v2.VpcAccess(); + if (object.connector != null) + message.connector = String(object.connector); + switch (object.egress) { + default: + if (typeof object.egress === "number") { + message.egress = object.egress; + break; + } + break; + case "VPC_EGRESS_UNSPECIFIED": + case 0: + message.egress = 0; + break; + case "ALL_TRAFFIC": + case 1: + message.egress = 1; + break; + case "PRIVATE_RANGES_ONLY": + case 2: + message.egress = 2; + break; + } + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.run.v2.VpcAccess.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.run.v2.VpcAccess.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.run.v2.VpcAccess.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VpcAccess message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.VpcAccess + * @static + * @param {google.cloud.run.v2.VpcAccess} message VpcAccess + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcAccess.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkInterfaces = []; + if (options.defaults) { + object.connector = ""; + object.egress = options.enums === String ? "VPC_EGRESS_UNSPECIFIED" : 0; + } + if (message.connector != null && message.hasOwnProperty("connector")) + object.connector = message.connector; + if (message.egress != null && message.hasOwnProperty("egress")) + object.egress = options.enums === String ? $root.google.cloud.run.v2.VpcAccess.VpcEgress[message.egress] === undefined ? message.egress : $root.google.cloud.run.v2.VpcAccess.VpcEgress[message.egress] : message.egress; + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.run.v2.VpcAccess.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + return object; + }; + + /** + * Converts this VpcAccess to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.VpcAccess + * @instance + * @returns {Object.} JSON object + */ + VpcAccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcAccess + * @function getTypeUrl + * @memberof google.cloud.run.v2.VpcAccess + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcAccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.VpcAccess"; + }; + + /** + * VpcEgress enum. + * @name google.cloud.run.v2.VpcAccess.VpcEgress + * @enum {number} + * @property {number} VPC_EGRESS_UNSPECIFIED=0 VPC_EGRESS_UNSPECIFIED value + * @property {number} ALL_TRAFFIC=1 ALL_TRAFFIC value + * @property {number} PRIVATE_RANGES_ONLY=2 PRIVATE_RANGES_ONLY value + */ + VpcAccess.VpcEgress = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VPC_EGRESS_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALL_TRAFFIC"] = 1; + values[valuesById[2] = "PRIVATE_RANGES_ONLY"] = 2; + return values; + })(); + + VpcAccess.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.run.v2.VpcAccess + * @interface INetworkInterface + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [subnetwork] NetworkInterface subnetwork + * @property {Array.|null} [tags] NetworkInterface tags + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.run.v2.VpcAccess + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.run.v2.VpcAccess.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + 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]]; + } + + /** + * NetworkInterface network. + * @member {string} network + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = ""; + + /** + * NetworkInterface subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = ""; + + /** + * NetworkInterface tags. + * @member {Array.} tags + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @instance + */ + NetworkInterface.prototype.tags = $util.emptyArray; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {google.cloud.run.v2.VpcAccess.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.run.v2.VpcAccess.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {google.cloud.run.v2.VpcAccess.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.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tags[i]); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.VpcAccess.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VpcAccess.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subnetwork = reader.string(); + break; + } + case 3: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + 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.run.v2.VpcAccess.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.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.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 a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.VpcAccess.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.VpcAccess.NetworkInterface) + return object; + var message = new $root.google.cloud.run.v2.VpcAccess.NetworkInterface(); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.run.v2.VpcAccess.NetworkInterface.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 a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface + * @static + * @param {google.cloud.run.v2.VpcAccess.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.arrays || options.defaults) + object.tags = []; + if (options.defaults) { + object.network = ""; + object.subnetwork = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + 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 NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.NetworkInterface"; + }; + + return NetworkInterface; + })(); + + return VpcAccess; + })(); + + v2.BinaryAuthorization = (function() { + + /** + * Properties of a BinaryAuthorization. + * @memberof google.cloud.run.v2 + * @interface IBinaryAuthorization + * @property {boolean|null} [useDefault] BinaryAuthorization useDefault + * @property {string|null} [policy] BinaryAuthorization policy + * @property {string|null} [breakglassJustification] BinaryAuthorization breakglassJustification + */ + + /** + * Constructs a new BinaryAuthorization. + * @memberof google.cloud.run.v2 + * @classdesc Represents a BinaryAuthorization. + * @implements IBinaryAuthorization + * @constructor + * @param {google.cloud.run.v2.IBinaryAuthorization=} [properties] Properties to set + */ + function BinaryAuthorization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BinaryAuthorization useDefault. + * @member {boolean|null|undefined} useDefault + * @memberof google.cloud.run.v2.BinaryAuthorization + * @instance + */ + BinaryAuthorization.prototype.useDefault = null; + + /** + * BinaryAuthorization policy. + * @member {string|null|undefined} policy + * @memberof google.cloud.run.v2.BinaryAuthorization + * @instance + */ + BinaryAuthorization.prototype.policy = null; + + /** + * BinaryAuthorization breakglassJustification. + * @member {string} breakglassJustification + * @memberof google.cloud.run.v2.BinaryAuthorization + * @instance + */ + BinaryAuthorization.prototype.breakglassJustification = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BinaryAuthorization binauthzMethod. + * @member {"useDefault"|"policy"|undefined} binauthzMethod + * @memberof google.cloud.run.v2.BinaryAuthorization + * @instance + */ + Object.defineProperty(BinaryAuthorization.prototype, "binauthzMethod", { + get: $util.oneOfGetter($oneOfFields = ["useDefault", "policy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BinaryAuthorization instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.BinaryAuthorization + * @static + * @param {google.cloud.run.v2.IBinaryAuthorization=} [properties] Properties to set + * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization instance + */ + BinaryAuthorization.create = function create(properties) { + return new BinaryAuthorization(properties); + }; + + /** + * Encodes the specified BinaryAuthorization message. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.BinaryAuthorization + * @static + * @param {google.cloud.run.v2.IBinaryAuthorization} message BinaryAuthorization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BinaryAuthorization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useDefault != null && Object.hasOwnProperty.call(message, "useDefault")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useDefault); + if (message.breakglassJustification != null && Object.hasOwnProperty.call(message, "breakglassJustification")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.breakglassJustification); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.policy); + return writer; + }; + + /** + * Encodes the specified BinaryAuthorization message, length delimited. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.BinaryAuthorization + * @static + * @param {google.cloud.run.v2.IBinaryAuthorization} message BinaryAuthorization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BinaryAuthorization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BinaryAuthorization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.BinaryAuthorization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BinaryAuthorization.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.BinaryAuthorization(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.useDefault = reader.bool(); + break; + } + case 3: { + message.policy = reader.string(); + break; + } + case 2: { + message.breakglassJustification = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BinaryAuthorization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.BinaryAuthorization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BinaryAuthorization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BinaryAuthorization message. + * @function verify + * @memberof google.cloud.run.v2.BinaryAuthorization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BinaryAuthorization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.useDefault != null && message.hasOwnProperty("useDefault")) { + properties.binauthzMethod = 1; + if (typeof message.useDefault !== "boolean") + return "useDefault: boolean expected"; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + if (properties.binauthzMethod === 1) + return "binauthzMethod: multiple values"; + properties.binauthzMethod = 1; + if (!$util.isString(message.policy)) + return "policy: string expected"; + } + if (message.breakglassJustification != null && message.hasOwnProperty("breakglassJustification")) + if (!$util.isString(message.breakglassJustification)) + return "breakglassJustification: string expected"; + return null; + }; + + /** + * Creates a BinaryAuthorization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.BinaryAuthorization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization + */ + BinaryAuthorization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.BinaryAuthorization) + return object; + var message = new $root.google.cloud.run.v2.BinaryAuthorization(); + if (object.useDefault != null) + message.useDefault = Boolean(object.useDefault); + if (object.policy != null) + message.policy = String(object.policy); + if (object.breakglassJustification != null) + message.breakglassJustification = String(object.breakglassJustification); + return message; + }; + + /** + * Creates a plain object from a BinaryAuthorization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.BinaryAuthorization + * @static + * @param {google.cloud.run.v2.BinaryAuthorization} message BinaryAuthorization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BinaryAuthorization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.breakglassJustification = ""; + if (message.useDefault != null && message.hasOwnProperty("useDefault")) { + object.useDefault = message.useDefault; + if (options.oneofs) + object.binauthzMethod = "useDefault"; + } + if (message.breakglassJustification != null && message.hasOwnProperty("breakglassJustification")) + object.breakglassJustification = message.breakglassJustification; + if (message.policy != null && message.hasOwnProperty("policy")) { + object.policy = message.policy; + if (options.oneofs) + object.binauthzMethod = "policy"; + } + return object; + }; + + /** + * Converts this BinaryAuthorization to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.BinaryAuthorization + * @instance + * @returns {Object.} JSON object + */ + BinaryAuthorization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BinaryAuthorization + * @function getTypeUrl + * @memberof google.cloud.run.v2.BinaryAuthorization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BinaryAuthorization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.BinaryAuthorization"; + }; + + return BinaryAuthorization; + })(); + + v2.RevisionScaling = (function() { + + /** + * Properties of a RevisionScaling. + * @memberof google.cloud.run.v2 + * @interface IRevisionScaling + * @property {number|null} [minInstanceCount] RevisionScaling minInstanceCount + * @property {number|null} [maxInstanceCount] RevisionScaling maxInstanceCount + */ + + /** + * Constructs a new RevisionScaling. + * @memberof google.cloud.run.v2 + * @classdesc Represents a RevisionScaling. + * @implements IRevisionScaling + * @constructor + * @param {google.cloud.run.v2.IRevisionScaling=} [properties] Properties to set + */ + function RevisionScaling(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RevisionScaling minInstanceCount. + * @member {number} minInstanceCount + * @memberof google.cloud.run.v2.RevisionScaling + * @instance + */ + RevisionScaling.prototype.minInstanceCount = 0; + + /** + * RevisionScaling maxInstanceCount. + * @member {number} maxInstanceCount + * @memberof google.cloud.run.v2.RevisionScaling + * @instance + */ + RevisionScaling.prototype.maxInstanceCount = 0; + + /** + * Creates a new RevisionScaling instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.RevisionScaling + * @static + * @param {google.cloud.run.v2.IRevisionScaling=} [properties] Properties to set + * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling instance + */ + RevisionScaling.create = function create(properties) { + return new RevisionScaling(properties); + }; + + /** + * Encodes the specified RevisionScaling message. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.RevisionScaling + * @static + * @param {google.cloud.run.v2.IRevisionScaling} message RevisionScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevisionScaling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minInstanceCount != null && Object.hasOwnProperty.call(message, "minInstanceCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minInstanceCount); + if (message.maxInstanceCount != null && Object.hasOwnProperty.call(message, "maxInstanceCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxInstanceCount); + return writer; + }; + + /** + * Encodes the specified RevisionScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.RevisionScaling + * @static + * @param {google.cloud.run.v2.IRevisionScaling} message RevisionScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevisionScaling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RevisionScaling message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.RevisionScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevisionScaling.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RevisionScaling(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minInstanceCount = reader.int32(); + break; + } + case 2: { + message.maxInstanceCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RevisionScaling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.RevisionScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevisionScaling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RevisionScaling message. + * @function verify + * @memberof google.cloud.run.v2.RevisionScaling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RevisionScaling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) + if (!$util.isInteger(message.minInstanceCount)) + return "minInstanceCount: integer expected"; + if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) + if (!$util.isInteger(message.maxInstanceCount)) + return "maxInstanceCount: integer expected"; + return null; + }; + + /** + * Creates a RevisionScaling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.RevisionScaling + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling + */ + RevisionScaling.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.RevisionScaling) + return object; + var message = new $root.google.cloud.run.v2.RevisionScaling(); + if (object.minInstanceCount != null) + message.minInstanceCount = object.minInstanceCount | 0; + if (object.maxInstanceCount != null) + message.maxInstanceCount = object.maxInstanceCount | 0; + return message; + }; + + /** + * Creates a plain object from a RevisionScaling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.RevisionScaling + * @static + * @param {google.cloud.run.v2.RevisionScaling} message RevisionScaling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RevisionScaling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minInstanceCount = 0; + object.maxInstanceCount = 0; + } + if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) + object.minInstanceCount = message.minInstanceCount; + if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) + object.maxInstanceCount = message.maxInstanceCount; + return object; + }; + + /** + * Converts this RevisionScaling to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.RevisionScaling + * @instance + * @returns {Object.} JSON object + */ + RevisionScaling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RevisionScaling + * @function getTypeUrl + * @memberof google.cloud.run.v2.RevisionScaling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RevisionScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.RevisionScaling"; + }; + + return RevisionScaling; + })(); + + v2.ServiceMesh = (function() { + + /** + * Properties of a ServiceMesh. + * @memberof google.cloud.run.v2 + * @interface IServiceMesh + * @property {string|null} [mesh] ServiceMesh mesh + */ + + /** + * Constructs a new ServiceMesh. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ServiceMesh. + * @implements IServiceMesh + * @constructor + * @param {google.cloud.run.v2.IServiceMesh=} [properties] Properties to set + */ + function ServiceMesh(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceMesh mesh. + * @member {string} mesh + * @memberof google.cloud.run.v2.ServiceMesh + * @instance + */ + ServiceMesh.prototype.mesh = ""; + + /** + * Creates a new ServiceMesh instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ServiceMesh + * @static + * @param {google.cloud.run.v2.IServiceMesh=} [properties] Properties to set + * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh instance + */ + ServiceMesh.create = function create(properties) { + return new ServiceMesh(properties); + }; + + /** + * Encodes the specified ServiceMesh message. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ServiceMesh + * @static + * @param {google.cloud.run.v2.IServiceMesh} message ServiceMesh message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceMesh.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mesh != null && Object.hasOwnProperty.call(message, "mesh")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mesh); + return writer; + }; + + /** + * Encodes the specified ServiceMesh message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ServiceMesh + * @static + * @param {google.cloud.run.v2.IServiceMesh} message ServiceMesh message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceMesh.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceMesh message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ServiceMesh + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceMesh.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ServiceMesh(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mesh = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceMesh message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ServiceMesh + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceMesh.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceMesh message. + * @function verify + * @memberof google.cloud.run.v2.ServiceMesh + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceMesh.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mesh != null && message.hasOwnProperty("mesh")) + if (!$util.isString(message.mesh)) + return "mesh: string expected"; + return null; + }; + + /** + * Creates a ServiceMesh message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ServiceMesh + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh + */ + ServiceMesh.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ServiceMesh) + return object; + var message = new $root.google.cloud.run.v2.ServiceMesh(); + if (object.mesh != null) + message.mesh = String(object.mesh); + return message; + }; + + /** + * Creates a plain object from a ServiceMesh message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ServiceMesh + * @static + * @param {google.cloud.run.v2.ServiceMesh} message ServiceMesh + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceMesh.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mesh = ""; + if (message.mesh != null && message.hasOwnProperty("mesh")) + object.mesh = message.mesh; + return object; + }; + + /** + * Converts this ServiceMesh to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ServiceMesh + * @instance + * @returns {Object.} JSON object + */ + ServiceMesh.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceMesh + * @function getTypeUrl + * @memberof google.cloud.run.v2.ServiceMesh + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceMesh.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ServiceMesh"; + }; + + return ServiceMesh; + })(); + + v2.ServiceScaling = (function() { + + /** + * Properties of a ServiceScaling. + * @memberof google.cloud.run.v2 + * @interface IServiceScaling + * @property {number|null} [minInstanceCount] ServiceScaling minInstanceCount + * @property {google.cloud.run.v2.ServiceScaling.ScalingMode|null} [scalingMode] ServiceScaling scalingMode + * @property {number|null} [maxInstanceCount] ServiceScaling maxInstanceCount + * @property {number|null} [manualInstanceCount] ServiceScaling manualInstanceCount + */ + + /** + * Constructs a new ServiceScaling. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ServiceScaling. + * @implements IServiceScaling + * @constructor + * @param {google.cloud.run.v2.IServiceScaling=} [properties] Properties to set + */ + function ServiceScaling(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceScaling minInstanceCount. + * @member {number} minInstanceCount + * @memberof google.cloud.run.v2.ServiceScaling + * @instance + */ + ServiceScaling.prototype.minInstanceCount = 0; + + /** + * ServiceScaling scalingMode. + * @member {google.cloud.run.v2.ServiceScaling.ScalingMode} scalingMode + * @memberof google.cloud.run.v2.ServiceScaling + * @instance + */ + ServiceScaling.prototype.scalingMode = 0; + + /** + * ServiceScaling maxInstanceCount. + * @member {number} maxInstanceCount + * @memberof google.cloud.run.v2.ServiceScaling + * @instance + */ + ServiceScaling.prototype.maxInstanceCount = 0; + + /** + * ServiceScaling manualInstanceCount. + * @member {number|null|undefined} manualInstanceCount + * @memberof google.cloud.run.v2.ServiceScaling + * @instance + */ + ServiceScaling.prototype.manualInstanceCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ServiceScaling.prototype, "_manualInstanceCount", { + get: $util.oneOfGetter($oneOfFields = ["manualInstanceCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ServiceScaling instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ServiceScaling + * @static + * @param {google.cloud.run.v2.IServiceScaling=} [properties] Properties to set + * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling instance + */ + ServiceScaling.create = function create(properties) { + return new ServiceScaling(properties); + }; + + /** + * Encodes the specified ServiceScaling message. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ServiceScaling + * @static + * @param {google.cloud.run.v2.IServiceScaling} message ServiceScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceScaling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minInstanceCount != null && Object.hasOwnProperty.call(message, "minInstanceCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minInstanceCount); + if (message.scalingMode != null && Object.hasOwnProperty.call(message, "scalingMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.scalingMode); + if (message.maxInstanceCount != null && Object.hasOwnProperty.call(message, "maxInstanceCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxInstanceCount); + if (message.manualInstanceCount != null && Object.hasOwnProperty.call(message, "manualInstanceCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.manualInstanceCount); + return writer; + }; + + /** + * Encodes the specified ServiceScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ServiceScaling + * @static + * @param {google.cloud.run.v2.IServiceScaling} message ServiceScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceScaling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceScaling message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ServiceScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceScaling.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ServiceScaling(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minInstanceCount = reader.int32(); + break; + } + case 3: { + message.scalingMode = reader.int32(); + break; + } + case 4: { + message.maxInstanceCount = reader.int32(); + break; + } + case 6: { + message.manualInstanceCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceScaling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ServiceScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceScaling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceScaling message. + * @function verify + * @memberof google.cloud.run.v2.ServiceScaling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceScaling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) + if (!$util.isInteger(message.minInstanceCount)) + return "minInstanceCount: integer expected"; + if (message.scalingMode != null && message.hasOwnProperty("scalingMode")) + switch (message.scalingMode) { + default: + return "scalingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) + if (!$util.isInteger(message.maxInstanceCount)) + return "maxInstanceCount: integer expected"; + if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { + properties._manualInstanceCount = 1; + if (!$util.isInteger(message.manualInstanceCount)) + return "manualInstanceCount: integer expected"; + } + return null; + }; + + /** + * Creates a ServiceScaling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ServiceScaling + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling + */ + ServiceScaling.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ServiceScaling) + return object; + var message = new $root.google.cloud.run.v2.ServiceScaling(); + if (object.minInstanceCount != null) + message.minInstanceCount = object.minInstanceCount | 0; + switch (object.scalingMode) { + default: + if (typeof object.scalingMode === "number") { + message.scalingMode = object.scalingMode; + break; + } + break; + case "SCALING_MODE_UNSPECIFIED": + case 0: + message.scalingMode = 0; + break; + case "AUTOMATIC": + case 1: + message.scalingMode = 1; + break; + case "MANUAL": + case 2: + message.scalingMode = 2; + break; + } + if (object.maxInstanceCount != null) + message.maxInstanceCount = object.maxInstanceCount | 0; + if (object.manualInstanceCount != null) + message.manualInstanceCount = object.manualInstanceCount | 0; + return message; + }; + + /** + * Creates a plain object from a ServiceScaling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ServiceScaling + * @static + * @param {google.cloud.run.v2.ServiceScaling} message ServiceScaling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceScaling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minInstanceCount = 0; + object.scalingMode = options.enums === String ? "SCALING_MODE_UNSPECIFIED" : 0; + object.maxInstanceCount = 0; + } + if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) + object.minInstanceCount = message.minInstanceCount; + if (message.scalingMode != null && message.hasOwnProperty("scalingMode")) + object.scalingMode = options.enums === String ? $root.google.cloud.run.v2.ServiceScaling.ScalingMode[message.scalingMode] === undefined ? message.scalingMode : $root.google.cloud.run.v2.ServiceScaling.ScalingMode[message.scalingMode] : message.scalingMode; + if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) + object.maxInstanceCount = message.maxInstanceCount; + if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { + object.manualInstanceCount = message.manualInstanceCount; + if (options.oneofs) + object._manualInstanceCount = "manualInstanceCount"; + } + return object; + }; + + /** + * Converts this ServiceScaling to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ServiceScaling + * @instance + * @returns {Object.} JSON object + */ + ServiceScaling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceScaling + * @function getTypeUrl + * @memberof google.cloud.run.v2.ServiceScaling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ServiceScaling"; + }; + + /** + * ScalingMode enum. + * @name google.cloud.run.v2.ServiceScaling.ScalingMode + * @enum {number} + * @property {number} SCALING_MODE_UNSPECIFIED=0 SCALING_MODE_UNSPECIFIED value + * @property {number} AUTOMATIC=1 AUTOMATIC value + * @property {number} MANUAL=2 MANUAL value + */ + ServiceScaling.ScalingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCALING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOMATIC"] = 1; + values[valuesById[2] = "MANUAL"] = 2; + return values; + })(); + + return ServiceScaling; + })(); + + v2.WorkerPoolScaling = (function() { + + /** + * Properties of a WorkerPoolScaling. + * @memberof google.cloud.run.v2 + * @interface IWorkerPoolScaling + * @property {number|null} [manualInstanceCount] WorkerPoolScaling manualInstanceCount + */ + + /** + * Constructs a new WorkerPoolScaling. + * @memberof google.cloud.run.v2 + * @classdesc Represents a WorkerPoolScaling. + * @implements IWorkerPoolScaling + * @constructor + * @param {google.cloud.run.v2.IWorkerPoolScaling=} [properties] Properties to set + */ + function WorkerPoolScaling(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkerPoolScaling manualInstanceCount. + * @member {number|null|undefined} manualInstanceCount + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @instance + */ + WorkerPoolScaling.prototype.manualInstanceCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WorkerPoolScaling.prototype, "_manualInstanceCount", { + get: $util.oneOfGetter($oneOfFields = ["manualInstanceCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WorkerPoolScaling instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @static + * @param {google.cloud.run.v2.IWorkerPoolScaling=} [properties] Properties to set + * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling instance + */ + WorkerPoolScaling.create = function create(properties) { + return new WorkerPoolScaling(properties); + }; + + /** + * Encodes the specified WorkerPoolScaling message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @static + * @param {google.cloud.run.v2.IWorkerPoolScaling} message WorkerPoolScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerPoolScaling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.manualInstanceCount != null && Object.hasOwnProperty.call(message, "manualInstanceCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.manualInstanceCount); + return writer; + }; + + /** + * Encodes the specified WorkerPoolScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @static + * @param {google.cloud.run.v2.IWorkerPoolScaling} message WorkerPoolScaling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerPoolScaling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkerPoolScaling message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerPoolScaling.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.WorkerPoolScaling(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 6: { + message.manualInstanceCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkerPoolScaling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerPoolScaling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerPoolScaling message. + * @function verify + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerPoolScaling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { + properties._manualInstanceCount = 1; + if (!$util.isInteger(message.manualInstanceCount)) + return "manualInstanceCount: integer expected"; + } + return null; + }; + + /** + * Creates a WorkerPoolScaling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling + */ + WorkerPoolScaling.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.WorkerPoolScaling) + return object; + var message = new $root.google.cloud.run.v2.WorkerPoolScaling(); + if (object.manualInstanceCount != null) + message.manualInstanceCount = object.manualInstanceCount | 0; + return message; + }; + + /** + * Creates a plain object from a WorkerPoolScaling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @static + * @param {google.cloud.run.v2.WorkerPoolScaling} message WorkerPoolScaling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerPoolScaling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { + object.manualInstanceCount = message.manualInstanceCount; + if (options.oneofs) + object._manualInstanceCount = "manualInstanceCount"; + } + return object; + }; + + /** + * Converts this WorkerPoolScaling to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @instance + * @returns {Object.} JSON object + */ + WorkerPoolScaling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkerPoolScaling + * @function getTypeUrl + * @memberof google.cloud.run.v2.WorkerPoolScaling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerPoolScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.WorkerPoolScaling"; + }; + + return WorkerPoolScaling; + })(); + + v2.NodeSelector = (function() { + + /** + * Properties of a NodeSelector. + * @memberof google.cloud.run.v2 + * @interface INodeSelector + * @property {string|null} [accelerator] NodeSelector accelerator + */ + + /** + * Constructs a new NodeSelector. + * @memberof google.cloud.run.v2 + * @classdesc Represents a NodeSelector. + * @implements INodeSelector + * @constructor + * @param {google.cloud.run.v2.INodeSelector=} [properties] Properties to set + */ + function NodeSelector(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSelector accelerator. + * @member {string} accelerator + * @memberof google.cloud.run.v2.NodeSelector + * @instance + */ + NodeSelector.prototype.accelerator = ""; + + /** + * Creates a new NodeSelector instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.NodeSelector + * @static + * @param {google.cloud.run.v2.INodeSelector=} [properties] Properties to set + * @returns {google.cloud.run.v2.NodeSelector} NodeSelector instance + */ + NodeSelector.create = function create(properties) { + return new NodeSelector(properties); + }; + + /** + * Encodes the specified NodeSelector message. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.NodeSelector + * @static + * @param {google.cloud.run.v2.INodeSelector} message NodeSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accelerator != null && Object.hasOwnProperty.call(message, "accelerator")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accelerator); + return writer; + }; + + /** + * Encodes the specified NodeSelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.NodeSelector + * @static + * @param {google.cloud.run.v2.INodeSelector} message NodeSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.NodeSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.NodeSelector} NodeSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSelector.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.NodeSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.accelerator = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.NodeSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.NodeSelector} NodeSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSelector message. + * @function verify + * @memberof google.cloud.run.v2.NodeSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accelerator != null && message.hasOwnProperty("accelerator")) + if (!$util.isString(message.accelerator)) + return "accelerator: string expected"; + return null; + }; + + /** + * Creates a NodeSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.NodeSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.NodeSelector} NodeSelector + */ + NodeSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.NodeSelector) + return object; + var message = new $root.google.cloud.run.v2.NodeSelector(); + if (object.accelerator != null) + message.accelerator = String(object.accelerator); + return message; + }; + + /** + * Creates a plain object from a NodeSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.NodeSelector + * @static + * @param {google.cloud.run.v2.NodeSelector} message NodeSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.accelerator = ""; + if (message.accelerator != null && message.hasOwnProperty("accelerator")) + object.accelerator = message.accelerator; + return object; + }; + + /** + * Converts this NodeSelector to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.NodeSelector + * @instance + * @returns {Object.} JSON object + */ + NodeSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSelector + * @function getTypeUrl + * @memberof google.cloud.run.v2.NodeSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.NodeSelector"; + }; + + return NodeSelector; + })(); + + v2.BuildConfig = (function() { + + /** + * Properties of a BuildConfig. + * @memberof google.cloud.run.v2 + * @interface IBuildConfig + * @property {string|null} [name] BuildConfig name + * @property {string|null} [sourceLocation] BuildConfig sourceLocation + * @property {string|null} [functionTarget] BuildConfig functionTarget + * @property {string|null} [imageUri] BuildConfig imageUri + * @property {string|null} [baseImage] BuildConfig baseImage + * @property {boolean|null} [enableAutomaticUpdates] BuildConfig enableAutomaticUpdates + * @property {string|null} [workerPool] BuildConfig workerPool + * @property {Object.|null} [environmentVariables] BuildConfig environmentVariables + * @property {string|null} [serviceAccount] BuildConfig serviceAccount + */ + + /** + * Constructs a new BuildConfig. + * @memberof google.cloud.run.v2 + * @classdesc Represents a BuildConfig. + * @implements IBuildConfig + * @constructor + * @param {google.cloud.run.v2.IBuildConfig=} [properties] Properties to set + */ + function BuildConfig(properties) { + this.environmentVariables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildConfig name. + * @member {string} name + * @memberof google.cloud.run.v2.BuildConfig + * @instance + */ + BuildConfig.prototype.name = ""; + + /** + * BuildConfig sourceLocation. + * @member {string} sourceLocation + * @memberof google.cloud.run.v2.BuildConfig + * @instance + */ + BuildConfig.prototype.sourceLocation = ""; + + /** + * BuildConfig functionTarget. + * @member {string} functionTarget + * @memberof google.cloud.run.v2.BuildConfig + * @instance + */ + BuildConfig.prototype.functionTarget = ""; + + /** + * BuildConfig imageUri. + * @member {string} imageUri + * @memberof google.cloud.run.v2.BuildConfig + * @instance + */ + BuildConfig.prototype.imageUri = ""; + + /** + * BuildConfig baseImage. + * @member {string} baseImage + * @memberof google.cloud.run.v2.BuildConfig + * @instance + */ + BuildConfig.prototype.baseImage = ""; + + /** + * BuildConfig enableAutomaticUpdates. + * @member {boolean} enableAutomaticUpdates + * @memberof google.cloud.run.v2.BuildConfig + * @instance + */ + BuildConfig.prototype.enableAutomaticUpdates = false; + + /** + * BuildConfig workerPool. + * @member {string} workerPool + * @memberof google.cloud.run.v2.BuildConfig + * @instance + */ + BuildConfig.prototype.workerPool = ""; + + /** + * BuildConfig environmentVariables. + * @member {Object.} environmentVariables + * @memberof google.cloud.run.v2.BuildConfig + * @instance + */ + BuildConfig.prototype.environmentVariables = $util.emptyObject; + + /** + * BuildConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.run.v2.BuildConfig + * @instance + */ + BuildConfig.prototype.serviceAccount = ""; + + /** + * Creates a new BuildConfig instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.BuildConfig + * @static + * @param {google.cloud.run.v2.IBuildConfig=} [properties] Properties to set + * @returns {google.cloud.run.v2.BuildConfig} BuildConfig instance + */ + BuildConfig.create = function create(properties) { + return new BuildConfig(properties); + }; + + /** + * Encodes the specified BuildConfig message. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.BuildConfig + * @static + * @param {google.cloud.run.v2.IBuildConfig} message BuildConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sourceLocation != null && Object.hasOwnProperty.call(message, "sourceLocation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLocation); + if (message.functionTarget != null && Object.hasOwnProperty.call(message, "functionTarget")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.functionTarget); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.imageUri); + if (message.baseImage != null && Object.hasOwnProperty.call(message, "baseImage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.baseImage); + if (message.enableAutomaticUpdates != null && Object.hasOwnProperty.call(message, "enableAutomaticUpdates")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableAutomaticUpdates); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.workerPool); + if (message.environmentVariables != null && Object.hasOwnProperty.call(message, "environmentVariables")) + for (var keys = Object.keys(message.environmentVariables), 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.environmentVariables[keys[i]]).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccount); + return writer; + }; + + /** + * Encodes the specified BuildConfig message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.BuildConfig + * @static + * @param {google.cloud.run.v2.IBuildConfig} message BuildConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.BuildConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.BuildConfig} BuildConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.BuildConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceLocation = reader.string(); + break; + } + case 3: { + message.functionTarget = reader.string(); + break; + } + case 4: { + message.imageUri = reader.string(); + break; + } + case 5: { + message.baseImage = reader.string(); + break; + } + case 6: { + message.enableAutomaticUpdates = reader.bool(); + break; + } + case 7: { + message.workerPool = reader.string(); + break; + } + case 8: { + if (message.environmentVariables === $util.emptyObject) + message.environmentVariables = {}; + 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.environmentVariables[key] = value; + break; + } + case 9: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.BuildConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.BuildConfig} BuildConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildConfig message. + * @function verify + * @memberof google.cloud.run.v2.BuildConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) + if (!$util.isString(message.sourceLocation)) + return "sourceLocation: string expected"; + if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) + if (!$util.isString(message.functionTarget)) + return "functionTarget: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.baseImage != null && message.hasOwnProperty("baseImage")) + if (!$util.isString(message.baseImage)) + return "baseImage: string expected"; + if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) + if (typeof message.enableAutomaticUpdates !== "boolean") + return "enableAutomaticUpdates: boolean expected"; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) { + if (!$util.isObject(message.environmentVariables)) + return "environmentVariables: object expected"; + var key = Object.keys(message.environmentVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.environmentVariables[key[i]])) + return "environmentVariables: string{k:string} expected"; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates a BuildConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.BuildConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.BuildConfig} BuildConfig + */ + BuildConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.BuildConfig) + return object; + var message = new $root.google.cloud.run.v2.BuildConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.sourceLocation != null) + message.sourceLocation = String(object.sourceLocation); + if (object.functionTarget != null) + message.functionTarget = String(object.functionTarget); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.baseImage != null) + message.baseImage = String(object.baseImage); + if (object.enableAutomaticUpdates != null) + message.enableAutomaticUpdates = Boolean(object.enableAutomaticUpdates); + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.environmentVariables) { + if (typeof object.environmentVariables !== "object") + throw TypeError(".google.cloud.run.v2.BuildConfig.environmentVariables: object expected"); + message.environmentVariables = {}; + for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i) + message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from a BuildConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.BuildConfig + * @static + * @param {google.cloud.run.v2.BuildConfig} message BuildConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.environmentVariables = {}; + if (options.defaults) { + object.name = ""; + object.sourceLocation = ""; + object.functionTarget = ""; + object.imageUri = ""; + object.baseImage = ""; + object.enableAutomaticUpdates = false; + object.workerPool = ""; + object.serviceAccount = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) + object.sourceLocation = message.sourceLocation; + if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) + object.functionTarget = message.functionTarget; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.baseImage != null && message.hasOwnProperty("baseImage")) + object.baseImage = message.baseImage; + if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) + object.enableAutomaticUpdates = message.enableAutomaticUpdates; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + var keys2; + if (message.environmentVariables && (keys2 = Object.keys(message.environmentVariables)).length) { + object.environmentVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.environmentVariables[keys2[j]] = message.environmentVariables[keys2[j]]; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + return object; + }; + + /** + * Converts this BuildConfig to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.BuildConfig + * @instance + * @returns {Object.} JSON object + */ + BuildConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuildConfig + * @function getTypeUrl + * @memberof google.cloud.run.v2.BuildConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuildConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.BuildConfig"; + }; + + return BuildConfig; + })(); + + /** + * IngressTraffic enum. + * @name google.cloud.run.v2.IngressTraffic + * @enum {number} + * @property {number} INGRESS_TRAFFIC_UNSPECIFIED=0 INGRESS_TRAFFIC_UNSPECIFIED value + * @property {number} INGRESS_TRAFFIC_ALL=1 INGRESS_TRAFFIC_ALL value + * @property {number} INGRESS_TRAFFIC_INTERNAL_ONLY=2 INGRESS_TRAFFIC_INTERNAL_ONLY value + * @property {number} INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER=3 INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER value + * @property {number} INGRESS_TRAFFIC_NONE=4 INGRESS_TRAFFIC_NONE value + */ + v2.IngressTraffic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INGRESS_TRAFFIC_UNSPECIFIED"] = 0; + values[valuesById[1] = "INGRESS_TRAFFIC_ALL"] = 1; + values[valuesById[2] = "INGRESS_TRAFFIC_INTERNAL_ONLY"] = 2; + values[valuesById[3] = "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"] = 3; + values[valuesById[4] = "INGRESS_TRAFFIC_NONE"] = 4; + return values; + })(); + + /** + * ExecutionEnvironment enum. + * @name google.cloud.run.v2.ExecutionEnvironment + * @enum {number} + * @property {number} EXECUTION_ENVIRONMENT_UNSPECIFIED=0 EXECUTION_ENVIRONMENT_UNSPECIFIED value + * @property {number} EXECUTION_ENVIRONMENT_GEN1=1 EXECUTION_ENVIRONMENT_GEN1 value + * @property {number} EXECUTION_ENVIRONMENT_GEN2=2 EXECUTION_ENVIRONMENT_GEN2 value + */ + v2.ExecutionEnvironment = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_ENVIRONMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXECUTION_ENVIRONMENT_GEN1"] = 1; + values[valuesById[2] = "EXECUTION_ENVIRONMENT_GEN2"] = 2; + return values; + })(); + + /** + * EncryptionKeyRevocationAction enum. + * @name google.cloud.run.v2.EncryptionKeyRevocationAction + * @enum {number} + * @property {number} ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED=0 ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED value + * @property {number} PREVENT_NEW=1 PREVENT_NEW value + * @property {number} SHUTDOWN=2 SHUTDOWN value + */ + v2.EncryptionKeyRevocationAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "PREVENT_NEW"] = 1; + values[valuesById[2] = "SHUTDOWN"] = 2; + return values; + })(); + + v2.ExecutionTemplate = (function() { + + /** + * Properties of an ExecutionTemplate. + * @memberof google.cloud.run.v2 + * @interface IExecutionTemplate + * @property {Object.|null} [labels] ExecutionTemplate labels + * @property {Object.|null} [annotations] ExecutionTemplate annotations + * @property {number|null} [parallelism] ExecutionTemplate parallelism + * @property {number|null} [taskCount] ExecutionTemplate taskCount + * @property {google.cloud.run.v2.ITaskTemplate|null} [template] ExecutionTemplate template + */ + + /** + * Constructs a new ExecutionTemplate. + * @memberof google.cloud.run.v2 + * @classdesc Represents an ExecutionTemplate. + * @implements IExecutionTemplate + * @constructor + * @param {google.cloud.run.v2.IExecutionTemplate=} [properties] Properties to set + */ + function ExecutionTemplate(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutionTemplate labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.ExecutionTemplate + * @instance + */ + ExecutionTemplate.prototype.labels = $util.emptyObject; + + /** + * ExecutionTemplate annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.ExecutionTemplate + * @instance + */ + ExecutionTemplate.prototype.annotations = $util.emptyObject; + + /** + * ExecutionTemplate parallelism. + * @member {number} parallelism + * @memberof google.cloud.run.v2.ExecutionTemplate + * @instance + */ + ExecutionTemplate.prototype.parallelism = 0; + + /** + * ExecutionTemplate taskCount. + * @member {number} taskCount + * @memberof google.cloud.run.v2.ExecutionTemplate + * @instance + */ + ExecutionTemplate.prototype.taskCount = 0; + + /** + * ExecutionTemplate template. + * @member {google.cloud.run.v2.ITaskTemplate|null|undefined} template + * @memberof google.cloud.run.v2.ExecutionTemplate + * @instance + */ + ExecutionTemplate.prototype.template = null; + + /** + * Creates a new ExecutionTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ExecutionTemplate + * @static + * @param {google.cloud.run.v2.IExecutionTemplate=} [properties] Properties to set + * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate instance + */ + ExecutionTemplate.create = function create(properties) { + return new ExecutionTemplate(properties); + }; + + /** + * Encodes the specified ExecutionTemplate message. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ExecutionTemplate + * @static + * @param {google.cloud.run.v2.IExecutionTemplate} message ExecutionTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); + if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.parallelism); + if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.taskCount); + if (message.template != null && Object.hasOwnProperty.call(message, "template")) + $root.google.cloud.run.v2.TaskTemplate.encode(message.template, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ExecutionTemplate + * @static + * @param {google.cloud.run.v2.IExecutionTemplate} message ExecutionTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ExecutionTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionTemplate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ExecutionTemplate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + 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 2: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 3: { + message.parallelism = reader.int32(); + break; + } + case 4: { + message.taskCount = reader.int32(); + break; + } + case 5: { + message.template = $root.google.cloud.run.v2.TaskTemplate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ExecutionTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionTemplate message. + * @function verify + * @memberof google.cloud.run.v2.ExecutionTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + if (!$util.isInteger(message.parallelism)) + return "parallelism: integer expected"; + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (!$util.isInteger(message.taskCount)) + return "taskCount: integer expected"; + if (message.template != null && message.hasOwnProperty("template")) { + var error = $root.google.cloud.run.v2.TaskTemplate.verify(message.template); + if (error) + return "template." + error; + } + return null; + }; + + /** + * Creates an ExecutionTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ExecutionTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate + */ + ExecutionTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ExecutionTemplate) + return object; + var message = new $root.google.cloud.run.v2.ExecutionTemplate(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.ExecutionTemplate.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.ExecutionTemplate.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.parallelism != null) + message.parallelism = object.parallelism | 0; + if (object.taskCount != null) + message.taskCount = object.taskCount | 0; + if (object.template != null) { + if (typeof object.template !== "object") + throw TypeError(".google.cloud.run.v2.ExecutionTemplate.template: object expected"); + message.template = $root.google.cloud.run.v2.TaskTemplate.fromObject(object.template); + } + return message; + }; + + /** + * Creates a plain object from an ExecutionTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ExecutionTemplate + * @static + * @param {google.cloud.run.v2.ExecutionTemplate} message ExecutionTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutionTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.parallelism = 0; + object.taskCount = 0; + object.template = null; + } + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + object.parallelism = message.parallelism; + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + object.taskCount = message.taskCount; + if (message.template != null && message.hasOwnProperty("template")) + object.template = $root.google.cloud.run.v2.TaskTemplate.toObject(message.template, options); + return object; + }; + + /** + * Converts this ExecutionTemplate to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ExecutionTemplate + * @instance + * @returns {Object.} JSON object + */ + ExecutionTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutionTemplate + * @function getTypeUrl + * @memberof google.cloud.run.v2.ExecutionTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ExecutionTemplate"; + }; + + return ExecutionTemplate; + })(); + + v2.Instances = (function() { + + /** + * Constructs a new Instances service. + * @memberof google.cloud.run.v2 + * @classdesc Represents an Instances + * @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 Instances(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Instances.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Instances; + + /** + * Creates new Instances service using the specified rpc implementation. + * @function create + * @memberof google.cloud.run.v2.Instances + * @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 {Instances} RPC service. Useful where requests and/or responses are streamed. + */ + Instances.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|createInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.run.v2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|deleteInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.run.v2.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|getInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.run.v2.GetInstanceRequest, $root.google.cloud.run.v2.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|listInstances}. + * @memberof google.cloud.run.v2.Instances + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.run.v2.Instances.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.run.v2.ListInstancesRequest, $root.google.cloud.run.v2.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|stopInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef StopInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StopInstance. + * @function stopInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStopInstanceRequest} request StopInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.StopInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.stopInstance = function stopInstance(request, callback) { + return this.rpcCall(stopInstance, $root.google.cloud.run.v2.StopInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StopInstance" }); + + /** + * Calls StopInstance. + * @function stopInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStopInstanceRequest} request StopInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|startInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef StartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StartInstance. + * @function startInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStartInstanceRequest} request StartInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.StartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.startInstance = function startInstance(request, callback) { + return this.rpcCall(startInstance, $root.google.cloud.run.v2.StartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartInstance" }); + + /** + * Calls StartInstance. + * @function startInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStartInstanceRequest} request StartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Instances; + })(); + + v2.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {google.cloud.run.v2.IInstance|null} [instance] CreateInstanceRequest instance + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.run.v2.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.run.v2.IInstance|null|undefined} instance + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.run.v2.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instance = $root.google.cloud.run.v2.Instance.decode(reader, reader.uint32()); + break; + } + case 3: { + message.instanceId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.run.v2.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.run.v2.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.run.v2.Instance.fromObject(object.instance); + } + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instance = null; + object.instanceId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.run.v2.Instance.toObject(message.instance, options); + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v2.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GetInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v2.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly + * @property {string|null} [etag] DeleteInstanceRequest etag + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * DeleteInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.validateOnly = false; + + /** + * DeleteInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.etag = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v2.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.run.v2 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {boolean|null} [showDeleted] ListInstancesRequest showDeleted + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.run.v2.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.showDeleted = false; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListInstancesRequest) + return object; + var message = new $root.google.cloud.run.v2.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + 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.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v2.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.run.v2 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.run.v2.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + 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]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.run.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.run.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.run.v2.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.run.v2.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.run.v2.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListInstancesResponse) + return object; + var message = new $root.google.cloud.run.v2.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.run.v2.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.run.v2.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.run.v2.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.run.v2.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v2.StopInstanceRequest = (function() { + + /** + * Properties of a StopInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IStopInstanceRequest + * @property {string|null} [name] StopInstanceRequest name + * @property {boolean|null} [validateOnly] StopInstanceRequest validateOnly + * @property {string|null} [etag] StopInstanceRequest etag + */ + + /** + * Constructs a new StopInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a StopInstanceRequest. + * @implements IStopInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IStopInstanceRequest=} [properties] Properties to set + */ + function StopInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.name = ""; + + /** + * StopInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.validateOnly = false; + + /** + * StopInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.etag = ""; + + /** + * Creates a new StopInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.IStopInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest instance + */ + StopInstanceRequest.create = function create(properties) { + return new StopInstanceRequest(properties); + }; + + /** + * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StopInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest + */ + StopInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.StopInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.StopInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.StopInstanceRequest} message StopInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this StopInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + StopInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.StopInstanceRequest"; + }; + + return StopInstanceRequest; + })(); + + v2.StartInstanceRequest = (function() { + + /** + * Properties of a StartInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IStartInstanceRequest + * @property {string|null} [name] StartInstanceRequest name + * @property {boolean|null} [validateOnly] StartInstanceRequest validateOnly + * @property {string|null} [etag] StartInstanceRequest etag + */ + + /** + * Constructs a new StartInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a StartInstanceRequest. + * @implements IStartInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IStartInstanceRequest=} [properties] Properties to set + */ + function StartInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.name = ""; + + /** + * StartInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.validateOnly = false; + + /** + * StartInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.etag = ""; + + /** + * Creates a new StartInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.IStartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest instance + */ + StartInstanceRequest.create = function create(properties) { + return new StartInstanceRequest(properties); + }; + + /** + * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StartInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest + */ + StartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.StartInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.StartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.StartInstanceRequest} message StartInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this StartInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + StartInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.StartInstanceRequest"; + }; + + return StartInstanceRequest; + })(); + + v2.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.run.v2 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [description] Instance description + * @property {string|null} [uid] Instance uid + * @property {number|Long|null} [generation] Instance generation + * @property {Object.|null} [labels] Instance labels + * @property {Object.|null} [annotations] Instance annotations + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Instance expireTime + * @property {string|null} [creator] Instance creator + * @property {string|null} [lastModifier] Instance lastModifier + * @property {string|null} [client] Instance client + * @property {string|null} [clientVersion] Instance clientVersion + * @property {google.api.LaunchStage|null} [launchStage] Instance launchStage + * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Instance binaryAuthorization + * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Instance vpcAccess + * @property {string|null} [serviceAccount] Instance serviceAccount + * @property {Array.|null} [containers] Instance containers + * @property {Array.|null} [volumes] Instance volumes + * @property {string|null} [encryptionKey] Instance encryptionKey + * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] Instance encryptionKeyRevocationAction + * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] Instance encryptionKeyShutdownDuration + * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Instance nodeSelector + * @property {boolean|null} [gpuZonalRedundancyDisabled] Instance gpuZonalRedundancyDisabled + * @property {google.cloud.run.v2.IngressTraffic|null} [ingress] Instance ingress + * @property {boolean|null} [invokerIamDisabled] Instance invokerIamDisabled + * @property {boolean|null} [iapEnabled] Instance iapEnabled + * @property {number|Long|null} [observedGeneration] Instance observedGeneration + * @property {string|null} [logUri] Instance logUri + * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Instance terminalCondition + * @property {Array.|null} [conditions] Instance conditions + * @property {Array.|null} [containerStatuses] Instance containerStatuses + * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs + * @property {Array.|null} [urls] Instance urls + * @property {boolean|null} [reconciling] Instance reconciling + * @property {string|null} [etag] Instance etag + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.run.v2 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.run.v2.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.annotations = {}; + this.containers = []; + this.volumes = []; + this.conditions = []; + this.containerStatuses = []; + this.urls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance description. + * @member {string} description + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.description = ""; + + /** + * Instance uid. + * @member {string} uid + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.uid = ""; + + /** + * Instance generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.annotations = $util.emptyObject; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.deleteTime = null; + + /** + * Instance expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.expireTime = null; + + /** + * Instance creator. + * @member {string} creator + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.creator = ""; + + /** + * Instance lastModifier. + * @member {string} lastModifier + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.lastModifier = ""; + + /** + * Instance client. + * @member {string} client + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.client = ""; + + /** + * Instance clientVersion. + * @member {string} clientVersion + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.clientVersion = ""; + + /** + * Instance launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.launchStage = 0; + + /** + * Instance binaryAuthorization. + * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.binaryAuthorization = null; + + /** + * Instance vpcAccess. + * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.vpcAccess = null; + + /** + * Instance serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.serviceAccount = ""; + + /** + * Instance containers. + * @member {Array.} containers + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.containers = $util.emptyArray; + + /** + * Instance volumes. + * @member {Array.} volumes + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.volumes = $util.emptyArray; + + /** + * Instance encryptionKey. + * @member {string} encryptionKey + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.encryptionKey = ""; + + /** + * Instance encryptionKeyRevocationAction. + * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.encryptionKeyRevocationAction = 0; + + /** + * Instance encryptionKeyShutdownDuration. + * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.encryptionKeyShutdownDuration = null; + + /** + * Instance nodeSelector. + * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.nodeSelector = null; + + /** + * Instance gpuZonalRedundancyDisabled. + * @member {boolean|null|undefined} gpuZonalRedundancyDisabled + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.gpuZonalRedundancyDisabled = null; + + /** + * Instance ingress. + * @member {google.cloud.run.v2.IngressTraffic} ingress + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.ingress = 0; + + /** + * Instance invokerIamDisabled. + * @member {boolean} invokerIamDisabled + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.invokerIamDisabled = false; + + /** + * Instance iapEnabled. + * @member {boolean} iapEnabled + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.iapEnabled = false; + + /** + * Instance observedGeneration. + * @member {number|Long} observedGeneration + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance logUri. + * @member {string} logUri + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.logUri = ""; + + /** + * Instance terminalCondition. + * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.terminalCondition = null; + + /** + * Instance conditions. + * @member {Array.} conditions + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.conditions = $util.emptyArray; + + /** + * Instance containerStatuses. + * @member {Array.} containerStatuses + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.containerStatuses = $util.emptyArray; + + /** + * Instance satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = false; + + /** + * Instance urls. + * @member {Array.} urls + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.urls = $util.emptyArray; + + /** + * Instance reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.reconciling = false; + + /** + * Instance etag. + * @member {string} etag + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Instance.prototype, "_gpuZonalRedundancyDisabled", { + get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.IInstance=} [properties] Properties to set + * @returns {google.cloud.run.v2.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uid); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.generation); + 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.creator); + if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.lastModifier); + if (message.client != null && Object.hasOwnProperty.call(message, "client")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.client); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.clientVersion); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); + if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) + $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) + $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.serviceAccount); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.encryptionKey); + if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.encryptionKeyRevocationAction); + if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) + $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) + $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.gpuZonalRedundancyDisabled); + if (message.ingress != null && Object.hasOwnProperty.call(message, "ingress")) + writer.uint32(/* id 28, wireType 0 =*/224).int32(message.ingress); + if (message.invokerIamDisabled != null && Object.hasOwnProperty.call(message, "invokerIamDisabled")) + writer.uint32(/* id 29, wireType 0 =*/232).bool(message.invokerIamDisabled); + if (message.iapEnabled != null && Object.hasOwnProperty.call(message, "iapEnabled")) + writer.uint32(/* id 30, wireType 0 =*/240).bool(message.iapEnabled); + if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) + writer.uint32(/* id 40, wireType 0 =*/320).int64(message.observedGeneration); + if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.logUri); + if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) + $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.containerStatuses != null && message.containerStatuses.length) + for (var i = 0; i < message.containerStatuses.length; ++i) + $root.google.cloud.run.v2.ContainerStatus.encode(message.containerStatuses[i], writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.urls != null && message.urls.length) + for (var i = 0; i < message.urls.length; ++i) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.urls[i]); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 46, wireType 0 =*/368).bool(message.satisfiesPzs); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.uid = reader.string(); + break; + } + case 5: { + message.generation = reader.int64(); + 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: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.creator = reader.string(); + break; + } + case 13: { + message.lastModifier = reader.string(); + break; + } + case 14: { + message.client = reader.string(); + break; + } + case 15: { + message.clientVersion = reader.string(); + break; + } + case 16: { + message.launchStage = reader.int32(); + break; + } + case 17: { + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); + break; + } + case 18: { + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); + break; + } + case 19: { + message.serviceAccount = reader.string(); + break; + } + case 20: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); + break; + } + case 21: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); + break; + } + case 22: { + message.encryptionKey = reader.string(); + break; + } + case 24: { + message.encryptionKeyRevocationAction = reader.int32(); + break; + } + case 25: { + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 26: { + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); + break; + } + case 27: { + message.gpuZonalRedundancyDisabled = reader.bool(); + break; + } + case 28: { + message.ingress = reader.int32(); + break; + } + case 29: { + message.invokerIamDisabled = reader.bool(); + break; + } + case 30: { + message.iapEnabled = reader.bool(); + break; + } + case 40: { + message.observedGeneration = reader.int64(); + break; + } + case 41: { + message.logUri = reader.string(); + break; + } + case 42: { + message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); + break; + } + case 43: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); + break; + } + case 44: { + if (!(message.containerStatuses && message.containerStatuses.length)) + message.containerStatuses = []; + message.containerStatuses.push($root.google.cloud.run.v2.ContainerStatus.decode(reader, reader.uint32())); + break; + } + case 46: { + message.satisfiesPzs = reader.bool(); + break; + } + case 45: { + if (!(message.urls && message.urls.length)) + message.urls = []; + message.urls.push(reader.string()); + break; + } + case 98: { + message.reconciling = reader.bool(); + break; + } + case 99: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.run.v2.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + if (!$util.isString(message.lastModifier)) + return "lastModifier: string expected"; + if (message.client != null && message.hasOwnProperty("client")) + if (!$util.isString(message.client)) + return "client: string expected"; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { + var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); + if (error) + return "binaryAuthorization." + error; + } + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { + var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); + if (error) + return "vpcAccess." + error; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + 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.run.v2.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + if (!$util.isString(message.encryptionKey)) + return "encryptionKey: string expected"; + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + switch (message.encryptionKeyRevocationAction) { + default: + return "encryptionKeyRevocationAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { + var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); + if (error) + return "encryptionKeyShutdownDuration." + error; + } + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { + var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); + if (error) + return "nodeSelector." + error; + } + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + properties._gpuZonalRedundancyDisabled = 1; + if (typeof message.gpuZonalRedundancyDisabled !== "boolean") + return "gpuZonalRedundancyDisabled: boolean expected"; + } + if (message.ingress != null && message.hasOwnProperty("ingress")) + switch (message.ingress) { + default: + return "ingress: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) + if (typeof message.invokerIamDisabled !== "boolean") + return "invokerIamDisabled: boolean expected"; + if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) + if (typeof message.iapEnabled !== "boolean") + return "iapEnabled: boolean expected"; + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) + return "observedGeneration: integer|Long expected"; + if (message.logUri != null && message.hasOwnProperty("logUri")) + if (!$util.isString(message.logUri)) + return "logUri: string expected"; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { + var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); + if (error) + return "terminalCondition." + error; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.containerStatuses != null && message.hasOwnProperty("containerStatuses")) { + if (!Array.isArray(message.containerStatuses)) + return "containerStatuses: array expected"; + for (var i = 0; i < message.containerStatuses.length; ++i) { + var error = $root.google.cloud.run.v2.ContainerStatus.verify(message.containerStatuses[i]); + if (error) + return "containerStatuses." + error; + } + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.urls != null && message.hasOwnProperty("urls")) { + if (!Array.isArray(message.urls)) + return "urls: array expected"; + for (var i = 0; i < message.urls.length; ++i) + if (!$util.isString(message.urls[i])) + return "urls: string[] expected"; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Instance) + return object; + var message = new $root.google.cloud.run.v2.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.uid != null) + message.uid = String(object.uid); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.Instance.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.lastModifier != null) + message.lastModifier = String(object.lastModifier); + if (object.client != null) + message.client = String(object.client); + if (object.clientVersion != null) + message.clientVersion = String(object.clientVersion); + 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.binaryAuthorization != null) { + if (typeof object.binaryAuthorization !== "object") + throw TypeError(".google.cloud.run.v2.Instance.binaryAuthorization: object expected"); + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); + } + if (object.vpcAccess != null) { + if (typeof object.vpcAccess !== "object") + throw TypeError(".google.cloud.run.v2.Instance.vpcAccess: object expected"); + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.run.v2.Instance.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.containers: object expected"); + message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); + } + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.run.v2.Instance.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.volumes: object expected"); + message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); + } + } + if (object.encryptionKey != null) + message.encryptionKey = String(object.encryptionKey); + switch (object.encryptionKeyRevocationAction) { + default: + if (typeof object.encryptionKeyRevocationAction === "number") { + message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; + break; + } + break; + case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": + case 0: + message.encryptionKeyRevocationAction = 0; + break; + case "PREVENT_NEW": + case 1: + message.encryptionKeyRevocationAction = 1; + break; + case "SHUTDOWN": + case 2: + message.encryptionKeyRevocationAction = 2; + break; + } + if (object.encryptionKeyShutdownDuration != null) { + if (typeof object.encryptionKeyShutdownDuration !== "object") + throw TypeError(".google.cloud.run.v2.Instance.encryptionKeyShutdownDuration: object expected"); + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); + } + if (object.nodeSelector != null) { + if (typeof object.nodeSelector !== "object") + throw TypeError(".google.cloud.run.v2.Instance.nodeSelector: object expected"); + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); + } + if (object.gpuZonalRedundancyDisabled != null) + message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); + switch (object.ingress) { + default: + if (typeof object.ingress === "number") { + message.ingress = object.ingress; + break; + } + break; + case "INGRESS_TRAFFIC_UNSPECIFIED": + case 0: + message.ingress = 0; + break; + case "INGRESS_TRAFFIC_ALL": + case 1: + message.ingress = 1; + break; + case "INGRESS_TRAFFIC_INTERNAL_ONLY": + case 2: + message.ingress = 2; + break; + case "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": + case 3: + message.ingress = 3; + break; + case "INGRESS_TRAFFIC_NONE": + case 4: + message.ingress = 4; + break; + } + if (object.invokerIamDisabled != null) + message.invokerIamDisabled = Boolean(object.invokerIamDisabled); + if (object.iapEnabled != null) + message.iapEnabled = Boolean(object.iapEnabled); + if (object.observedGeneration != null) + if ($util.Long) + (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; + else if (typeof object.observedGeneration === "string") + message.observedGeneration = parseInt(object.observedGeneration, 10); + else if (typeof object.observedGeneration === "number") + message.observedGeneration = object.observedGeneration; + else if (typeof object.observedGeneration === "object") + message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); + if (object.logUri != null) + message.logUri = String(object.logUri); + if (object.terminalCondition != null) { + if (typeof object.terminalCondition !== "object") + throw TypeError(".google.cloud.run.v2.Instance.terminalCondition: object expected"); + message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); + } + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.run.v2.Instance.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.conditions: object expected"); + message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); + } + } + if (object.containerStatuses) { + if (!Array.isArray(object.containerStatuses)) + throw TypeError(".google.cloud.run.v2.Instance.containerStatuses: array expected"); + message.containerStatuses = []; + for (var i = 0; i < object.containerStatuses.length; ++i) { + if (typeof object.containerStatuses[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.containerStatuses: object expected"); + message.containerStatuses[i] = $root.google.cloud.run.v2.ContainerStatus.fromObject(object.containerStatuses[i]); + } + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.urls) { + if (!Array.isArray(object.urls)) + throw TypeError(".google.cloud.run.v2.Instance.urls: array expected"); + message.urls = []; + for (var i = 0; i < object.urls.length; ++i) + message.urls[i] = String(object.urls[i]); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.containers = []; + object.volumes = []; + object.conditions = []; + object.containerStatuses = []; + object.urls = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.creator = ""; + object.lastModifier = ""; + object.client = ""; + object.clientVersion = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.binaryAuthorization = null; + object.vpcAccess = null; + object.serviceAccount = ""; + object.encryptionKey = ""; + object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; + object.encryptionKeyShutdownDuration = null; + object.nodeSelector = null; + object.ingress = options.enums === String ? "INGRESS_TRAFFIC_UNSPECIFIED" : 0; + object.invokerIamDisabled = false; + object.iapEnabled = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.observedGeneration = options.longs === String ? "0" : 0; + object.logUri = ""; + object.terminalCondition = null; + object.satisfiesPzs = false; + object.reconciling = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + object.lastModifier = message.lastModifier; + if (message.client != null && message.hasOwnProperty("client")) + object.client = message.client; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) + object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) + object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = message.encryptionKey; + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) + object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) + object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; + if (options.oneofs) + object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; + } + if (message.ingress != null && message.hasOwnProperty("ingress")) + object.ingress = options.enums === String ? $root.google.cloud.run.v2.IngressTraffic[message.ingress] === undefined ? message.ingress : $root.google.cloud.run.v2.IngressTraffic[message.ingress] : message.ingress; + if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) + object.invokerIamDisabled = message.invokerIamDisabled; + if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) + object.iapEnabled = message.iapEnabled; + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (typeof message.observedGeneration === "number") + object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; + else + object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; + if (message.logUri != null && message.hasOwnProperty("logUri")) + object.logUri = message.logUri; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) + object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); + } + if (message.containerStatuses && message.containerStatuses.length) { + object.containerStatuses = []; + for (var j = 0; j < message.containerStatuses.length; ++j) + object.containerStatuses[j] = $root.google.cloud.run.v2.ContainerStatus.toObject(message.containerStatuses[j], options); + } + if (message.urls && message.urls.length) { + object.urls = []; + for (var j = 0; j < message.urls.length; ++j) + object.urls[j] = message.urls[j]; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.run.v2.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.Instance"; + }; + + return Instance; + })(); + + v2.InstanceSplit = (function() { + + /** + * Properties of an InstanceSplit. + * @memberof google.cloud.run.v2 + * @interface IInstanceSplit + * @property {google.cloud.run.v2.InstanceSplitAllocationType|null} [type] InstanceSplit type + * @property {string|null} [revision] InstanceSplit revision + * @property {number|null} [percent] InstanceSplit percent + */ + + /** + * Constructs a new InstanceSplit. + * @memberof google.cloud.run.v2 + * @classdesc Represents an InstanceSplit. + * @implements IInstanceSplit + * @constructor + * @param {google.cloud.run.v2.IInstanceSplit=} [properties] Properties to set + */ + function InstanceSplit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceSplit type. + * @member {google.cloud.run.v2.InstanceSplitAllocationType} type + * @memberof google.cloud.run.v2.InstanceSplit + * @instance + */ + InstanceSplit.prototype.type = 0; + + /** + * InstanceSplit revision. + * @member {string} revision + * @memberof google.cloud.run.v2.InstanceSplit + * @instance + */ + InstanceSplit.prototype.revision = ""; + + /** + * InstanceSplit percent. + * @member {number} percent + * @memberof google.cloud.run.v2.InstanceSplit + * @instance + */ + InstanceSplit.prototype.percent = 0; + + /** + * Creates a new InstanceSplit instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.InstanceSplit + * @static + * @param {google.cloud.run.v2.IInstanceSplit=} [properties] Properties to set + * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit instance + */ + InstanceSplit.create = function create(properties) { + return new InstanceSplit(properties); + }; + + /** + * Encodes the specified InstanceSplit message. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.InstanceSplit + * @static + * @param {google.cloud.run.v2.IInstanceSplit} message InstanceSplit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceSplit.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.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); + if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); + return writer; + }; + + /** + * Encodes the specified InstanceSplit message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.InstanceSplit + * @static + * @param {google.cloud.run.v2.IInstanceSplit} message InstanceSplit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceSplit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceSplit message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.InstanceSplit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceSplit.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.InstanceSplit(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.revision = reader.string(); + break; + } + case 3: { + message.percent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceSplit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.InstanceSplit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceSplit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceSplit message. + * @function verify + * @memberof google.cloud.run.v2.InstanceSplit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceSplit.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.revision != null && message.hasOwnProperty("revision")) + if (!$util.isString(message.revision)) + return "revision: string expected"; + if (message.percent != null && message.hasOwnProperty("percent")) + if (!$util.isInteger(message.percent)) + return "percent: integer expected"; + return null; + }; + + /** + * Creates an InstanceSplit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.InstanceSplit + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit + */ + InstanceSplit.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.InstanceSplit) + return object; + var message = new $root.google.cloud.run.v2.InstanceSplit(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST": + case 1: + message.type = 1; + break; + case "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION": + case 2: + message.type = 2; + break; + } + if (object.revision != null) + message.revision = String(object.revision); + if (object.percent != null) + message.percent = object.percent | 0; + return message; + }; + + /** + * Creates a plain object from an InstanceSplit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.InstanceSplit + * @static + * @param {google.cloud.run.v2.InstanceSplit} message InstanceSplit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceSplit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED" : 0; + object.revision = ""; + object.percent = 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] : message.type; + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.percent != null && message.hasOwnProperty("percent")) + object.percent = message.percent; + return object; + }; + + /** + * Converts this InstanceSplit to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.InstanceSplit + * @instance + * @returns {Object.} JSON object + */ + InstanceSplit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceSplit + * @function getTypeUrl + * @memberof google.cloud.run.v2.InstanceSplit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceSplit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.InstanceSplit"; + }; + + return InstanceSplit; + })(); + + v2.InstanceSplitStatus = (function() { + + /** + * Properties of an InstanceSplitStatus. + * @memberof google.cloud.run.v2 + * @interface IInstanceSplitStatus + * @property {google.cloud.run.v2.InstanceSplitAllocationType|null} [type] InstanceSplitStatus type + * @property {string|null} [revision] InstanceSplitStatus revision + * @property {number|null} [percent] InstanceSplitStatus percent + */ + + /** + * Constructs a new InstanceSplitStatus. + * @memberof google.cloud.run.v2 + * @classdesc Represents an InstanceSplitStatus. + * @implements IInstanceSplitStatus + * @constructor + * @param {google.cloud.run.v2.IInstanceSplitStatus=} [properties] Properties to set + */ + function InstanceSplitStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceSplitStatus type. + * @member {google.cloud.run.v2.InstanceSplitAllocationType} type + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @instance + */ + InstanceSplitStatus.prototype.type = 0; + + /** + * InstanceSplitStatus revision. + * @member {string} revision + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @instance + */ + InstanceSplitStatus.prototype.revision = ""; + + /** + * InstanceSplitStatus percent. + * @member {number} percent + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @instance + */ + InstanceSplitStatus.prototype.percent = 0; + + /** + * Creates a new InstanceSplitStatus instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @static + * @param {google.cloud.run.v2.IInstanceSplitStatus=} [properties] Properties to set + * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus instance + */ + InstanceSplitStatus.create = function create(properties) { + return new InstanceSplitStatus(properties); + }; + + /** + * Encodes the specified InstanceSplitStatus message. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @static + * @param {google.cloud.run.v2.IInstanceSplitStatus} message InstanceSplitStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceSplitStatus.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.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); + if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); + return writer; + }; + + /** + * Encodes the specified InstanceSplitStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @static + * @param {google.cloud.run.v2.IInstanceSplitStatus} message InstanceSplitStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceSplitStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceSplitStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceSplitStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.InstanceSplitStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.revision = reader.string(); + break; + } + case 3: { + message.percent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceSplitStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceSplitStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceSplitStatus message. + * @function verify + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceSplitStatus.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.revision != null && message.hasOwnProperty("revision")) + if (!$util.isString(message.revision)) + return "revision: string expected"; + if (message.percent != null && message.hasOwnProperty("percent")) + if (!$util.isInteger(message.percent)) + return "percent: integer expected"; + return null; + }; + + /** + * Creates an InstanceSplitStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus + */ + InstanceSplitStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.InstanceSplitStatus) + return object; + var message = new $root.google.cloud.run.v2.InstanceSplitStatus(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST": + case 1: + message.type = 1; + break; + case "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION": + case 2: + message.type = 2; + break; + } + if (object.revision != null) + message.revision = String(object.revision); + if (object.percent != null) + message.percent = object.percent | 0; + return message; + }; + + /** + * Creates a plain object from an InstanceSplitStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @static + * @param {google.cloud.run.v2.InstanceSplitStatus} message InstanceSplitStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceSplitStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED" : 0; + object.revision = ""; + object.percent = 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] : message.type; + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.percent != null && message.hasOwnProperty("percent")) + object.percent = message.percent; + return object; + }; + + /** + * Converts this InstanceSplitStatus to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @instance + * @returns {Object.} JSON object + */ + InstanceSplitStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceSplitStatus + * @function getTypeUrl + * @memberof google.cloud.run.v2.InstanceSplitStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceSplitStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.InstanceSplitStatus"; + }; + + return InstanceSplitStatus; + })(); + + /** + * InstanceSplitAllocationType enum. + * @name google.cloud.run.v2.InstanceSplitAllocationType + * @enum {number} + * @property {number} INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED=0 INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED value + * @property {number} INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST=1 INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST value + * @property {number} INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION=2 INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION value + */ + v2.InstanceSplitAllocationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST"] = 1; + values[valuesById[2] = "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION"] = 2; + return values; + })(); + + v2.Jobs = (function() { + + /** + * Constructs a new Jobs service. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Jobs + * @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 Jobs(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Jobs.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Jobs; + + /** + * Creates new Jobs service using the specified rpc implementation. + * @function create + * @memberof google.cloud.run.v2.Jobs + * @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 {Jobs} RPC service. Useful where requests and/or responses are streamed. + */ + Jobs.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|createJob}. + * @memberof google.cloud.run.v2.Jobs + * @typedef CreateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.ICreateJobRequest} request CreateJobRequest message or plain object + * @param {google.cloud.run.v2.Jobs.CreateJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Jobs.prototype.createJob = function createJob(request, callback) { + return this.rpcCall(createJob, $root.google.cloud.run.v2.CreateJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateJob" }); + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.ICreateJobRequest} request CreateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|getJob}. + * @memberof google.cloud.run.v2.Jobs + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.run.v2.Jobs.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Jobs.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.cloud.run.v2.GetJobRequest, $root.google.cloud.run.v2.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|listJobs}. + * @memberof google.cloud.run.v2.Jobs + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.run.v2.Jobs.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Jobs.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.cloud.run.v2.ListJobsRequest, $root.google.cloud.run.v2.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|updateJob}. + * @memberof google.cloud.run.v2.Jobs + * @typedef UpdateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @param {google.cloud.run.v2.Jobs.UpdateJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Jobs.prototype.updateJob = function updateJob(request, callback) { + return this.rpcCall(updateJob, $root.google.cloud.run.v2.UpdateJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateJob" }); + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|deleteJob}. + * @memberof google.cloud.run.v2.Jobs + * @typedef DeleteJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @param {google.cloud.run.v2.Jobs.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Jobs.prototype.deleteJob = function deleteJob(request, callback) { + return this.rpcCall(deleteJob, $root.google.cloud.run.v2.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteJob" }); + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|runJob}. + * @memberof google.cloud.run.v2.Jobs + * @typedef RunJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunJob. + * @function runJob + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.IRunJobRequest} request RunJobRequest message or plain object + * @param {google.cloud.run.v2.Jobs.RunJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Jobs.prototype.runJob = function runJob(request, callback) { + return this.rpcCall(runJob, $root.google.cloud.run.v2.RunJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunJob" }); + + /** + * Calls RunJob. + * @function runJob + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.cloud.run.v2.IRunJobRequest} request RunJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|getIamPolicy}. + * @memberof google.cloud.run.v2.Jobs + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.run.v2.Jobs.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Jobs.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|setIamPolicy}. + * @memberof google.cloud.run.v2.Jobs + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.run.v2.Jobs.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Jobs.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Jobs|testIamPermissions}. + * @memberof google.cloud.run.v2.Jobs + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.run.v2.Jobs.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Jobs.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.run.v2.Jobs + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Jobs; + })(); + + v2.CreateJobRequest = (function() { + + /** + * Properties of a CreateJobRequest. + * @memberof google.cloud.run.v2 + * @interface ICreateJobRequest + * @property {string|null} [parent] CreateJobRequest parent + * @property {google.cloud.run.v2.IJob|null} [job] CreateJobRequest job + * @property {string|null} [jobId] CreateJobRequest jobId + * @property {boolean|null} [validateOnly] CreateJobRequest validateOnly + */ + + /** + * Constructs a new CreateJobRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a CreateJobRequest. + * @implements ICreateJobRequest + * @constructor + * @param {google.cloud.run.v2.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.run.v2.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.parent = ""; + + /** + * CreateJobRequest job. + * @member {google.cloud.run.v2.IJob|null|undefined} job + * @memberof google.cloud.run.v2.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.job = null; + + /** + * CreateJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.run.v2.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.jobId = ""; + + /** + * CreateJobRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.CreateJobRequest + * @static + * @param {google.cloud.run.v2.ICreateJobRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.CreateJobRequest} CreateJobRequest instance + */ + CreateJobRequest.create = function create(properties) { + return new CreateJobRequest(properties); + }; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.run.v2.CreateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.CreateJobRequest + * @static + * @param {google.cloud.run.v2.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.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.run.v2.Job.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.CreateJobRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.job = $root.google.cloud.run.v2.Job.decode(reader, reader.uint32()); + break; + } + case 3: { + message.jobId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + 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.run.v2.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.run.v2.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.CreateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.CreateJobRequest} CreateJobRequest + */ + CreateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.CreateJobRequest) + return object; + var message = new $root.google.cloud.run.v2.CreateJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.run.v2.CreateJobRequest.job: object expected"); + message.job = $root.google.cloud.run.v2.Job.fromObject(object.job); + } + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.CreateJobRequest + * @static + * @param {google.cloud.run.v2.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.job = null; + object.jobId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.run.v2.Job.toObject(message.job, options); + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.CreateJobRequest"; + }; + + return CreateJobRequest; + })(); + + v2.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.run.v2 + * @interface IGetJobRequest + * @property {string|null} [name] GetJobRequest name + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.run.v2.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.run.v2.GetJobRequest + * @instance + */ + GetJobRequest.prototype.name = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GetJobRequest + * @static + * @param {google.cloud.run.v2.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.run.v2.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GetJobRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GetJobRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GetJobRequest) + return object; + var message = new $root.google.cloud.run.v2.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.run.v2.GetJobRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v2.UpdateJobRequest = (function() { + + /** + * Properties of an UpdateJobRequest. + * @memberof google.cloud.run.v2 + * @interface IUpdateJobRequest + * @property {google.cloud.run.v2.IJob|null} [job] UpdateJobRequest job + * @property {boolean|null} [validateOnly] UpdateJobRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateJobRequest allowMissing + */ + + /** + * Constructs a new UpdateJobRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents an UpdateJobRequest. + * @implements IUpdateJobRequest + * @constructor + * @param {google.cloud.run.v2.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.run.v2.IJob|null|undefined} job + * @memberof google.cloud.run.v2.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.job = null; + + /** + * UpdateJobRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.validateOnly = false; + + /** + * UpdateJobRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.run.v2.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.UpdateJobRequest + * @static + * @param {google.cloud.run.v2.IUpdateJobRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.UpdateJobRequest} UpdateJobRequest instance + */ + UpdateJobRequest.create = function create(properties) { + return new UpdateJobRequest(properties); + }; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.UpdateJobRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.UpdateJobRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.UpdateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.job = $root.google.cloud.run.v2.Job.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + 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.run.v2.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.UpdateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.UpdateJobRequest} UpdateJobRequest + */ + UpdateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.UpdateJobRequest) + return object; + var message = new $root.google.cloud.run.v2.UpdateJobRequest(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.run.v2.UpdateJobRequest.job: object expected"); + message.job = $root.google.cloud.run.v2.Job.fromObject(object.job); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.UpdateJobRequest + * @static + * @param {google.cloud.run.v2.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.validateOnly = false; + object.allowMissing = false; + } + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.run.v2.Job.toObject(message.job, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.UpdateJobRequest"; + }; + + return UpdateJobRequest; + })(); + + v2.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.run.v2 + * @interface IListJobsRequest + * @property {string|null} [parent] ListJobsRequest parent + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {string|null} [pageToken] ListJobsRequest pageToken + * @property {boolean|null} [showDeleted] ListJobsRequest showDeleted + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.run.v2.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.run.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.parent = ""; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.run.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.run.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * ListJobsRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.run.v2.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.showDeleted = false; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListJobsRequest + * @static + * @param {google.cloud.run.v2.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.run.v2.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListJobsRequest + * @static + * @param {google.cloud.run.v2.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListJobsRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + 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.run.v2.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListJobsRequest) + return object; + var message = new $root.google.cloud.run.v2.ListJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListJobsRequest + * @static + * @param {google.cloud.run.v2.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.showDeleted = false; + } + 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.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListJobsRequest"; + }; + + return ListJobsRequest; + })(); + + v2.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.cloud.run.v2 + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.cloud.run.v2.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + if (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.run.v2.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.run.v2.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListJobsResponse + * @static + * @param {google.cloud.run.v2.IListJobsResponse=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.run.v2.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListJobsResponse + * @static + * @param {google.cloud.run.v2.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.run.v2.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); + return writer; + }; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListJobsResponse + * @static + * @param {google.cloud.run.v2.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.run.v2.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.run.v2.Job.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = 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.run.v2.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.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"; + return null; + }; + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListJobsResponse) + return object; + var message = new $root.google.cloud.run.v2.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.run.v2.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.run.v2.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.run.v2.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListJobsResponse + * @static + * @param {google.cloud.run.v2.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 = []; + 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.run.v2.Job.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v2.DeleteJobRequest = (function() { + + /** + * Properties of a DeleteJobRequest. + * @memberof google.cloud.run.v2 + * @interface IDeleteJobRequest + * @property {string|null} [name] DeleteJobRequest name + * @property {boolean|null} [validateOnly] DeleteJobRequest validateOnly + * @property {string|null} [etag] DeleteJobRequest etag + */ + + /** + * Constructs a new DeleteJobRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a DeleteJobRequest. + * @implements IDeleteJobRequest + * @constructor + * @param {google.cloud.run.v2.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.run.v2.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.name = ""; + + /** + * DeleteJobRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.validateOnly = false; + + /** + * DeleteJobRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.etag = ""; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.DeleteJobRequest + * @static + * @param {google.cloud.run.v2.IDeleteJobRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.DeleteJobRequest} DeleteJobRequest instance + */ + DeleteJobRequest.create = function create(properties) { + return new DeleteJobRequest(properties); + }; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.DeleteJobRequest + * @static + * @param {google.cloud.run.v2.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.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.DeleteJobRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.etag = 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.run.v2.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: 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.run.v2.DeleteJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.DeleteJobRequest} DeleteJobRequest + */ + DeleteJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.DeleteJobRequest) + return object; + var message = new $root.google.cloud.run.v2.DeleteJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.DeleteJobRequest + * @static + * @param {google.cloud.run.v2.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.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.DeleteJobRequest"; + }; + + return DeleteJobRequest; + })(); + + v2.RunJobRequest = (function() { + + /** + * Properties of a RunJobRequest. + * @memberof google.cloud.run.v2 + * @interface IRunJobRequest + * @property {string|null} [name] RunJobRequest name + * @property {boolean|null} [validateOnly] RunJobRequest validateOnly + * @property {string|null} [etag] RunJobRequest etag + * @property {google.cloud.run.v2.RunJobRequest.IOverrides|null} [overrides] RunJobRequest overrides + */ + + /** + * Constructs a new RunJobRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a RunJobRequest. + * @implements IRunJobRequest + * @constructor + * @param {google.cloud.run.v2.IRunJobRequest=} [properties] Properties to set + */ + function RunJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunJobRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.RunJobRequest + * @instance + */ + RunJobRequest.prototype.name = ""; + + /** + * RunJobRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.RunJobRequest + * @instance + */ + RunJobRequest.prototype.validateOnly = false; + + /** + * RunJobRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.RunJobRequest + * @instance + */ + RunJobRequest.prototype.etag = ""; + + /** + * RunJobRequest overrides. + * @member {google.cloud.run.v2.RunJobRequest.IOverrides|null|undefined} overrides + * @memberof google.cloud.run.v2.RunJobRequest + * @instance + */ + RunJobRequest.prototype.overrides = null; + + /** + * Creates a new RunJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.RunJobRequest + * @static + * @param {google.cloud.run.v2.IRunJobRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest instance + */ + RunJobRequest.create = function create(properties) { + return new RunJobRequest(properties); + }; + + /** + * Encodes the specified RunJobRequest message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.RunJobRequest + * @static + * @param {google.cloud.run.v2.IRunJobRequest} message RunJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) + $root.google.cloud.run.v2.RunJobRequest.Overrides.encode(message.overrides, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.RunJobRequest + * @static + * @param {google.cloud.run.v2.IRunJobRequest} message RunJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.RunJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunJobRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.RunJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunJobRequest message. + * @function verify + * @memberof google.cloud.run.v2.RunJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.overrides != null && message.hasOwnProperty("overrides")) { + var error = $root.google.cloud.run.v2.RunJobRequest.Overrides.verify(message.overrides); + if (error) + return "overrides." + error; + } + return null; + }; + + /** + * Creates a RunJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.RunJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest + */ + RunJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.RunJobRequest) + return object; + var message = new $root.google.cloud.run.v2.RunJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + if (object.overrides != null) { + if (typeof object.overrides !== "object") + throw TypeError(".google.cloud.run.v2.RunJobRequest.overrides: object expected"); + message.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.fromObject(object.overrides); + } + return message; + }; + + /** + * Creates a plain object from a RunJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.RunJobRequest + * @static + * @param {google.cloud.run.v2.RunJobRequest} message RunJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + object.overrides = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.overrides != null && message.hasOwnProperty("overrides")) + object.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.toObject(message.overrides, options); + return object; + }; + + /** + * Converts this RunJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.RunJobRequest + * @instance + * @returns {Object.} JSON object + */ + RunJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunJobRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.RunJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest"; + }; + + RunJobRequest.Overrides = (function() { + + /** + * Properties of an Overrides. + * @memberof google.cloud.run.v2.RunJobRequest + * @interface IOverrides + * @property {Array.|null} [containerOverrides] Overrides containerOverrides + * @property {number|null} [taskCount] Overrides taskCount + * @property {google.protobuf.IDuration|null} [timeout] Overrides timeout + */ + + /** + * Constructs a new Overrides. + * @memberof google.cloud.run.v2.RunJobRequest + * @classdesc Represents an Overrides. + * @implements IOverrides + * @constructor + * @param {google.cloud.run.v2.RunJobRequest.IOverrides=} [properties] Properties to set + */ + function Overrides(properties) { + this.containerOverrides = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Overrides containerOverrides. + * @member {Array.} containerOverrides + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @instance + */ + Overrides.prototype.containerOverrides = $util.emptyArray; + + /** + * Overrides taskCount. + * @member {number} taskCount + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @instance + */ + Overrides.prototype.taskCount = 0; + + /** + * Overrides timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @instance + */ + Overrides.prototype.timeout = null; + + /** + * Creates a new Overrides instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {google.cloud.run.v2.RunJobRequest.IOverrides=} [properties] Properties to set + * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides instance + */ + Overrides.create = function create(properties) { + return new Overrides(properties); + }; + + /** + * Encodes the specified Overrides message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {google.cloud.run.v2.RunJobRequest.IOverrides} message Overrides message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Overrides.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.containerOverrides != null && message.containerOverrides.length) + for (var i = 0; i < message.containerOverrides.length; ++i) + $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.encode(message.containerOverrides[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.taskCount); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Overrides message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {google.cloud.run.v2.RunJobRequest.IOverrides} message Overrides message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Overrides.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Overrides message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Overrides.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest.Overrides(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.containerOverrides && message.containerOverrides.length)) + message.containerOverrides = []; + message.containerOverrides.push($root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.decode(reader, reader.uint32())); + break; + } + case 2: { + message.taskCount = reader.int32(); + break; + } + case 4: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Overrides message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Overrides.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Overrides message. + * @function verify + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Overrides.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.containerOverrides != null && message.hasOwnProperty("containerOverrides")) { + if (!Array.isArray(message.containerOverrides)) + return "containerOverrides: array expected"; + for (var i = 0; i < message.containerOverrides.length; ++i) { + var error = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify(message.containerOverrides[i]); + if (error) + return "containerOverrides." + error; + } + } + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (!$util.isInteger(message.taskCount)) + return "taskCount: integer 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 an Overrides message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides + */ + Overrides.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.RunJobRequest.Overrides) + return object; + var message = new $root.google.cloud.run.v2.RunJobRequest.Overrides(); + if (object.containerOverrides) { + if (!Array.isArray(object.containerOverrides)) + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.containerOverrides: array expected"); + message.containerOverrides = []; + for (var i = 0; i < object.containerOverrides.length; ++i) { + if (typeof object.containerOverrides[i] !== "object") + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.containerOverrides: object expected"); + message.containerOverrides[i] = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.fromObject(object.containerOverrides[i]); + } + } + if (object.taskCount != null) + message.taskCount = object.taskCount | 0; + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from an Overrides message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {google.cloud.run.v2.RunJobRequest.Overrides} message Overrides + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Overrides.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.containerOverrides = []; + if (options.defaults) { + object.taskCount = 0; + object.timeout = null; + } + if (message.containerOverrides && message.containerOverrides.length) { + object.containerOverrides = []; + for (var j = 0; j < message.containerOverrides.length; ++j) + object.containerOverrides[j] = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.toObject(message.containerOverrides[j], options); + } + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + object.taskCount = message.taskCount; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this Overrides to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @instance + * @returns {Object.} JSON object + */ + Overrides.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Overrides + * @function getTypeUrl + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Overrides.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest.Overrides"; + }; + + Overrides.ContainerOverride = (function() { + + /** + * Properties of a ContainerOverride. + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @interface IContainerOverride + * @property {string|null} [name] ContainerOverride name + * @property {Array.|null} [args] ContainerOverride args + * @property {Array.|null} [env] ContainerOverride env + * @property {boolean|null} [clearArgs] ContainerOverride clearArgs + */ + + /** + * Constructs a new ContainerOverride. + * @memberof google.cloud.run.v2.RunJobRequest.Overrides + * @classdesc Represents a ContainerOverride. + * @implements IContainerOverride + * @constructor + * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride=} [properties] Properties to set + */ + function ContainerOverride(properties) { + this.args = []; + this.env = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContainerOverride name. + * @member {string} name + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @instance + */ + ContainerOverride.prototype.name = ""; + + /** + * ContainerOverride args. + * @member {Array.} args + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @instance + */ + ContainerOverride.prototype.args = $util.emptyArray; + + /** + * ContainerOverride env. + * @member {Array.} env + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @instance + */ + ContainerOverride.prototype.env = $util.emptyArray; + + /** + * ContainerOverride clearArgs. + * @member {boolean} clearArgs + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @instance + */ + ContainerOverride.prototype.clearArgs = false; + + /** + * Creates a new ContainerOverride instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride=} [properties] Properties to set + * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride instance + */ + ContainerOverride.create = function create(properties) { + return new ContainerOverride(properties); + }; + + /** + * Encodes the specified ContainerOverride message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride} message ContainerOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerOverride.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.args[i]); + if (message.env != null && message.env.length) + for (var i = 0; i < message.env.length; ++i) + $root.google.cloud.run.v2.EnvVar.encode(message.env[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clearArgs != null && Object.hasOwnProperty.call(message, "clearArgs")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.clearArgs); + return writer; + }; + + /** + * Encodes the specified ContainerOverride message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride} message ContainerOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerOverride.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContainerOverride message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerOverride.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 3: { + if (!(message.env && message.env.length)) + message.env = []; + message.env.push($root.google.cloud.run.v2.EnvVar.decode(reader, reader.uint32())); + break; + } + case 4: { + message.clearArgs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContainerOverride message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerOverride.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContainerOverride message. + * @function verify + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContainerOverride.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) + if (!$util.isString(message.args[i])) + return "args: string[] expected"; + } + if (message.env != null && message.hasOwnProperty("env")) { + if (!Array.isArray(message.env)) + return "env: array expected"; + for (var i = 0; i < message.env.length; ++i) { + var error = $root.google.cloud.run.v2.EnvVar.verify(message.env[i]); + if (error) + return "env." + error; + } + } + if (message.clearArgs != null && message.hasOwnProperty("clearArgs")) + if (typeof message.clearArgs !== "boolean") + return "clearArgs: boolean expected"; + return null; + }; + + /** + * Creates a ContainerOverride message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride + */ + ContainerOverride.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride) + return object; + var message = new $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride(); + if (object.name != null) + message.name = String(object.name); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.env) { + if (!Array.isArray(object.env)) + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.env: array expected"); + message.env = []; + for (var i = 0; i < object.env.length; ++i) { + if (typeof object.env[i] !== "object") + throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.env: object expected"); + message.env[i] = $root.google.cloud.run.v2.EnvVar.fromObject(object.env[i]); + } + } + if (object.clearArgs != null) + message.clearArgs = Boolean(object.clearArgs); + return message; + }; + + /** + * Creates a plain object from a ContainerOverride message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} message ContainerOverride + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContainerOverride.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.env = []; + } + if (options.defaults) { + object.name = ""; + object.clearArgs = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = message.args[j]; + } + if (message.env && message.env.length) { + object.env = []; + for (var j = 0; j < message.env.length; ++j) + object.env[j] = $root.google.cloud.run.v2.EnvVar.toObject(message.env[j], options); + } + if (message.clearArgs != null && message.hasOwnProperty("clearArgs")) + object.clearArgs = message.clearArgs; + return object; + }; + + /** + * Converts this ContainerOverride to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @instance + * @returns {Object.} JSON object + */ + ContainerOverride.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContainerOverride + * @function getTypeUrl + * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContainerOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride"; + }; + + return ContainerOverride; + })(); + + return Overrides; + })(); + + return RunJobRequest; + })(); + + v2.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.run.v2 + * @interface IJob + * @property {string|null} [name] Job name + * @property {string|null} [uid] Job uid + * @property {number|Long|null} [generation] Job generation + * @property {Object.|null} [labels] Job labels + * @property {Object.|null} [annotations] Job annotations + * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Job deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Job expireTime + * @property {string|null} [creator] Job creator + * @property {string|null} [lastModifier] Job lastModifier + * @property {string|null} [client] Job client + * @property {string|null} [clientVersion] Job clientVersion + * @property {google.api.LaunchStage|null} [launchStage] Job launchStage + * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Job binaryAuthorization + * @property {google.cloud.run.v2.IExecutionTemplate|null} [template] Job template + * @property {number|Long|null} [observedGeneration] Job observedGeneration + * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Job terminalCondition + * @property {Array.|null} [conditions] Job conditions + * @property {number|null} [executionCount] Job executionCount + * @property {google.cloud.run.v2.IExecutionReference|null} [latestCreatedExecution] Job latestCreatedExecution + * @property {boolean|null} [reconciling] Job reconciling + * @property {boolean|null} [satisfiesPzs] Job satisfiesPzs + * @property {string|null} [startExecutionToken] Job startExecutionToken + * @property {string|null} [runExecutionToken] Job runExecutionToken + * @property {string|null} [etag] Job etag + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.run.v2.IJob=} [properties] Properties to set + */ + function Job(properties) { + this.labels = {}; + this.annotations = {}; + this.conditions = []; + if (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.run.v2.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job uid. + * @member {string} uid + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.uid = ""; + + /** + * Job generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Job labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.labels = $util.emptyObject; + + /** + * Job annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.annotations = $util.emptyObject; + + /** + * Job createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.createTime = null; + + /** + * Job updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.updateTime = null; + + /** + * Job deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.deleteTime = null; + + /** + * Job expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.expireTime = null; + + /** + * Job creator. + * @member {string} creator + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.creator = ""; + + /** + * Job lastModifier. + * @member {string} lastModifier + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.lastModifier = ""; + + /** + * Job client. + * @member {string} client + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.client = ""; + + /** + * Job clientVersion. + * @member {string} clientVersion + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.clientVersion = ""; + + /** + * Job launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.launchStage = 0; + + /** + * Job binaryAuthorization. + * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.binaryAuthorization = null; + + /** + * Job template. + * @member {google.cloud.run.v2.IExecutionTemplate|null|undefined} template + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.template = null; + + /** + * Job observedGeneration. + * @member {number|Long} observedGeneration + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Job terminalCondition. + * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.terminalCondition = null; + + /** + * Job conditions. + * @member {Array.} conditions + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.conditions = $util.emptyArray; + + /** + * Job executionCount. + * @member {number} executionCount + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.executionCount = 0; + + /** + * Job latestCreatedExecution. + * @member {google.cloud.run.v2.IExecutionReference|null|undefined} latestCreatedExecution + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.latestCreatedExecution = null; + + /** + * Job reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.reconciling = false; + + /** + * Job satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.satisfiesPzs = false; + + /** + * Job startExecutionToken. + * @member {string|null|undefined} startExecutionToken + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.startExecutionToken = null; + + /** + * Job runExecutionToken. + * @member {string|null|undefined} runExecutionToken + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.runExecutionToken = null; + + /** + * Job etag. + * @member {string} etag + * @memberof google.cloud.run.v2.Job + * @instance + */ + Job.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Job createExecution. + * @member {"startExecutionToken"|"runExecutionToken"|undefined} createExecution + * @memberof google.cloud.run.v2.Job + * @instance + */ + Object.defineProperty(Job.prototype, "createExecution", { + get: $util.oneOfGetter($oneOfFields = ["startExecutionToken", "runExecutionToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Job + * @static + * @param {google.cloud.run.v2.IJob=} [properties] Properties to set + * @returns {google.cloud.run.v2.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.run.v2.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Job + * @static + * @param {google.cloud.run.v2.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.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.creator); + if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.lastModifier); + if (message.client != null && Object.hasOwnProperty.call(message, "client")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.client); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.clientVersion); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.launchStage); + if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) + $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.template != null && Object.hasOwnProperty.call(message, "template")) + $root.google.cloud.run.v2.ExecutionTemplate.encode(message.template, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.observedGeneration); + if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) + $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.executionCount != null && Object.hasOwnProperty.call(message, "executionCount")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.executionCount); + if (message.latestCreatedExecution != null && Object.hasOwnProperty.call(message, "latestCreatedExecution")) + $root.google.cloud.run.v2.ExecutionReference.encode(message.latestCreatedExecution, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.reconciling); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.satisfiesPzs); + if (message.startExecutionToken != null && Object.hasOwnProperty.call(message, "startExecutionToken")) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.startExecutionToken); + if (message.runExecutionToken != null && Object.hasOwnProperty.call(message, "runExecutionToken")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.runExecutionToken); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.run.v2.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Job + * @static + * @param {google.cloud.run.v2.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.run.v2.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Job(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.creator = reader.string(); + break; + } + case 11: { + message.lastModifier = reader.string(); + break; + } + case 12: { + message.client = reader.string(); + break; + } + case 13: { + message.clientVersion = reader.string(); + break; + } + case 14: { + message.launchStage = reader.int32(); + break; + } + case 15: { + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); + break; + } + case 16: { + message.template = $root.google.cloud.run.v2.ExecutionTemplate.decode(reader, reader.uint32()); + break; + } + case 17: { + message.observedGeneration = reader.int64(); + break; + } + case 18: { + message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); + break; + } + case 19: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); + break; + } + case 20: { + message.executionCount = reader.int32(); + break; + } + case 22: { + message.latestCreatedExecution = $root.google.cloud.run.v2.ExecutionReference.decode(reader, reader.uint32()); + break; + } + case 23: { + message.reconciling = reader.bool(); + break; + } + case 25: { + message.satisfiesPzs = reader.bool(); + break; + } + case 26: { + message.startExecutionToken = reader.string(); + break; + } + case 27: { + message.runExecutionToken = reader.string(); + break; + } + case 99: { + message.etag = reader.string(); + 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.run.v2.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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"; + var properties = {}; + 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.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + if (!$util.isString(message.lastModifier)) + return "lastModifier: string expected"; + if (message.client != null && message.hasOwnProperty("client")) + if (!$util.isString(message.client)) + return "client: string expected"; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { + var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); + if (error) + return "binaryAuthorization." + error; + } + if (message.template != null && message.hasOwnProperty("template")) { + var error = $root.google.cloud.run.v2.ExecutionTemplate.verify(message.template); + if (error) + return "template." + error; + } + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) + return "observedGeneration: integer|Long expected"; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { + var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); + if (error) + return "terminalCondition." + error; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.executionCount != null && message.hasOwnProperty("executionCount")) + if (!$util.isInteger(message.executionCount)) + return "executionCount: integer expected"; + if (message.latestCreatedExecution != null && message.hasOwnProperty("latestCreatedExecution")) { + var error = $root.google.cloud.run.v2.ExecutionReference.verify(message.latestCreatedExecution); + if (error) + return "latestCreatedExecution." + error; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.startExecutionToken != null && message.hasOwnProperty("startExecutionToken")) { + properties.createExecution = 1; + if (!$util.isString(message.startExecutionToken)) + return "startExecutionToken: string expected"; + } + if (message.runExecutionToken != null && message.hasOwnProperty("runExecutionToken")) { + if (properties.createExecution === 1) + return "createExecution: multiple values"; + properties.createExecution = 1; + if (!$util.isString(message.runExecutionToken)) + return "runExecutionToken: string expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Job) + return object; + var message = new $root.google.cloud.run.v2.Job(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.Job.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.run.v2.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.run.v2.Job.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.run.v2.Job.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.run.v2.Job.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.lastModifier != null) + message.lastModifier = String(object.lastModifier); + if (object.client != null) + message.client = String(object.client); + if (object.clientVersion != null) + message.clientVersion = String(object.clientVersion); + 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.binaryAuthorization != null) { + if (typeof object.binaryAuthorization !== "object") + throw TypeError(".google.cloud.run.v2.Job.binaryAuthorization: object expected"); + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); + } + if (object.template != null) { + if (typeof object.template !== "object") + throw TypeError(".google.cloud.run.v2.Job.template: object expected"); + message.template = $root.google.cloud.run.v2.ExecutionTemplate.fromObject(object.template); + } + if (object.observedGeneration != null) + if ($util.Long) + (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; + else if (typeof object.observedGeneration === "string") + message.observedGeneration = parseInt(object.observedGeneration, 10); + else if (typeof object.observedGeneration === "number") + message.observedGeneration = object.observedGeneration; + else if (typeof object.observedGeneration === "object") + message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); + if (object.terminalCondition != null) { + if (typeof object.terminalCondition !== "object") + throw TypeError(".google.cloud.run.v2.Job.terminalCondition: object expected"); + message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); + } + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.run.v2.Job.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.run.v2.Job.conditions: object expected"); + message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); + } + } + if (object.executionCount != null) + message.executionCount = object.executionCount | 0; + if (object.latestCreatedExecution != null) { + if (typeof object.latestCreatedExecution !== "object") + throw TypeError(".google.cloud.run.v2.Job.latestCreatedExecution: object expected"); + message.latestCreatedExecution = $root.google.cloud.run.v2.ExecutionReference.fromObject(object.latestCreatedExecution); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.startExecutionToken != null) + message.startExecutionToken = String(object.startExecutionToken); + if (object.runExecutionToken != null) + message.runExecutionToken = String(object.runExecutionToken); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Job + * @static + * @param {google.cloud.run.v2.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.conditions = []; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.creator = ""; + object.lastModifier = ""; + object.client = ""; + object.clientVersion = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.binaryAuthorization = null; + object.template = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.observedGeneration = options.longs === String ? "0" : 0; + object.terminalCondition = null; + object.executionCount = 0; + object.latestCreatedExecution = null; + object.reconciling = false; + object.satisfiesPzs = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + object.lastModifier = message.lastModifier; + if (message.client != null && message.hasOwnProperty("client")) + object.client = message.client; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) + object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); + if (message.template != null && message.hasOwnProperty("template")) + object.template = $root.google.cloud.run.v2.ExecutionTemplate.toObject(message.template, options); + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (typeof message.observedGeneration === "number") + object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; + else + object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) + object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); + } + if (message.executionCount != null && message.hasOwnProperty("executionCount")) + object.executionCount = message.executionCount; + if (message.latestCreatedExecution != null && message.hasOwnProperty("latestCreatedExecution")) + object.latestCreatedExecution = $root.google.cloud.run.v2.ExecutionReference.toObject(message.latestCreatedExecution, options); + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.startExecutionToken != null && message.hasOwnProperty("startExecutionToken")) { + object.startExecutionToken = message.startExecutionToken; + if (options.oneofs) + object.createExecution = "startExecutionToken"; + } + if (message.runExecutionToken != null && message.hasOwnProperty("runExecutionToken")) { + object.runExecutionToken = message.runExecutionToken; + if (options.oneofs) + object.createExecution = "runExecutionToken"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Job"; + }; + + return Job; + })(); + + v2.ExecutionReference = (function() { + + /** + * Properties of an ExecutionReference. + * @memberof google.cloud.run.v2 + * @interface IExecutionReference + * @property {string|null} [name] ExecutionReference name + * @property {google.protobuf.ITimestamp|null} [createTime] ExecutionReference createTime + * @property {google.protobuf.ITimestamp|null} [completionTime] ExecutionReference completionTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] ExecutionReference deleteTime + * @property {google.cloud.run.v2.ExecutionReference.CompletionStatus|null} [completionStatus] ExecutionReference completionStatus + */ + + /** + * Constructs a new ExecutionReference. + * @memberof google.cloud.run.v2 + * @classdesc Represents an ExecutionReference. + * @implements IExecutionReference + * @constructor + * @param {google.cloud.run.v2.IExecutionReference=} [properties] Properties to set + */ + function ExecutionReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutionReference name. + * @member {string} name + * @memberof google.cloud.run.v2.ExecutionReference + * @instance + */ + ExecutionReference.prototype.name = ""; + + /** + * ExecutionReference createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.run.v2.ExecutionReference + * @instance + */ + ExecutionReference.prototype.createTime = null; + + /** + * ExecutionReference completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof google.cloud.run.v2.ExecutionReference + * @instance + */ + ExecutionReference.prototype.completionTime = null; + + /** + * ExecutionReference deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.run.v2.ExecutionReference + * @instance + */ + ExecutionReference.prototype.deleteTime = null; + + /** + * ExecutionReference completionStatus. + * @member {google.cloud.run.v2.ExecutionReference.CompletionStatus} completionStatus + * @memberof google.cloud.run.v2.ExecutionReference + * @instance + */ + ExecutionReference.prototype.completionStatus = 0; + + /** + * Creates a new ExecutionReference instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ExecutionReference + * @static + * @param {google.cloud.run.v2.IExecutionReference=} [properties] Properties to set + * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference instance + */ + ExecutionReference.create = function create(properties) { + return new ExecutionReference(properties); + }; + + /** + * Encodes the specified ExecutionReference message. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ExecutionReference + * @static + * @param {google.cloud.run.v2.IExecutionReference} message ExecutionReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.completionStatus != null && Object.hasOwnProperty.call(message, "completionStatus")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.completionStatus); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutionReference message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ExecutionReference + * @static + * @param {google.cloud.run.v2.IExecutionReference} message ExecutionReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ExecutionReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ExecutionReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.completionStatus = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ExecutionReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionReference message. + * @function verify + * @memberof google.cloud.run.v2.ExecutionReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.completionStatus != null && message.hasOwnProperty("completionStatus")) + switch (message.completionStatus) { + default: + return "completionStatus: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates an ExecutionReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ExecutionReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference + */ + ExecutionReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ExecutionReference) + return object; + var message = new $root.google.cloud.run.v2.ExecutionReference(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.run.v2.ExecutionReference.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".google.cloud.run.v2.ExecutionReference.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.run.v2.ExecutionReference.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + switch (object.completionStatus) { + default: + if (typeof object.completionStatus === "number") { + message.completionStatus = object.completionStatus; + break; + } + break; + case "COMPLETION_STATUS_UNSPECIFIED": + case 0: + message.completionStatus = 0; + break; + case "EXECUTION_SUCCEEDED": + case 1: + message.completionStatus = 1; + break; + case "EXECUTION_FAILED": + case 2: + message.completionStatus = 2; + break; + case "EXECUTION_RUNNING": + case 3: + message.completionStatus = 3; + break; + case "EXECUTION_PENDING": + case 4: + message.completionStatus = 4; + break; + case "EXECUTION_CANCELLED": + case 5: + message.completionStatus = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExecutionReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ExecutionReference + * @static + * @param {google.cloud.run.v2.ExecutionReference} message ExecutionReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutionReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.completionTime = null; + object.completionStatus = options.enums === String ? "COMPLETION_STATUS_UNSPECIFIED" : 0; + object.deleteTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + if (message.completionStatus != null && message.hasOwnProperty("completionStatus")) + object.completionStatus = options.enums === String ? $root.google.cloud.run.v2.ExecutionReference.CompletionStatus[message.completionStatus] === undefined ? message.completionStatus : $root.google.cloud.run.v2.ExecutionReference.CompletionStatus[message.completionStatus] : message.completionStatus; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + return object; + }; + + /** + * Converts this ExecutionReference to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ExecutionReference + * @instance + * @returns {Object.} JSON object + */ + ExecutionReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutionReference + * @function getTypeUrl + * @memberof google.cloud.run.v2.ExecutionReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutionReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ExecutionReference"; + }; + + /** + * CompletionStatus enum. + * @name google.cloud.run.v2.ExecutionReference.CompletionStatus + * @enum {number} + * @property {number} COMPLETION_STATUS_UNSPECIFIED=0 COMPLETION_STATUS_UNSPECIFIED value + * @property {number} EXECUTION_SUCCEEDED=1 EXECUTION_SUCCEEDED value + * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value + * @property {number} EXECUTION_RUNNING=3 EXECUTION_RUNNING value + * @property {number} EXECUTION_PENDING=4 EXECUTION_PENDING value + * @property {number} EXECUTION_CANCELLED=5 EXECUTION_CANCELLED value + */ + ExecutionReference.CompletionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPLETION_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXECUTION_SUCCEEDED"] = 1; + values[valuesById[2] = "EXECUTION_FAILED"] = 2; + values[valuesById[3] = "EXECUTION_RUNNING"] = 3; + values[valuesById[4] = "EXECUTION_PENDING"] = 4; + values[valuesById[5] = "EXECUTION_CANCELLED"] = 5; + return values; + })(); + + return ExecutionReference; + })(); + + v2.Revisions = (function() { + + /** + * Constructs a new Revisions service. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Revisions + * @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 Revisions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Revisions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Revisions; + + /** + * Creates new Revisions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.run.v2.Revisions + * @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 {Revisions} RPC service. Useful where requests and/or responses are streamed. + */ + Revisions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.run.v2.Revisions|getRevision}. + * @memberof google.cloud.run.v2.Revisions + * @typedef GetRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.Revision} [response] Revision + */ + + /** + * Calls GetRevision. + * @function getRevision + * @memberof google.cloud.run.v2.Revisions + * @instance + * @param {google.cloud.run.v2.IGetRevisionRequest} request GetRevisionRequest message or plain object + * @param {google.cloud.run.v2.Revisions.GetRevisionCallback} callback Node-style callback called with the error, if any, and Revision + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Revisions.prototype.getRevision = function getRevision(request, callback) { + return this.rpcCall(getRevision, $root.google.cloud.run.v2.GetRevisionRequest, $root.google.cloud.run.v2.Revision, request, callback); + }, "name", { value: "GetRevision" }); + + /** + * Calls GetRevision. + * @function getRevision + * @memberof google.cloud.run.v2.Revisions + * @instance + * @param {google.cloud.run.v2.IGetRevisionRequest} request GetRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Revisions|listRevisions}. + * @memberof google.cloud.run.v2.Revisions + * @typedef ListRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.ListRevisionsResponse} [response] ListRevisionsResponse + */ + + /** + * Calls ListRevisions. + * @function listRevisions + * @memberof google.cloud.run.v2.Revisions + * @instance + * @param {google.cloud.run.v2.IListRevisionsRequest} request ListRevisionsRequest message or plain object + * @param {google.cloud.run.v2.Revisions.ListRevisionsCallback} callback Node-style callback called with the error, if any, and ListRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Revisions.prototype.listRevisions = function listRevisions(request, callback) { + return this.rpcCall(listRevisions, $root.google.cloud.run.v2.ListRevisionsRequest, $root.google.cloud.run.v2.ListRevisionsResponse, request, callback); + }, "name", { value: "ListRevisions" }); + + /** + * Calls ListRevisions. + * @function listRevisions + * @memberof google.cloud.run.v2.Revisions + * @instance + * @param {google.cloud.run.v2.IListRevisionsRequest} request ListRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Revisions|deleteRevision}. + * @memberof google.cloud.run.v2.Revisions + * @typedef DeleteRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteRevision. + * @function deleteRevision + * @memberof google.cloud.run.v2.Revisions + * @instance + * @param {google.cloud.run.v2.IDeleteRevisionRequest} request DeleteRevisionRequest message or plain object + * @param {google.cloud.run.v2.Revisions.DeleteRevisionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Revisions.prototype.deleteRevision = function deleteRevision(request, callback) { + return this.rpcCall(deleteRevision, $root.google.cloud.run.v2.DeleteRevisionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteRevision" }); + + /** + * Calls DeleteRevision. + * @function deleteRevision + * @memberof google.cloud.run.v2.Revisions + * @instance + * @param {google.cloud.run.v2.IDeleteRevisionRequest} request DeleteRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Revisions; + })(); + + v2.GetRevisionRequest = (function() { + + /** + * Properties of a GetRevisionRequest. + * @memberof google.cloud.run.v2 + * @interface IGetRevisionRequest + * @property {string|null} [name] GetRevisionRequest name + */ + + /** + * Constructs a new GetRevisionRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GetRevisionRequest. + * @implements IGetRevisionRequest + * @constructor + * @param {google.cloud.run.v2.IGetRevisionRequest=} [properties] Properties to set + */ + function GetRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRevisionRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.GetRevisionRequest + * @instance + */ + GetRevisionRequest.prototype.name = ""; + + /** + * Creates a new GetRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GetRevisionRequest + * @static + * @param {google.cloud.run.v2.IGetRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest instance + */ + GetRevisionRequest.create = function create(properties) { + return new GetRevisionRequest(properties); + }; + + /** + * Encodes the specified GetRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GetRevisionRequest + * @static + * @param {google.cloud.run.v2.IGetRevisionRequest} message GetRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRevisionRequest.encode = function encode(message, writer) { + 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 GetRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GetRevisionRequest + * @static + * @param {google.cloud.run.v2.IGetRevisionRequest} message GetRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.GetRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRevisionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GetRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRevisionRequest message. + * @function verify + * @memberof google.cloud.run.v2.GetRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRevisionRequest.verify = function verify(message) { + if (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 GetRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.GetRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest + */ + GetRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GetRevisionRequest) + return object; + var message = new $root.google.cloud.run.v2.GetRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.GetRevisionRequest + * @static + * @param {google.cloud.run.v2.GetRevisionRequest} message GetRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRevisionRequest.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 GetRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.GetRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + GetRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.GetRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.GetRevisionRequest"; + }; + + return GetRevisionRequest; + })(); + + v2.ListRevisionsRequest = (function() { + + /** + * Properties of a ListRevisionsRequest. + * @memberof google.cloud.run.v2 + * @interface IListRevisionsRequest + * @property {string|null} [parent] ListRevisionsRequest parent + * @property {number|null} [pageSize] ListRevisionsRequest pageSize + * @property {string|null} [pageToken] ListRevisionsRequest pageToken + * @property {boolean|null} [showDeleted] ListRevisionsRequest showDeleted + */ + + /** + * Constructs a new ListRevisionsRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListRevisionsRequest. + * @implements IListRevisionsRequest + * @constructor + * @param {google.cloud.run.v2.IListRevisionsRequest=} [properties] Properties to set + */ + function ListRevisionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRevisionsRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @instance + */ + ListRevisionsRequest.prototype.parent = ""; + + /** + * ListRevisionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @instance + */ + ListRevisionsRequest.prototype.pageSize = 0; + + /** + * ListRevisionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @instance + */ + ListRevisionsRequest.prototype.pageToken = ""; + + /** + * ListRevisionsRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @instance + */ + ListRevisionsRequest.prototype.showDeleted = false; + + /** + * Creates a new ListRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @static + * @param {google.cloud.run.v2.IListRevisionsRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest instance + */ + ListRevisionsRequest.create = function create(properties) { + return new ListRevisionsRequest(properties); + }; + + /** + * Encodes the specified ListRevisionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @static + * @param {google.cloud.run.v2.IListRevisionsRequest} message ListRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRevisionsRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @static + * @param {google.cloud.run.v2.IListRevisionsRequest} message ListRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRevisionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListRevisionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRevisionsRequest message. + * @function verify + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRevisionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest + */ + ListRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListRevisionsRequest) + return object; + var message = new $root.google.cloud.run.v2.ListRevisionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @static + * @param {google.cloud.run.v2.ListRevisionsRequest} message ListRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRevisionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + 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.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListRevisionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRevisionsRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListRevisionsRequest"; + }; + + return ListRevisionsRequest; + })(); + + v2.ListRevisionsResponse = (function() { + + /** + * Properties of a ListRevisionsResponse. + * @memberof google.cloud.run.v2 + * @interface IListRevisionsResponse + * @property {Array.|null} [revisions] ListRevisionsResponse revisions + * @property {string|null} [nextPageToken] ListRevisionsResponse nextPageToken + */ + + /** + * Constructs a new ListRevisionsResponse. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListRevisionsResponse. + * @implements IListRevisionsResponse + * @constructor + * @param {google.cloud.run.v2.IListRevisionsResponse=} [properties] Properties to set + */ + function ListRevisionsResponse(properties) { + this.revisions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRevisionsResponse revisions. + * @member {Array.} revisions + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @instance + */ + ListRevisionsResponse.prototype.revisions = $util.emptyArray; + + /** + * ListRevisionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @instance + */ + ListRevisionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @static + * @param {google.cloud.run.v2.IListRevisionsResponse=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse instance + */ + ListRevisionsResponse.create = function create(properties) { + return new ListRevisionsResponse(properties); + }; + + /** + * Encodes the specified ListRevisionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @static + * @param {google.cloud.run.v2.IListRevisionsResponse} message ListRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revisions != null && message.revisions.length) + for (var i = 0; i < message.revisions.length; ++i) + $root.google.cloud.run.v2.Revision.encode(message.revisions[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 ListRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @static + * @param {google.cloud.run.v2.IListRevisionsResponse} message ListRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRevisionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.revisions && message.revisions.length)) + message.revisions = []; + message.revisions.push($root.google.cloud.run.v2.Revision.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRevisionsResponse message. + * @function verify + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revisions != null && message.hasOwnProperty("revisions")) { + if (!Array.isArray(message.revisions)) + return "revisions: array expected"; + for (var i = 0; i < message.revisions.length; ++i) { + var error = $root.google.cloud.run.v2.Revision.verify(message.revisions[i]); + if (error) + return "revisions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse + */ + ListRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListRevisionsResponse) + return object; + var message = new $root.google.cloud.run.v2.ListRevisionsResponse(); + if (object.revisions) { + if (!Array.isArray(object.revisions)) + throw TypeError(".google.cloud.run.v2.ListRevisionsResponse.revisions: array expected"); + message.revisions = []; + for (var i = 0; i < object.revisions.length; ++i) { + if (typeof object.revisions[i] !== "object") + throw TypeError(".google.cloud.run.v2.ListRevisionsResponse.revisions: object expected"); + message.revisions[i] = $root.google.cloud.run.v2.Revision.fromObject(object.revisions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @static + * @param {google.cloud.run.v2.ListRevisionsResponse} message ListRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.revisions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.revisions && message.revisions.length) { + object.revisions = []; + for (var j = 0; j < message.revisions.length; ++j) + object.revisions[j] = $root.google.cloud.run.v2.Revision.toObject(message.revisions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRevisionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRevisionsResponse + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListRevisionsResponse"; + }; + + return ListRevisionsResponse; + })(); + + v2.DeleteRevisionRequest = (function() { + + /** + * Properties of a DeleteRevisionRequest. + * @memberof google.cloud.run.v2 + * @interface IDeleteRevisionRequest + * @property {string|null} [name] DeleteRevisionRequest name + * @property {boolean|null} [validateOnly] DeleteRevisionRequest validateOnly + * @property {string|null} [etag] DeleteRevisionRequest etag + */ + + /** + * Constructs a new DeleteRevisionRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a DeleteRevisionRequest. + * @implements IDeleteRevisionRequest + * @constructor + * @param {google.cloud.run.v2.IDeleteRevisionRequest=} [properties] Properties to set + */ + function DeleteRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRevisionRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @instance + */ + DeleteRevisionRequest.prototype.name = ""; + + /** + * DeleteRevisionRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @instance + */ + DeleteRevisionRequest.prototype.validateOnly = false; + + /** + * DeleteRevisionRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @instance + */ + DeleteRevisionRequest.prototype.etag = ""; + + /** + * Creates a new DeleteRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @static + * @param {google.cloud.run.v2.IDeleteRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest instance + */ + DeleteRevisionRequest.create = function create(properties) { + return new DeleteRevisionRequest(properties); + }; + + /** + * Encodes the specified DeleteRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @static + * @param {google.cloud.run.v2.IDeleteRevisionRequest} message DeleteRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRevisionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @static + * @param {google.cloud.run.v2.IDeleteRevisionRequest} message DeleteRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRevisionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRevisionRequest message. + * @function verify + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRevisionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest + */ + DeleteRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.DeleteRevisionRequest) + return object; + var message = new $root.google.cloud.run.v2.DeleteRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @static + * @param {google.cloud.run.v2.DeleteRevisionRequest} message DeleteRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRevisionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.DeleteRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.DeleteRevisionRequest"; + }; + + return DeleteRevisionRequest; + })(); + + v2.Revision = (function() { + + /** + * Properties of a Revision. + * @memberof google.cloud.run.v2 + * @interface IRevision + * @property {string|null} [name] Revision name + * @property {string|null} [uid] Revision uid + * @property {number|Long|null} [generation] Revision generation + * @property {Object.|null} [labels] Revision labels + * @property {Object.|null} [annotations] Revision annotations + * @property {google.protobuf.ITimestamp|null} [createTime] Revision createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Revision updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Revision deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Revision expireTime + * @property {google.api.LaunchStage|null} [launchStage] Revision launchStage + * @property {string|null} [service] Revision service + * @property {google.cloud.run.v2.IRevisionScaling|null} [scaling] Revision scaling + * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Revision vpcAccess + * @property {number|null} [maxInstanceRequestConcurrency] Revision maxInstanceRequestConcurrency + * @property {google.protobuf.IDuration|null} [timeout] Revision timeout + * @property {string|null} [serviceAccount] Revision serviceAccount + * @property {Array.|null} [containers] Revision containers + * @property {Array.|null} [volumes] Revision volumes + * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] Revision executionEnvironment + * @property {string|null} [encryptionKey] Revision encryptionKey + * @property {google.cloud.run.v2.IServiceMesh|null} [serviceMesh] Revision serviceMesh + * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] Revision encryptionKeyRevocationAction + * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] Revision encryptionKeyShutdownDuration + * @property {boolean|null} [reconciling] Revision reconciling + * @property {Array.|null} [conditions] Revision conditions + * @property {number|Long|null} [observedGeneration] Revision observedGeneration + * @property {string|null} [logUri] Revision logUri + * @property {boolean|null} [satisfiesPzs] Revision satisfiesPzs + * @property {boolean|null} [sessionAffinity] Revision sessionAffinity + * @property {google.cloud.run.v2.IRevisionScalingStatus|null} [scalingStatus] Revision scalingStatus + * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Revision nodeSelector + * @property {boolean|null} [gpuZonalRedundancyDisabled] Revision gpuZonalRedundancyDisabled + * @property {string|null} [creator] Revision creator + * @property {string|null} [etag] Revision etag + */ + + /** + * Constructs a new Revision. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Revision. + * @implements IRevision + * @constructor + * @param {google.cloud.run.v2.IRevision=} [properties] Properties to set + */ + function Revision(properties) { + this.labels = {}; + this.annotations = {}; + this.containers = []; + this.volumes = []; + this.conditions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Revision name. + * @member {string} name + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.name = ""; + + /** + * Revision uid. + * @member {string} uid + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.uid = ""; + + /** + * Revision generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Revision labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.labels = $util.emptyObject; + + /** + * Revision annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.annotations = $util.emptyObject; + + /** + * Revision createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.createTime = null; + + /** + * Revision updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.updateTime = null; + + /** + * Revision deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.deleteTime = null; + + /** + * Revision expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.expireTime = null; + + /** + * Revision launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.launchStage = 0; + + /** + * Revision service. + * @member {string} service + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.service = ""; + + /** + * Revision scaling. + * @member {google.cloud.run.v2.IRevisionScaling|null|undefined} scaling + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.scaling = null; + + /** + * Revision vpcAccess. + * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.vpcAccess = null; + + /** + * Revision maxInstanceRequestConcurrency. + * @member {number} maxInstanceRequestConcurrency + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.maxInstanceRequestConcurrency = 0; + + /** + * Revision timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.timeout = null; + + /** + * Revision serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.serviceAccount = ""; + + /** + * Revision containers. + * @member {Array.} containers + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.containers = $util.emptyArray; + + /** + * Revision volumes. + * @member {Array.} volumes + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.volumes = $util.emptyArray; + + /** + * Revision executionEnvironment. + * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.executionEnvironment = 0; + + /** + * Revision encryptionKey. + * @member {string} encryptionKey + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.encryptionKey = ""; + + /** + * Revision serviceMesh. + * @member {google.cloud.run.v2.IServiceMesh|null|undefined} serviceMesh + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.serviceMesh = null; + + /** + * Revision encryptionKeyRevocationAction. + * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.encryptionKeyRevocationAction = 0; + + /** + * Revision encryptionKeyShutdownDuration. + * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.encryptionKeyShutdownDuration = null; + + /** + * Revision reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.reconciling = false; + + /** + * Revision conditions. + * @member {Array.} conditions + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.conditions = $util.emptyArray; + + /** + * Revision observedGeneration. + * @member {number|Long} observedGeneration + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Revision logUri. + * @member {string} logUri + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.logUri = ""; + + /** + * Revision satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.satisfiesPzs = false; + + /** + * Revision sessionAffinity. + * @member {boolean} sessionAffinity + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.sessionAffinity = false; + + /** + * Revision scalingStatus. + * @member {google.cloud.run.v2.IRevisionScalingStatus|null|undefined} scalingStatus + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.scalingStatus = null; + + /** + * Revision nodeSelector. + * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.nodeSelector = null; + + /** + * Revision gpuZonalRedundancyDisabled. + * @member {boolean|null|undefined} gpuZonalRedundancyDisabled + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.gpuZonalRedundancyDisabled = null; + + /** + * Revision creator. + * @member {string} creator + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.creator = ""; + + /** + * Revision etag. + * @member {string} etag + * @memberof google.cloud.run.v2.Revision + * @instance + */ + Revision.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Revision.prototype, "_gpuZonalRedundancyDisabled", { + get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Revision instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Revision + * @static + * @param {google.cloud.run.v2.IRevision=} [properties] Properties to set + * @returns {google.cloud.run.v2.Revision} Revision instance + */ + Revision.create = function create(properties) { + return new Revision(properties); + }; + + /** + * Encodes the specified Revision message. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Revision + * @static + * @param {google.cloud.run.v2.IRevision} message Revision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Revision.encode = function encode(message, writer) { + if (!writer) + 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.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.launchStage); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.service); + if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) + $root.google.cloud.run.v2.RevisionScaling.encode(message.scaling, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) + $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.serviceAccount); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.executionEnvironment); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.encryptionKey); + if (message.serviceMesh != null && Object.hasOwnProperty.call(message, "serviceMesh")) + $root.google.cloud.run.v2.ServiceMesh.encode(message.serviceMesh, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.encryptionKeyRevocationAction); + if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) + $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 30, wireType 0 =*/240).bool(message.reconciling); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) + writer.uint32(/* id 32, wireType 0 =*/256).int64(message.observedGeneration); + if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) + writer.uint32(/* id 33, wireType 2 =*/266).string(message.logUri); + if (message.maxInstanceRequestConcurrency != null && Object.hasOwnProperty.call(message, "maxInstanceRequestConcurrency")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.maxInstanceRequestConcurrency); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 37, wireType 0 =*/296).bool(message.satisfiesPzs); + if (message.sessionAffinity != null && Object.hasOwnProperty.call(message, "sessionAffinity")) + writer.uint32(/* id 38, wireType 0 =*/304).bool(message.sessionAffinity); + if (message.scalingStatus != null && Object.hasOwnProperty.call(message, "scalingStatus")) + $root.google.cloud.run.v2.RevisionScalingStatus.encode(message.scalingStatus, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) + $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) + writer.uint32(/* id 48, wireType 0 =*/384).bool(message.gpuZonalRedundancyDisabled); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 49, wireType 2 =*/394).string(message.creator); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Revision + * @static + * @param {google.cloud.run.v2.IRevision} message Revision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Revision.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Revision message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.Revision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.Revision} Revision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Revision.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Revision(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.launchStage = reader.int32(); + break; + } + case 11: { + message.service = reader.string(); + break; + } + case 12: { + message.scaling = $root.google.cloud.run.v2.RevisionScaling.decode(reader, reader.uint32()); + break; + } + case 13: { + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); + break; + } + case 34: { + message.maxInstanceRequestConcurrency = reader.int32(); + break; + } + case 15: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 16: { + message.serviceAccount = reader.string(); + break; + } + case 17: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); + break; + } + case 18: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); + break; + } + case 20: { + message.executionEnvironment = reader.int32(); + break; + } + case 21: { + message.encryptionKey = reader.string(); + break; + } + case 22: { + message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.decode(reader, reader.uint32()); + break; + } + case 23: { + message.encryptionKeyRevocationAction = reader.int32(); + break; + } + case 24: { + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 30: { + message.reconciling = reader.bool(); + break; + } + case 31: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); + break; + } + case 32: { + message.observedGeneration = reader.int64(); + break; + } + case 33: { + message.logUri = reader.string(); + break; + } + case 37: { + message.satisfiesPzs = reader.bool(); + break; + } + case 38: { + message.sessionAffinity = reader.bool(); + break; + } + case 39: { + message.scalingStatus = $root.google.cloud.run.v2.RevisionScalingStatus.decode(reader, reader.uint32()); + break; + } + case 40: { + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); + break; + } + case 48: { + message.gpuZonalRedundancyDisabled = reader.bool(); + break; + } + case 49: { + message.creator = reader.string(); + break; + } + case 99: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Revision message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.Revision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.Revision} Revision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Revision.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Revision message. + * @function verify + * @memberof google.cloud.run.v2.Revision + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Revision.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.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + 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.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.scaling != null && message.hasOwnProperty("scaling")) { + var error = $root.google.cloud.run.v2.RevisionScaling.verify(message.scaling); + if (error) + return "scaling." + error; + } + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { + var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); + if (error) + return "vpcAccess." + error; + } + if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) + if (!$util.isInteger(message.maxInstanceRequestConcurrency)) + return "maxInstanceRequestConcurrency: integer expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + 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.run.v2.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) + switch (message.executionEnvironment) { + default: + return "executionEnvironment: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + if (!$util.isString(message.encryptionKey)) + return "encryptionKey: string expected"; + if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) { + var error = $root.google.cloud.run.v2.ServiceMesh.verify(message.serviceMesh); + if (error) + return "serviceMesh." + error; + } + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + switch (message.encryptionKeyRevocationAction) { + default: + return "encryptionKeyRevocationAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { + var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); + if (error) + return "encryptionKeyShutdownDuration." + error; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) + return "observedGeneration: integer|Long expected"; + if (message.logUri != null && message.hasOwnProperty("logUri")) + if (!$util.isString(message.logUri)) + return "logUri: string expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) + if (typeof message.sessionAffinity !== "boolean") + return "sessionAffinity: boolean expected"; + if (message.scalingStatus != null && message.hasOwnProperty("scalingStatus")) { + var error = $root.google.cloud.run.v2.RevisionScalingStatus.verify(message.scalingStatus); + if (error) + return "scalingStatus." + error; + } + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { + var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); + if (error) + return "nodeSelector." + error; + } + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + properties._gpuZonalRedundancyDisabled = 1; + if (typeof message.gpuZonalRedundancyDisabled !== "boolean") + return "gpuZonalRedundancyDisabled: boolean expected"; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Revision message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Revision + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Revision} Revision + */ + Revision.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Revision) + return object; + var message = new $root.google.cloud.run.v2.Revision(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.Revision.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.Revision.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.run.v2.Revision.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.run.v2.Revision.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.run.v2.Revision.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.run.v2.Revision.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + 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.service != null) + message.service = String(object.service); + if (object.scaling != null) { + if (typeof object.scaling !== "object") + throw TypeError(".google.cloud.run.v2.Revision.scaling: object expected"); + message.scaling = $root.google.cloud.run.v2.RevisionScaling.fromObject(object.scaling); + } + if (object.vpcAccess != null) { + if (typeof object.vpcAccess !== "object") + throw TypeError(".google.cloud.run.v2.Revision.vpcAccess: object expected"); + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); + } + if (object.maxInstanceRequestConcurrency != null) + message.maxInstanceRequestConcurrency = object.maxInstanceRequestConcurrency | 0; + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.run.v2.Revision.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.run.v2.Revision.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.run.v2.Revision.containers: object expected"); + message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); + } + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.run.v2.Revision.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.run.v2.Revision.volumes: object expected"); + message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); + } + } + switch (object.executionEnvironment) { + default: + if (typeof object.executionEnvironment === "number") { + message.executionEnvironment = object.executionEnvironment; + break; + } + break; + case "EXECUTION_ENVIRONMENT_UNSPECIFIED": + case 0: + message.executionEnvironment = 0; + break; + case "EXECUTION_ENVIRONMENT_GEN1": + case 1: + message.executionEnvironment = 1; + break; + case "EXECUTION_ENVIRONMENT_GEN2": + case 2: + message.executionEnvironment = 2; + break; + } + if (object.encryptionKey != null) + message.encryptionKey = String(object.encryptionKey); + if (object.serviceMesh != null) { + if (typeof object.serviceMesh !== "object") + throw TypeError(".google.cloud.run.v2.Revision.serviceMesh: object expected"); + message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.fromObject(object.serviceMesh); + } + switch (object.encryptionKeyRevocationAction) { + default: + if (typeof object.encryptionKeyRevocationAction === "number") { + message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; + break; + } + break; + case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": + case 0: + message.encryptionKeyRevocationAction = 0; + break; + case "PREVENT_NEW": + case 1: + message.encryptionKeyRevocationAction = 1; + break; + case "SHUTDOWN": + case 2: + message.encryptionKeyRevocationAction = 2; + break; + } + if (object.encryptionKeyShutdownDuration != null) { + if (typeof object.encryptionKeyShutdownDuration !== "object") + throw TypeError(".google.cloud.run.v2.Revision.encryptionKeyShutdownDuration: object expected"); + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.run.v2.Revision.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.run.v2.Revision.conditions: object expected"); + message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); + } + } + if (object.observedGeneration != null) + if ($util.Long) + (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; + else if (typeof object.observedGeneration === "string") + message.observedGeneration = parseInt(object.observedGeneration, 10); + else if (typeof object.observedGeneration === "number") + message.observedGeneration = object.observedGeneration; + else if (typeof object.observedGeneration === "object") + message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); + if (object.logUri != null) + message.logUri = String(object.logUri); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.sessionAffinity != null) + message.sessionAffinity = Boolean(object.sessionAffinity); + if (object.scalingStatus != null) { + if (typeof object.scalingStatus !== "object") + throw TypeError(".google.cloud.run.v2.Revision.scalingStatus: object expected"); + message.scalingStatus = $root.google.cloud.run.v2.RevisionScalingStatus.fromObject(object.scalingStatus); + } + if (object.nodeSelector != null) { + if (typeof object.nodeSelector !== "object") + throw TypeError(".google.cloud.run.v2.Revision.nodeSelector: object expected"); + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); + } + if (object.gpuZonalRedundancyDisabled != null) + message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); + if (object.creator != null) + message.creator = String(object.creator); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Revision message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Revision + * @static + * @param {google.cloud.run.v2.Revision} message Revision + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Revision.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.containers = []; + object.volumes = []; + object.conditions = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.service = ""; + object.scaling = null; + object.vpcAccess = null; + object.timeout = null; + object.serviceAccount = ""; + object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; + object.encryptionKey = ""; + object.serviceMesh = null; + object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; + object.encryptionKeyShutdownDuration = null; + object.reconciling = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.observedGeneration = options.longs === String ? "0" : 0; + object.logUri = ""; + object.maxInstanceRequestConcurrency = 0; + object.satisfiesPzs = false; + object.sessionAffinity = false; + object.scalingStatus = null; + object.nodeSelector = null; + object.creator = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + 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.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.scaling != null && message.hasOwnProperty("scaling")) + object.scaling = $root.google.cloud.run.v2.RevisionScaling.toObject(message.scaling, options); + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) + object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); + } + if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) + object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = message.encryptionKey; + if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) + object.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.toObject(message.serviceMesh, options); + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) + object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); + } + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (typeof message.observedGeneration === "number") + object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; + else + object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; + if (message.logUri != null && message.hasOwnProperty("logUri")) + object.logUri = message.logUri; + if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) + object.maxInstanceRequestConcurrency = message.maxInstanceRequestConcurrency; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) + object.sessionAffinity = message.sessionAffinity; + if (message.scalingStatus != null && message.hasOwnProperty("scalingStatus")) + object.scalingStatus = $root.google.cloud.run.v2.RevisionScalingStatus.toObject(message.scalingStatus, options); + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) + object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; + if (options.oneofs) + object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; + } + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Revision to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.Revision + * @instance + * @returns {Object.} JSON object + */ + Revision.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Revision + * @function getTypeUrl + * @memberof google.cloud.run.v2.Revision + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Revision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.Revision"; + }; + + return Revision; + })(); + + v2.RevisionScalingStatus = (function() { + + /** + * Properties of a RevisionScalingStatus. + * @memberof google.cloud.run.v2 + * @interface IRevisionScalingStatus + * @property {number|null} [desiredMinInstanceCount] RevisionScalingStatus desiredMinInstanceCount + */ + + /** + * Constructs a new RevisionScalingStatus. + * @memberof google.cloud.run.v2 + * @classdesc Represents a RevisionScalingStatus. + * @implements IRevisionScalingStatus + * @constructor + * @param {google.cloud.run.v2.IRevisionScalingStatus=} [properties] Properties to set + */ + function RevisionScalingStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RevisionScalingStatus desiredMinInstanceCount. + * @member {number} desiredMinInstanceCount + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @instance + */ + RevisionScalingStatus.prototype.desiredMinInstanceCount = 0; + + /** + * Creates a new RevisionScalingStatus instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @static + * @param {google.cloud.run.v2.IRevisionScalingStatus=} [properties] Properties to set + * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus instance + */ + RevisionScalingStatus.create = function create(properties) { + return new RevisionScalingStatus(properties); + }; + + /** + * Encodes the specified RevisionScalingStatus message. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @static + * @param {google.cloud.run.v2.IRevisionScalingStatus} message RevisionScalingStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevisionScalingStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.desiredMinInstanceCount != null && Object.hasOwnProperty.call(message, "desiredMinInstanceCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.desiredMinInstanceCount); + return writer; + }; + + /** + * Encodes the specified RevisionScalingStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @static + * @param {google.cloud.run.v2.IRevisionScalingStatus} message RevisionScalingStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevisionScalingStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RevisionScalingStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevisionScalingStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RevisionScalingStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.desiredMinInstanceCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RevisionScalingStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevisionScalingStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RevisionScalingStatus message. + * @function verify + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RevisionScalingStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.desiredMinInstanceCount != null && message.hasOwnProperty("desiredMinInstanceCount")) + if (!$util.isInteger(message.desiredMinInstanceCount)) + return "desiredMinInstanceCount: integer expected"; + return null; + }; + + /** + * Creates a RevisionScalingStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus + */ + RevisionScalingStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.RevisionScalingStatus) + return object; + var message = new $root.google.cloud.run.v2.RevisionScalingStatus(); + if (object.desiredMinInstanceCount != null) + message.desiredMinInstanceCount = object.desiredMinInstanceCount | 0; + return message; + }; + + /** + * Creates a plain object from a RevisionScalingStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @static + * @param {google.cloud.run.v2.RevisionScalingStatus} message RevisionScalingStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RevisionScalingStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.desiredMinInstanceCount = 0; + if (message.desiredMinInstanceCount != null && message.hasOwnProperty("desiredMinInstanceCount")) + object.desiredMinInstanceCount = message.desiredMinInstanceCount; + return object; + }; + + /** + * Converts this RevisionScalingStatus to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @instance + * @returns {Object.} JSON object + */ + RevisionScalingStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RevisionScalingStatus + * @function getTypeUrl + * @memberof google.cloud.run.v2.RevisionScalingStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RevisionScalingStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.RevisionScalingStatus"; + }; + + return RevisionScalingStatus; + })(); + + v2.RevisionTemplate = (function() { + + /** + * Properties of a RevisionTemplate. + * @memberof google.cloud.run.v2 + * @interface IRevisionTemplate + * @property {string|null} [revision] RevisionTemplate revision + * @property {Object.|null} [labels] RevisionTemplate labels + * @property {Object.|null} [annotations] RevisionTemplate annotations + * @property {google.cloud.run.v2.IRevisionScaling|null} [scaling] RevisionTemplate scaling + * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] RevisionTemplate vpcAccess + * @property {google.protobuf.IDuration|null} [timeout] RevisionTemplate timeout + * @property {string|null} [serviceAccount] RevisionTemplate serviceAccount + * @property {Array.|null} [containers] RevisionTemplate containers + * @property {Array.|null} [volumes] RevisionTemplate volumes + * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] RevisionTemplate executionEnvironment + * @property {string|null} [encryptionKey] RevisionTemplate encryptionKey + * @property {number|null} [maxInstanceRequestConcurrency] RevisionTemplate maxInstanceRequestConcurrency + * @property {google.cloud.run.v2.IServiceMesh|null} [serviceMesh] RevisionTemplate serviceMesh + * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] RevisionTemplate encryptionKeyRevocationAction + * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] RevisionTemplate encryptionKeyShutdownDuration + * @property {boolean|null} [sessionAffinity] RevisionTemplate sessionAffinity + * @property {boolean|null} [healthCheckDisabled] RevisionTemplate healthCheckDisabled + * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] RevisionTemplate nodeSelector + * @property {boolean|null} [gpuZonalRedundancyDisabled] RevisionTemplate gpuZonalRedundancyDisabled + */ + + /** + * Constructs a new RevisionTemplate. + * @memberof google.cloud.run.v2 + * @classdesc Represents a RevisionTemplate. + * @implements IRevisionTemplate + * @constructor + * @param {google.cloud.run.v2.IRevisionTemplate=} [properties] Properties to set + */ + function RevisionTemplate(properties) { + this.labels = {}; + this.annotations = {}; + this.containers = []; + 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]]; + } + + /** + * RevisionTemplate revision. + * @member {string} revision + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.revision = ""; + + /** + * RevisionTemplate labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.labels = $util.emptyObject; + + /** + * RevisionTemplate annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.annotations = $util.emptyObject; + + /** + * RevisionTemplate scaling. + * @member {google.cloud.run.v2.IRevisionScaling|null|undefined} scaling + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.scaling = null; + + /** + * RevisionTemplate vpcAccess. + * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.vpcAccess = null; + + /** + * RevisionTemplate timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.timeout = null; + + /** + * RevisionTemplate serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.serviceAccount = ""; + + /** + * RevisionTemplate containers. + * @member {Array.} containers + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.containers = $util.emptyArray; + + /** + * RevisionTemplate volumes. + * @member {Array.} volumes + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.volumes = $util.emptyArray; + + /** + * RevisionTemplate executionEnvironment. + * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.executionEnvironment = 0; + + /** + * RevisionTemplate encryptionKey. + * @member {string} encryptionKey + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.encryptionKey = ""; + + /** + * RevisionTemplate maxInstanceRequestConcurrency. + * @member {number} maxInstanceRequestConcurrency + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.maxInstanceRequestConcurrency = 0; + + /** + * RevisionTemplate serviceMesh. + * @member {google.cloud.run.v2.IServiceMesh|null|undefined} serviceMesh + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.serviceMesh = null; + + /** + * RevisionTemplate encryptionKeyRevocationAction. + * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.encryptionKeyRevocationAction = 0; + + /** + * RevisionTemplate encryptionKeyShutdownDuration. + * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.encryptionKeyShutdownDuration = null; + + /** + * RevisionTemplate sessionAffinity. + * @member {boolean} sessionAffinity + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.sessionAffinity = false; + + /** + * RevisionTemplate healthCheckDisabled. + * @member {boolean} healthCheckDisabled + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.healthCheckDisabled = false; + + /** + * RevisionTemplate nodeSelector. + * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.nodeSelector = null; + + /** + * RevisionTemplate gpuZonalRedundancyDisabled. + * @member {boolean|null|undefined} gpuZonalRedundancyDisabled + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + */ + RevisionTemplate.prototype.gpuZonalRedundancyDisabled = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RevisionTemplate.prototype, "_gpuZonalRedundancyDisabled", { + get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RevisionTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.RevisionTemplate + * @static + * @param {google.cloud.run.v2.IRevisionTemplate=} [properties] Properties to set + * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate instance + */ + RevisionTemplate.create = function create(properties) { + return new RevisionTemplate(properties); + }; + + /** + * Encodes the specified RevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.RevisionTemplate + * @static + * @param {google.cloud.run.v2.IRevisionTemplate} message RevisionTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevisionTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.revision); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); + if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) + $root.google.cloud.run.v2.RevisionScaling.encode(message.scaling, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) + $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 6, wireType 2 =*/50).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.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccount); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.executionEnvironment); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.encryptionKey); + if (message.maxInstanceRequestConcurrency != null && Object.hasOwnProperty.call(message, "maxInstanceRequestConcurrency")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.maxInstanceRequestConcurrency); + if (message.serviceMesh != null && Object.hasOwnProperty.call(message, "serviceMesh")) + $root.google.cloud.run.v2.ServiceMesh.encode(message.serviceMesh, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.encryptionKeyRevocationAction); + if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) + $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.sessionAffinity != null && Object.hasOwnProperty.call(message, "sessionAffinity")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.sessionAffinity); + if (message.healthCheckDisabled != null && Object.hasOwnProperty.call(message, "healthCheckDisabled")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.healthCheckDisabled); + if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) + $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.gpuZonalRedundancyDisabled); + return writer; + }; + + /** + * Encodes the specified RevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.RevisionTemplate + * @static + * @param {google.cloud.run.v2.IRevisionTemplate} message RevisionTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevisionTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RevisionTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.RevisionTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevisionTemplate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RevisionTemplate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revision = reader.string(); + break; + } + case 2: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 3: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 4: { + message.scaling = $root.google.cloud.run.v2.RevisionScaling.decode(reader, reader.uint32()); + break; + } + case 6: { + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.serviceAccount = reader.string(); + break; + } + case 10: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); + break; + } + case 13: { + message.executionEnvironment = reader.int32(); + break; + } + case 14: { + message.encryptionKey = reader.string(); + break; + } + case 15: { + message.maxInstanceRequestConcurrency = reader.int32(); + break; + } + case 16: { + message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.decode(reader, reader.uint32()); + break; + } + case 17: { + message.encryptionKeyRevocationAction = reader.int32(); + break; + } + case 18: { + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 19: { + message.sessionAffinity = reader.bool(); + break; + } + case 20: { + message.healthCheckDisabled = reader.bool(); + break; + } + case 21: { + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); + break; + } + case 24: { + message.gpuZonalRedundancyDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RevisionTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.RevisionTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevisionTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RevisionTemplate message. + * @function verify + * @memberof google.cloud.run.v2.RevisionTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RevisionTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isString(message.revision)) + return "revision: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.scaling != null && message.hasOwnProperty("scaling")) { + var error = $root.google.cloud.run.v2.RevisionScaling.verify(message.scaling); + if (error) + return "scaling." + error; + } + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { + var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); + if (error) + return "vpcAccess." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + 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.run.v2.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) + switch (message.executionEnvironment) { + default: + return "executionEnvironment: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + if (!$util.isString(message.encryptionKey)) + return "encryptionKey: string expected"; + if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) + if (!$util.isInteger(message.maxInstanceRequestConcurrency)) + return "maxInstanceRequestConcurrency: integer expected"; + if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) { + var error = $root.google.cloud.run.v2.ServiceMesh.verify(message.serviceMesh); + if (error) + return "serviceMesh." + error; + } + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + switch (message.encryptionKeyRevocationAction) { + default: + return "encryptionKeyRevocationAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { + var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); + if (error) + return "encryptionKeyShutdownDuration." + error; + } + if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) + if (typeof message.sessionAffinity !== "boolean") + return "sessionAffinity: boolean expected"; + if (message.healthCheckDisabled != null && message.hasOwnProperty("healthCheckDisabled")) + if (typeof message.healthCheckDisabled !== "boolean") + return "healthCheckDisabled: boolean expected"; + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { + var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); + if (error) + return "nodeSelector." + error; + } + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + properties._gpuZonalRedundancyDisabled = 1; + if (typeof message.gpuZonalRedundancyDisabled !== "boolean") + return "gpuZonalRedundancyDisabled: boolean expected"; + } + return null; + }; + + /** + * Creates a RevisionTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.RevisionTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate + */ + RevisionTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.RevisionTemplate) + return object; + var message = new $root.google.cloud.run.v2.RevisionTemplate(); + if (object.revision != null) + message.revision = String(object.revision); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.RevisionTemplate.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.RevisionTemplate.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.scaling != null) { + if (typeof object.scaling !== "object") + throw TypeError(".google.cloud.run.v2.RevisionTemplate.scaling: object expected"); + message.scaling = $root.google.cloud.run.v2.RevisionScaling.fromObject(object.scaling); + } + if (object.vpcAccess != null) { + if (typeof object.vpcAccess !== "object") + throw TypeError(".google.cloud.run.v2.RevisionTemplate.vpcAccess: object expected"); + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.run.v2.RevisionTemplate.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.run.v2.RevisionTemplate.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.run.v2.RevisionTemplate.containers: object expected"); + message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); + } + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.run.v2.RevisionTemplate.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.run.v2.RevisionTemplate.volumes: object expected"); + message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); + } + } + switch (object.executionEnvironment) { + default: + if (typeof object.executionEnvironment === "number") { + message.executionEnvironment = object.executionEnvironment; + break; + } + break; + case "EXECUTION_ENVIRONMENT_UNSPECIFIED": + case 0: + message.executionEnvironment = 0; + break; + case "EXECUTION_ENVIRONMENT_GEN1": + case 1: + message.executionEnvironment = 1; + break; + case "EXECUTION_ENVIRONMENT_GEN2": + case 2: + message.executionEnvironment = 2; + break; + } + if (object.encryptionKey != null) + message.encryptionKey = String(object.encryptionKey); + if (object.maxInstanceRequestConcurrency != null) + message.maxInstanceRequestConcurrency = object.maxInstanceRequestConcurrency | 0; + if (object.serviceMesh != null) { + if (typeof object.serviceMesh !== "object") + throw TypeError(".google.cloud.run.v2.RevisionTemplate.serviceMesh: object expected"); + message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.fromObject(object.serviceMesh); + } + switch (object.encryptionKeyRevocationAction) { + default: + if (typeof object.encryptionKeyRevocationAction === "number") { + message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; + break; + } + break; + case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": + case 0: + message.encryptionKeyRevocationAction = 0; + break; + case "PREVENT_NEW": + case 1: + message.encryptionKeyRevocationAction = 1; + break; + case "SHUTDOWN": + case 2: + message.encryptionKeyRevocationAction = 2; + break; + } + if (object.encryptionKeyShutdownDuration != null) { + if (typeof object.encryptionKeyShutdownDuration !== "object") + throw TypeError(".google.cloud.run.v2.RevisionTemplate.encryptionKeyShutdownDuration: object expected"); + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); + } + if (object.sessionAffinity != null) + message.sessionAffinity = Boolean(object.sessionAffinity); + if (object.healthCheckDisabled != null) + message.healthCheckDisabled = Boolean(object.healthCheckDisabled); + if (object.nodeSelector != null) { + if (typeof object.nodeSelector !== "object") + throw TypeError(".google.cloud.run.v2.RevisionTemplate.nodeSelector: object expected"); + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); + } + if (object.gpuZonalRedundancyDisabled != null) + message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); + return message; + }; + + /** + * Creates a plain object from a RevisionTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.RevisionTemplate + * @static + * @param {google.cloud.run.v2.RevisionTemplate} message RevisionTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RevisionTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.containers = []; + object.volumes = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.revision = ""; + object.scaling = null; + object.vpcAccess = null; + object.timeout = null; + object.serviceAccount = ""; + object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; + object.encryptionKey = ""; + object.maxInstanceRequestConcurrency = 0; + object.serviceMesh = null; + object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; + object.encryptionKeyShutdownDuration = null; + object.sessionAffinity = false; + object.healthCheckDisabled = false; + object.nodeSelector = null; + } + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.scaling != null && message.hasOwnProperty("scaling")) + object.scaling = $root.google.cloud.run.v2.RevisionScaling.toObject(message.scaling, options); + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) + object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); + } + if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) + object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = message.encryptionKey; + if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) + object.maxInstanceRequestConcurrency = message.maxInstanceRequestConcurrency; + if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) + object.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.toObject(message.serviceMesh, options); + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) + object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); + if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) + object.sessionAffinity = message.sessionAffinity; + if (message.healthCheckDisabled != null && message.hasOwnProperty("healthCheckDisabled")) + object.healthCheckDisabled = message.healthCheckDisabled; + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) + object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; + if (options.oneofs) + object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; + } + return object; + }; + + /** + * Converts this RevisionTemplate to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.RevisionTemplate + * @instance + * @returns {Object.} JSON object + */ + RevisionTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RevisionTemplate + * @function getTypeUrl + * @memberof google.cloud.run.v2.RevisionTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RevisionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.RevisionTemplate"; + }; + + return RevisionTemplate; + })(); + + v2.Services = (function() { + + /** + * Constructs a new Services service. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Services + * @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 Services(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Services.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Services; + + /** + * Creates new Services service using the specified rpc implementation. + * @function create + * @memberof google.cloud.run.v2.Services + * @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 {Services} RPC service. Useful where requests and/or responses are streamed. + */ + Services.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.run.v2.Services|createService}. + * @memberof google.cloud.run.v2.Services + * @typedef CreateServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateService. + * @function createService + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.cloud.run.v2.ICreateServiceRequest} request CreateServiceRequest message or plain object + * @param {google.cloud.run.v2.Services.CreateServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.createService = function createService(request, callback) { + return this.rpcCall(createService, $root.google.cloud.run.v2.CreateServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateService" }); + + /** + * Calls CreateService. + * @function createService + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.cloud.run.v2.ICreateServiceRequest} request CreateServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Services|getService}. + * @memberof google.cloud.run.v2.Services + * @typedef GetServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.Service} [response] Service + */ + + /** + * Calls GetService. + * @function getService + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.cloud.run.v2.IGetServiceRequest} request GetServiceRequest message or plain object + * @param {google.cloud.run.v2.Services.GetServiceCallback} callback Node-style callback called with the error, if any, and Service + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.getService = function getService(request, callback) { + return this.rpcCall(getService, $root.google.cloud.run.v2.GetServiceRequest, $root.google.cloud.run.v2.Service, request, callback); + }, "name", { value: "GetService" }); + + /** + * Calls GetService. + * @function getService + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.cloud.run.v2.IGetServiceRequest} request GetServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Services|listServices}. + * @memberof google.cloud.run.v2.Services + * @typedef ListServicesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.ListServicesResponse} [response] ListServicesResponse + */ + + /** + * Calls ListServices. + * @function listServices + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.cloud.run.v2.IListServicesRequest} request ListServicesRequest message or plain object + * @param {google.cloud.run.v2.Services.ListServicesCallback} callback Node-style callback called with the error, if any, and ListServicesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.listServices = function listServices(request, callback) { + return this.rpcCall(listServices, $root.google.cloud.run.v2.ListServicesRequest, $root.google.cloud.run.v2.ListServicesResponse, request, callback); + }, "name", { value: "ListServices" }); + + /** + * Calls ListServices. + * @function listServices + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.cloud.run.v2.IListServicesRequest} request ListServicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Services|updateService}. + * @memberof google.cloud.run.v2.Services + * @typedef UpdateServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateService. + * @function updateService + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.cloud.run.v2.IUpdateServiceRequest} request UpdateServiceRequest message or plain object + * @param {google.cloud.run.v2.Services.UpdateServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.updateService = function updateService(request, callback) { + return this.rpcCall(updateService, $root.google.cloud.run.v2.UpdateServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateService" }); + + /** + * Calls UpdateService. + * @function updateService + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.cloud.run.v2.IUpdateServiceRequest} request UpdateServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Services|deleteService}. + * @memberof google.cloud.run.v2.Services + * @typedef DeleteServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteService. + * @function deleteService + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.cloud.run.v2.IDeleteServiceRequest} request DeleteServiceRequest message or plain object + * @param {google.cloud.run.v2.Services.DeleteServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.deleteService = function deleteService(request, callback) { + return this.rpcCall(deleteService, $root.google.cloud.run.v2.DeleteServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteService" }); + + /** + * Calls DeleteService. + * @function deleteService + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.cloud.run.v2.IDeleteServiceRequest} request DeleteServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Services|getIamPolicy}. + * @memberof google.cloud.run.v2.Services + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.run.v2.Services.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Services|setIamPolicy}. + * @memberof google.cloud.run.v2.Services + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.run.v2.Services.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Services|testIamPermissions}. + * @memberof google.cloud.run.v2.Services + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.run.v2.Services.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Services.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.run.v2.Services + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Services; + })(); + + v2.CreateServiceRequest = (function() { + + /** + * Properties of a CreateServiceRequest. + * @memberof google.cloud.run.v2 + * @interface ICreateServiceRequest + * @property {string|null} [parent] CreateServiceRequest parent + * @property {google.cloud.run.v2.IService|null} [service] CreateServiceRequest service + * @property {string|null} [serviceId] CreateServiceRequest serviceId + * @property {boolean|null} [validateOnly] CreateServiceRequest validateOnly + */ + + /** + * Constructs a new CreateServiceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a CreateServiceRequest. + * @implements ICreateServiceRequest + * @constructor + * @param {google.cloud.run.v2.ICreateServiceRequest=} [properties] Properties to set + */ + function CreateServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateServiceRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.CreateServiceRequest + * @instance + */ + CreateServiceRequest.prototype.parent = ""; + + /** + * CreateServiceRequest service. + * @member {google.cloud.run.v2.IService|null|undefined} service + * @memberof google.cloud.run.v2.CreateServiceRequest + * @instance + */ + CreateServiceRequest.prototype.service = null; + + /** + * CreateServiceRequest serviceId. + * @member {string} serviceId + * @memberof google.cloud.run.v2.CreateServiceRequest + * @instance + */ + CreateServiceRequest.prototype.serviceId = ""; + + /** + * CreateServiceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.CreateServiceRequest + * @instance + */ + CreateServiceRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.CreateServiceRequest + * @static + * @param {google.cloud.run.v2.ICreateServiceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest instance + */ + CreateServiceRequest.create = function create(properties) { + return new CreateServiceRequest(properties); + }; + + /** + * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.CreateServiceRequest + * @static + * @param {google.cloud.run.v2.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceRequest.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.service != null && Object.hasOwnProperty.call(message, "service")) + $root.google.cloud.run.v2.Service.encode(message.service, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceId != null && Object.hasOwnProperty.call(message, "serviceId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.CreateServiceRequest + * @static + * @param {google.cloud.run.v2.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.CreateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.service = $root.google.cloud.run.v2.Service.decode(reader, reader.uint32()); + break; + } + case 3: { + message.serviceId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.CreateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateServiceRequest message. + * @function verify + * @memberof google.cloud.run.v2.CreateServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateServiceRequest.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.service != null && message.hasOwnProperty("service")) { + var error = $root.google.cloud.run.v2.Service.verify(message.service); + if (error) + return "service." + error; + } + if (message.serviceId != null && message.hasOwnProperty("serviceId")) + if (!$util.isString(message.serviceId)) + return "serviceId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.CreateServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest + */ + CreateServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.CreateServiceRequest) + return object; + var message = new $root.google.cloud.run.v2.CreateServiceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.service != null) { + if (typeof object.service !== "object") + throw TypeError(".google.cloud.run.v2.CreateServiceRequest.service: object expected"); + message.service = $root.google.cloud.run.v2.Service.fromObject(object.service); + } + if (object.serviceId != null) + message.serviceId = String(object.serviceId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.CreateServiceRequest + * @static + * @param {google.cloud.run.v2.CreateServiceRequest} message CreateServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.service = null; + object.serviceId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.service != null && message.hasOwnProperty("service")) + object.service = $root.google.cloud.run.v2.Service.toObject(message.service, options); + if (message.serviceId != null && message.hasOwnProperty("serviceId")) + object.serviceId = message.serviceId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.CreateServiceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateServiceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.CreateServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.CreateServiceRequest"; + }; + + return CreateServiceRequest; + })(); + + v2.UpdateServiceRequest = (function() { + + /** + * Properties of an UpdateServiceRequest. + * @memberof google.cloud.run.v2 + * @interface IUpdateServiceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServiceRequest updateMask + * @property {google.cloud.run.v2.IService|null} [service] UpdateServiceRequest service + * @property {boolean|null} [validateOnly] UpdateServiceRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateServiceRequest allowMissing + */ + + /** + * Constructs a new UpdateServiceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents an UpdateServiceRequest. + * @implements IUpdateServiceRequest + * @constructor + * @param {google.cloud.run.v2.IUpdateServiceRequest=} [properties] Properties to set + */ + function UpdateServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateServiceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.updateMask = null; + + /** + * UpdateServiceRequest service. + * @member {google.cloud.run.v2.IService|null|undefined} service + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.service = null; + + /** + * UpdateServiceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.validateOnly = false; + + /** + * UpdateServiceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @static + * @param {google.cloud.run.v2.IUpdateServiceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest instance + */ + UpdateServiceRequest.create = function create(properties) { + return new UpdateServiceRequest(properties); + }; + + /** + * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @static + * @param {google.cloud.run.v2.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + $root.google.cloud.run.v2.Service.encode(message.service, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @static + * @param {google.cloud.run.v2.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServiceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.UpdateServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 1: { + message.service = $root.google.cloud.run.v2.Service.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateServiceRequest message. + * @function verify + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.service != null && message.hasOwnProperty("service")) { + var error = $root.google.cloud.run.v2.Service.verify(message.service); + if (error) + return "service." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest + */ + UpdateServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.UpdateServiceRequest) + return object; + var message = new $root.google.cloud.run.v2.UpdateServiceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.run.v2.UpdateServiceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.service != null) { + if (typeof object.service !== "object") + throw TypeError(".google.cloud.run.v2.UpdateServiceRequest.service: object expected"); + message.service = $root.google.cloud.run.v2.Service.fromObject(object.service); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @static + * @param {google.cloud.run.v2.UpdateServiceRequest} message UpdateServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.service = null; + object.updateMask = null; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.service != null && message.hasOwnProperty("service")) + object.service = $root.google.cloud.run.v2.Service.toObject(message.service, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateServiceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.UpdateServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.UpdateServiceRequest"; + }; + + return UpdateServiceRequest; + })(); + + v2.ListServicesRequest = (function() { + + /** + * Properties of a ListServicesRequest. + * @memberof google.cloud.run.v2 + * @interface IListServicesRequest + * @property {string|null} [parent] ListServicesRequest parent + * @property {number|null} [pageSize] ListServicesRequest pageSize + * @property {string|null} [pageToken] ListServicesRequest pageToken + * @property {boolean|null} [showDeleted] ListServicesRequest showDeleted + */ + + /** + * Constructs a new ListServicesRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListServicesRequest. + * @implements IListServicesRequest + * @constructor + * @param {google.cloud.run.v2.IListServicesRequest=} [properties] Properties to set + */ + function ListServicesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServicesRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.parent = ""; + + /** + * ListServicesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.run.v2.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.pageSize = 0; + + /** + * ListServicesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.run.v2.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.pageToken = ""; + + /** + * ListServicesRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.run.v2.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.showDeleted = false; + + /** + * Creates a new ListServicesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListServicesRequest + * @static + * @param {google.cloud.run.v2.IListServicesRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest instance + */ + ListServicesRequest.create = function create(properties) { + return new ListServicesRequest(properties); + }; + + /** + * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListServicesRequest + * @static + * @param {google.cloud.run.v2.IListServicesRequest} message ListServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListServicesRequest + * @static + * @param {google.cloud.run.v2.IListServicesRequest} message ListServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListServicesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServicesRequest message. + * @function verify + * @memberof google.cloud.run.v2.ListServicesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServicesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListServicesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest + */ + ListServicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListServicesRequest) + return object; + var message = new $root.google.cloud.run.v2.ListServicesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListServicesRequest + * @static + * @param {google.cloud.run.v2.ListServicesRequest} message ListServicesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServicesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + 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.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListServicesRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListServicesRequest + * @instance + * @returns {Object.} JSON object + */ + ListServicesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServicesRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListServicesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServicesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListServicesRequest"; + }; + + return ListServicesRequest; + })(); + + v2.ListServicesResponse = (function() { + + /** + * Properties of a ListServicesResponse. + * @memberof google.cloud.run.v2 + * @interface IListServicesResponse + * @property {Array.|null} [services] ListServicesResponse services + * @property {string|null} [nextPageToken] ListServicesResponse nextPageToken + * @property {Array.|null} [unreachable] ListServicesResponse unreachable + */ + + /** + * Constructs a new ListServicesResponse. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListServicesResponse. + * @implements IListServicesResponse + * @constructor + * @param {google.cloud.run.v2.IListServicesResponse=} [properties] Properties to set + */ + function ListServicesResponse(properties) { + this.services = []; + 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]]; + } + + /** + * ListServicesResponse services. + * @member {Array.} services + * @memberof google.cloud.run.v2.ListServicesResponse + * @instance + */ + ListServicesResponse.prototype.services = $util.emptyArray; + + /** + * ListServicesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.run.v2.ListServicesResponse + * @instance + */ + ListServicesResponse.prototype.nextPageToken = ""; + + /** + * ListServicesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.run.v2.ListServicesResponse + * @instance + */ + ListServicesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListServicesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListServicesResponse + * @static + * @param {google.cloud.run.v2.IListServicesResponse=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse instance + */ + ListServicesResponse.create = function create(properties) { + return new ListServicesResponse(properties); + }; + + /** + * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListServicesResponse + * @static + * @param {google.cloud.run.v2.IListServicesResponse} message ListServicesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.services != null && message.services.length) + for (var i = 0; i < message.services.length; ++i) + $root.google.cloud.run.v2.Service.encode(message.services[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 ListServicesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListServicesResponse + * @static + * @param {google.cloud.run.v2.IListServicesResponse} message ListServicesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListServicesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListServicesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.services && message.services.length)) + message.services = []; + message.services.push($root.google.cloud.run.v2.Service.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 ListServicesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListServicesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServicesResponse message. + * @function verify + * @memberof google.cloud.run.v2.ListServicesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServicesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.services != null && message.hasOwnProperty("services")) { + if (!Array.isArray(message.services)) + return "services: array expected"; + for (var i = 0; i < message.services.length; ++i) { + var error = $root.google.cloud.run.v2.Service.verify(message.services[i]); + if (error) + return "services." + 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 ListServicesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListServicesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse + */ + ListServicesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListServicesResponse) + return object; + var message = new $root.google.cloud.run.v2.ListServicesResponse(); + if (object.services) { + if (!Array.isArray(object.services)) + throw TypeError(".google.cloud.run.v2.ListServicesResponse.services: array expected"); + message.services = []; + for (var i = 0; i < object.services.length; ++i) { + if (typeof object.services[i] !== "object") + throw TypeError(".google.cloud.run.v2.ListServicesResponse.services: object expected"); + message.services[i] = $root.google.cloud.run.v2.Service.fromObject(object.services[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.run.v2.ListServicesResponse.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 ListServicesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListServicesResponse + * @static + * @param {google.cloud.run.v2.ListServicesResponse} message ListServicesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServicesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.services = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.services && message.services.length) { + object.services = []; + for (var j = 0; j < message.services.length; ++j) + object.services[j] = $root.google.cloud.run.v2.Service.toObject(message.services[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 ListServicesResponse to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListServicesResponse + * @instance + * @returns {Object.} JSON object + */ + ListServicesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServicesResponse + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListServicesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServicesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListServicesResponse"; + }; + + return ListServicesResponse; + })(); + + v2.GetServiceRequest = (function() { + + /** + * Properties of a GetServiceRequest. + * @memberof google.cloud.run.v2 + * @interface IGetServiceRequest + * @property {string|null} [name] GetServiceRequest name + */ + + /** + * Constructs a new GetServiceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GetServiceRequest. + * @implements IGetServiceRequest + * @constructor + * @param {google.cloud.run.v2.IGetServiceRequest=} [properties] Properties to set + */ + function GetServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetServiceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.GetServiceRequest + * @instance + */ + GetServiceRequest.prototype.name = ""; + + /** + * Creates a new GetServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GetServiceRequest + * @static + * @param {google.cloud.run.v2.IGetServiceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest instance + */ + GetServiceRequest.create = function create(properties) { + return new GetServiceRequest(properties); + }; + + /** + * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GetServiceRequest + * @static + * @param {google.cloud.run.v2.IGetServiceRequest} message GetServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceRequest.encode = function encode(message, writer) { + 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 GetServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GetServiceRequest + * @static + * @param {google.cloud.run.v2.IGetServiceRequest} message GetServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.GetServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GetServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServiceRequest message. + * @function verify + * @memberof google.cloud.run.v2.GetServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServiceRequest.verify = function verify(message) { + if (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 GetServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.GetServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest + */ + GetServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GetServiceRequest) + return object; + var message = new $root.google.cloud.run.v2.GetServiceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.GetServiceRequest + * @static + * @param {google.cloud.run.v2.GetServiceRequest} message GetServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServiceRequest.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 GetServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.GetServiceRequest + * @instance + * @returns {Object.} JSON object + */ + GetServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetServiceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.GetServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.GetServiceRequest"; + }; + + return GetServiceRequest; + })(); + + v2.DeleteServiceRequest = (function() { + + /** + * Properties of a DeleteServiceRequest. + * @memberof google.cloud.run.v2 + * @interface IDeleteServiceRequest + * @property {string|null} [name] DeleteServiceRequest name + * @property {boolean|null} [validateOnly] DeleteServiceRequest validateOnly + * @property {string|null} [etag] DeleteServiceRequest etag + */ + + /** + * Constructs a new DeleteServiceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a DeleteServiceRequest. + * @implements IDeleteServiceRequest + * @constructor + * @param {google.cloud.run.v2.IDeleteServiceRequest=} [properties] Properties to set + */ + function DeleteServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteServiceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @instance + */ + DeleteServiceRequest.prototype.name = ""; + + /** + * DeleteServiceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @instance + */ + DeleteServiceRequest.prototype.validateOnly = false; + + /** + * DeleteServiceRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @instance + */ + DeleteServiceRequest.prototype.etag = ""; + + /** + * Creates a new DeleteServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @static + * @param {google.cloud.run.v2.IDeleteServiceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest instance + */ + DeleteServiceRequest.create = function create(properties) { + return new DeleteServiceRequest(properties); + }; + + /** + * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @static + * @param {google.cloud.run.v2.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @static + * @param {google.cloud.run.v2.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteServiceRequest message. + * @function verify + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest + */ + DeleteServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.DeleteServiceRequest) + return object; + var message = new $root.google.cloud.run.v2.DeleteServiceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @static + * @param {google.cloud.run.v2.DeleteServiceRequest} message DeleteServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteServiceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.DeleteServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.DeleteServiceRequest"; + }; + + return DeleteServiceRequest; + })(); + + v2.Service = (function() { + + /** + * Properties of a Service. + * @memberof google.cloud.run.v2 + * @interface IService + * @property {string|null} [name] Service name + * @property {string|null} [description] Service description + * @property {string|null} [uid] Service uid + * @property {number|Long|null} [generation] Service generation + * @property {Object.|null} [labels] Service labels + * @property {Object.|null} [annotations] Service annotations + * @property {google.protobuf.ITimestamp|null} [createTime] Service createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Service updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Service deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Service expireTime + * @property {string|null} [creator] Service creator + * @property {string|null} [lastModifier] Service lastModifier + * @property {string|null} [client] Service client + * @property {string|null} [clientVersion] Service clientVersion + * @property {google.cloud.run.v2.IngressTraffic|null} [ingress] Service ingress + * @property {google.api.LaunchStage|null} [launchStage] Service launchStage + * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Service binaryAuthorization + * @property {google.cloud.run.v2.IRevisionTemplate|null} [template] Service template + * @property {Array.|null} [traffic] Service traffic + * @property {google.cloud.run.v2.IServiceScaling|null} [scaling] Service scaling + * @property {boolean|null} [invokerIamDisabled] Service invokerIamDisabled + * @property {boolean|null} [defaultUriDisabled] Service defaultUriDisabled + * @property {Array.|null} [urls] Service urls + * @property {boolean|null} [iapEnabled] Service iapEnabled + * @property {google.cloud.run.v2.Service.IMultiRegionSettings|null} [multiRegionSettings] Service multiRegionSettings + * @property {Array.|null} [customAudiences] Service customAudiences + * @property {number|Long|null} [observedGeneration] Service observedGeneration + * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Service terminalCondition + * @property {Array.|null} [conditions] Service conditions + * @property {string|null} [latestReadyRevision] Service latestReadyRevision + * @property {string|null} [latestCreatedRevision] Service latestCreatedRevision + * @property {Array.|null} [trafficStatuses] Service trafficStatuses + * @property {string|null} [uri] Service uri + * @property {boolean|null} [satisfiesPzs] Service satisfiesPzs + * @property {boolean|null} [threatDetectionEnabled] Service threatDetectionEnabled + * @property {google.cloud.run.v2.IBuildConfig|null} [buildConfig] Service buildConfig + * @property {boolean|null} [reconciling] Service reconciling + * @property {string|null} [etag] Service etag + */ + + /** + * Constructs a new Service. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Service. + * @implements IService + * @constructor + * @param {google.cloud.run.v2.IService=} [properties] Properties to set + */ + function Service(properties) { + this.labels = {}; + this.annotations = {}; + this.traffic = []; + this.urls = []; + this.customAudiences = []; + this.conditions = []; + this.trafficStatuses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Service name. + * @member {string} name + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.name = ""; + + /** + * Service description. + * @member {string} description + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.description = ""; + + /** + * Service uid. + * @member {string} uid + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.uid = ""; + + /** + * Service generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Service labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.labels = $util.emptyObject; + + /** + * Service annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.annotations = $util.emptyObject; + + /** + * Service createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.createTime = null; + + /** + * Service updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.updateTime = null; + + /** + * Service deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.deleteTime = null; + + /** + * Service expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.expireTime = null; + + /** + * Service creator. + * @member {string} creator + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.creator = ""; + + /** + * Service lastModifier. + * @member {string} lastModifier + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.lastModifier = ""; + + /** + * Service client. + * @member {string} client + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.client = ""; + + /** + * Service clientVersion. + * @member {string} clientVersion + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.clientVersion = ""; + + /** + * Service ingress. + * @member {google.cloud.run.v2.IngressTraffic} ingress + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.ingress = 0; + + /** + * Service launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.launchStage = 0; + + /** + * Service binaryAuthorization. + * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.binaryAuthorization = null; + + /** + * Service template. + * @member {google.cloud.run.v2.IRevisionTemplate|null|undefined} template + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.template = null; + + /** + * Service traffic. + * @member {Array.} traffic + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.traffic = $util.emptyArray; + + /** + * Service scaling. + * @member {google.cloud.run.v2.IServiceScaling|null|undefined} scaling + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.scaling = null; + + /** + * Service invokerIamDisabled. + * @member {boolean} invokerIamDisabled + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.invokerIamDisabled = false; + + /** + * Service defaultUriDisabled. + * @member {boolean} defaultUriDisabled + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.defaultUriDisabled = false; + + /** + * Service urls. + * @member {Array.} urls + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.urls = $util.emptyArray; + + /** + * Service iapEnabled. + * @member {boolean} iapEnabled + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.iapEnabled = false; + + /** + * Service multiRegionSettings. + * @member {google.cloud.run.v2.Service.IMultiRegionSettings|null|undefined} multiRegionSettings + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.multiRegionSettings = null; + + /** + * Service customAudiences. + * @member {Array.} customAudiences + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.customAudiences = $util.emptyArray; + + /** + * Service observedGeneration. + * @member {number|Long} observedGeneration + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Service terminalCondition. + * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.terminalCondition = null; + + /** + * Service conditions. + * @member {Array.} conditions + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.conditions = $util.emptyArray; + + /** + * Service latestReadyRevision. + * @member {string} latestReadyRevision + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.latestReadyRevision = ""; + + /** + * Service latestCreatedRevision. + * @member {string} latestCreatedRevision + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.latestCreatedRevision = ""; + + /** + * Service trafficStatuses. + * @member {Array.} trafficStatuses + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.trafficStatuses = $util.emptyArray; + + /** + * Service uri. + * @member {string} uri + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.uri = ""; + + /** + * Service satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.satisfiesPzs = false; + + /** + * Service threatDetectionEnabled. + * @member {boolean} threatDetectionEnabled + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.threatDetectionEnabled = false; + + /** + * Service buildConfig. + * @member {google.cloud.run.v2.IBuildConfig|null|undefined} buildConfig + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.buildConfig = null; + + /** + * Service reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.reconciling = false; + + /** + * Service etag. + * @member {string} etag + * @memberof google.cloud.run.v2.Service + * @instance + */ + Service.prototype.etag = ""; + + /** + * Creates a new Service instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Service + * @static + * @param {google.cloud.run.v2.IService=} [properties] Properties to set + * @returns {google.cloud.run.v2.Service} Service instance + */ + Service.create = function create(properties) { + return new Service(properties); + }; + + /** + * Encodes the specified Service message. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Service + * @static + * @param {google.cloud.run.v2.IService} message Service message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Service.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.generation); + 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.creator); + if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.lastModifier); + if (message.client != null && Object.hasOwnProperty.call(message, "client")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.client); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.clientVersion); + if (message.ingress != null && Object.hasOwnProperty.call(message, "ingress")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.ingress); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); + if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) + $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.template != null && Object.hasOwnProperty.call(message, "template")) + $root.google.cloud.run.v2.RevisionTemplate.encode(message.template, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.traffic != null && message.traffic.length) + for (var i = 0; i < message.traffic.length; ++i) + $root.google.cloud.run.v2.TrafficTarget.encode(message.traffic[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) + $root.google.cloud.run.v2.ServiceScaling.encode(message.scaling, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.invokerIamDisabled != null && Object.hasOwnProperty.call(message, "invokerIamDisabled")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.invokerIamDisabled); + if (message.defaultUriDisabled != null && Object.hasOwnProperty.call(message, "defaultUriDisabled")) + writer.uint32(/* id 22, wireType 0 =*/176).bool(message.defaultUriDisabled); + if (message.urls != null && message.urls.length) + for (var i = 0; i < message.urls.length; ++i) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.urls[i]); + if (message.iapEnabled != null && Object.hasOwnProperty.call(message, "iapEnabled")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.iapEnabled); + if (message.multiRegionSettings != null && Object.hasOwnProperty.call(message, "multiRegionSettings")) + $root.google.cloud.run.v2.Service.MultiRegionSettings.encode(message.multiRegionSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) + writer.uint32(/* id 30, wireType 0 =*/240).int64(message.observedGeneration); + if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) + $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.latestReadyRevision != null && Object.hasOwnProperty.call(message, "latestReadyRevision")) + writer.uint32(/* id 33, wireType 2 =*/266).string(message.latestReadyRevision); + if (message.latestCreatedRevision != null && Object.hasOwnProperty.call(message, "latestCreatedRevision")) + writer.uint32(/* id 34, wireType 2 =*/274).string(message.latestCreatedRevision); + if (message.trafficStatuses != null && message.trafficStatuses.length) + for (var i = 0; i < message.trafficStatuses.length; ++i) + $root.google.cloud.run.v2.TrafficTargetStatus.encode(message.trafficStatuses[i], writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.uri); + if (message.customAudiences != null && message.customAudiences.length) + for (var i = 0; i < message.customAudiences.length; ++i) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.customAudiences[i]); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 38, wireType 0 =*/304).bool(message.satisfiesPzs); + if (message.threatDetectionEnabled != null && Object.hasOwnProperty.call(message, "threatDetectionEnabled")) + writer.uint32(/* id 40, wireType 0 =*/320).bool(message.threatDetectionEnabled); + if (message.buildConfig != null && Object.hasOwnProperty.call(message, "buildConfig")) + $root.google.cloud.run.v2.BuildConfig.encode(message.buildConfig, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Service + * @static + * @param {google.cloud.run.v2.IService} message Service message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Service.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Service message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.Service + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.Service} Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Service.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Service(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.generation = reader.int64(); + 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.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.creator = reader.string(); + break; + } + case 12: { + message.lastModifier = reader.string(); + break; + } + case 13: { + message.client = reader.string(); + break; + } + case 14: { + message.clientVersion = reader.string(); + break; + } + case 15: { + message.ingress = reader.int32(); + break; + } + case 16: { + message.launchStage = reader.int32(); + break; + } + case 17: { + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); + break; + } + case 18: { + message.template = $root.google.cloud.run.v2.RevisionTemplate.decode(reader, reader.uint32()); + break; + } + case 19: { + if (!(message.traffic && message.traffic.length)) + message.traffic = []; + message.traffic.push($root.google.cloud.run.v2.TrafficTarget.decode(reader, reader.uint32())); + break; + } + case 20: { + message.scaling = $root.google.cloud.run.v2.ServiceScaling.decode(reader, reader.uint32()); + break; + } + case 21: { + message.invokerIamDisabled = reader.bool(); + break; + } + case 22: { + message.defaultUriDisabled = reader.bool(); + break; + } + case 24: { + if (!(message.urls && message.urls.length)) + message.urls = []; + message.urls.push(reader.string()); + break; + } + case 25: { + message.iapEnabled = reader.bool(); + break; + } + case 26: { + message.multiRegionSettings = $root.google.cloud.run.v2.Service.MultiRegionSettings.decode(reader, reader.uint32()); + break; + } + case 37: { + if (!(message.customAudiences && message.customAudiences.length)) + message.customAudiences = []; + message.customAudiences.push(reader.string()); + break; + } + case 30: { + message.observedGeneration = reader.int64(); + break; + } + case 31: { + message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); + break; + } + case 32: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); + break; + } + case 33: { + message.latestReadyRevision = reader.string(); + break; + } + case 34: { + message.latestCreatedRevision = reader.string(); + break; + } + case 35: { + if (!(message.trafficStatuses && message.trafficStatuses.length)) + message.trafficStatuses = []; + message.trafficStatuses.push($root.google.cloud.run.v2.TrafficTargetStatus.decode(reader, reader.uint32())); + break; + } + case 36: { + message.uri = reader.string(); + break; + } + case 38: { + message.satisfiesPzs = reader.bool(); + break; + } + case 40: { + message.threatDetectionEnabled = reader.bool(); + break; + } + case 41: { + message.buildConfig = $root.google.cloud.run.v2.BuildConfig.decode(reader, reader.uint32()); + break; + } + case 98: { + message.reconciling = reader.bool(); + break; + } + case 99: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Service message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.Service + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.Service} Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Service.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Service message. + * @function verify + * @memberof google.cloud.run.v2.Service + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Service.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + if (!$util.isString(message.lastModifier)) + return "lastModifier: string expected"; + if (message.client != null && message.hasOwnProperty("client")) + if (!$util.isString(message.client)) + return "client: string expected"; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: string expected"; + if (message.ingress != null && message.hasOwnProperty("ingress")) + switch (message.ingress) { + default: + return "ingress: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { + var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); + if (error) + return "binaryAuthorization." + error; + } + if (message.template != null && message.hasOwnProperty("template")) { + var error = $root.google.cloud.run.v2.RevisionTemplate.verify(message.template); + if (error) + return "template." + error; + } + if (message.traffic != null && message.hasOwnProperty("traffic")) { + if (!Array.isArray(message.traffic)) + return "traffic: array expected"; + for (var i = 0; i < message.traffic.length; ++i) { + var error = $root.google.cloud.run.v2.TrafficTarget.verify(message.traffic[i]); + if (error) + return "traffic." + error; + } + } + if (message.scaling != null && message.hasOwnProperty("scaling")) { + var error = $root.google.cloud.run.v2.ServiceScaling.verify(message.scaling); + if (error) + return "scaling." + error; + } + if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) + if (typeof message.invokerIamDisabled !== "boolean") + return "invokerIamDisabled: boolean expected"; + if (message.defaultUriDisabled != null && message.hasOwnProperty("defaultUriDisabled")) + if (typeof message.defaultUriDisabled !== "boolean") + return "defaultUriDisabled: boolean expected"; + if (message.urls != null && message.hasOwnProperty("urls")) { + if (!Array.isArray(message.urls)) + return "urls: array expected"; + for (var i = 0; i < message.urls.length; ++i) + if (!$util.isString(message.urls[i])) + return "urls: string[] expected"; + } + if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) + if (typeof message.iapEnabled !== "boolean") + return "iapEnabled: boolean expected"; + if (message.multiRegionSettings != null && message.hasOwnProperty("multiRegionSettings")) { + var error = $root.google.cloud.run.v2.Service.MultiRegionSettings.verify(message.multiRegionSettings); + if (error) + return "multiRegionSettings." + error; + } + if (message.customAudiences != null && message.hasOwnProperty("customAudiences")) { + if (!Array.isArray(message.customAudiences)) + return "customAudiences: array expected"; + for (var i = 0; i < message.customAudiences.length; ++i) + if (!$util.isString(message.customAudiences[i])) + return "customAudiences: string[] expected"; + } + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) + return "observedGeneration: integer|Long expected"; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { + var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); + if (error) + return "terminalCondition." + error; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) + if (!$util.isString(message.latestReadyRevision)) + return "latestReadyRevision: string expected"; + if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) + if (!$util.isString(message.latestCreatedRevision)) + return "latestCreatedRevision: string expected"; + if (message.trafficStatuses != null && message.hasOwnProperty("trafficStatuses")) { + if (!Array.isArray(message.trafficStatuses)) + return "trafficStatuses: array expected"; + for (var i = 0; i < message.trafficStatuses.length; ++i) { + var error = $root.google.cloud.run.v2.TrafficTargetStatus.verify(message.trafficStatuses[i]); + if (error) + return "trafficStatuses." + error; + } + } + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) + if (typeof message.threatDetectionEnabled !== "boolean") + return "threatDetectionEnabled: boolean expected"; + if (message.buildConfig != null && message.hasOwnProperty("buildConfig")) { + var error = $root.google.cloud.run.v2.BuildConfig.verify(message.buildConfig); + if (error) + return "buildConfig." + error; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Service message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Service + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Service} Service + */ + Service.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Service) + return object; + var message = new $root.google.cloud.run.v2.Service(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.uid != null) + message.uid = String(object.uid); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.Service.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.Service.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.run.v2.Service.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.run.v2.Service.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.run.v2.Service.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.run.v2.Service.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.lastModifier != null) + message.lastModifier = String(object.lastModifier); + if (object.client != null) + message.client = String(object.client); + if (object.clientVersion != null) + message.clientVersion = String(object.clientVersion); + switch (object.ingress) { + default: + if (typeof object.ingress === "number") { + message.ingress = object.ingress; + break; + } + break; + case "INGRESS_TRAFFIC_UNSPECIFIED": + case 0: + message.ingress = 0; + break; + case "INGRESS_TRAFFIC_ALL": + case 1: + message.ingress = 1; + break; + case "INGRESS_TRAFFIC_INTERNAL_ONLY": + case 2: + message.ingress = 2; + break; + case "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": + case 3: + message.ingress = 3; + break; + case "INGRESS_TRAFFIC_NONE": + case 4: + message.ingress = 4; + break; + } + 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.binaryAuthorization != null) { + if (typeof object.binaryAuthorization !== "object") + throw TypeError(".google.cloud.run.v2.Service.binaryAuthorization: object expected"); + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); + } + if (object.template != null) { + if (typeof object.template !== "object") + throw TypeError(".google.cloud.run.v2.Service.template: object expected"); + message.template = $root.google.cloud.run.v2.RevisionTemplate.fromObject(object.template); + } + if (object.traffic) { + if (!Array.isArray(object.traffic)) + throw TypeError(".google.cloud.run.v2.Service.traffic: array expected"); + message.traffic = []; + for (var i = 0; i < object.traffic.length; ++i) { + if (typeof object.traffic[i] !== "object") + throw TypeError(".google.cloud.run.v2.Service.traffic: object expected"); + message.traffic[i] = $root.google.cloud.run.v2.TrafficTarget.fromObject(object.traffic[i]); + } + } + if (object.scaling != null) { + if (typeof object.scaling !== "object") + throw TypeError(".google.cloud.run.v2.Service.scaling: object expected"); + message.scaling = $root.google.cloud.run.v2.ServiceScaling.fromObject(object.scaling); + } + if (object.invokerIamDisabled != null) + message.invokerIamDisabled = Boolean(object.invokerIamDisabled); + if (object.defaultUriDisabled != null) + message.defaultUriDisabled = Boolean(object.defaultUriDisabled); + if (object.urls) { + if (!Array.isArray(object.urls)) + throw TypeError(".google.cloud.run.v2.Service.urls: array expected"); + message.urls = []; + for (var i = 0; i < object.urls.length; ++i) + message.urls[i] = String(object.urls[i]); + } + if (object.iapEnabled != null) + message.iapEnabled = Boolean(object.iapEnabled); + if (object.multiRegionSettings != null) { + if (typeof object.multiRegionSettings !== "object") + throw TypeError(".google.cloud.run.v2.Service.multiRegionSettings: object expected"); + message.multiRegionSettings = $root.google.cloud.run.v2.Service.MultiRegionSettings.fromObject(object.multiRegionSettings); + } + if (object.customAudiences) { + if (!Array.isArray(object.customAudiences)) + throw TypeError(".google.cloud.run.v2.Service.customAudiences: array expected"); + message.customAudiences = []; + for (var i = 0; i < object.customAudiences.length; ++i) + message.customAudiences[i] = String(object.customAudiences[i]); + } + if (object.observedGeneration != null) + if ($util.Long) + (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; + else if (typeof object.observedGeneration === "string") + message.observedGeneration = parseInt(object.observedGeneration, 10); + else if (typeof object.observedGeneration === "number") + message.observedGeneration = object.observedGeneration; + else if (typeof object.observedGeneration === "object") + message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); + if (object.terminalCondition != null) { + if (typeof object.terminalCondition !== "object") + throw TypeError(".google.cloud.run.v2.Service.terminalCondition: object expected"); + message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); + } + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.run.v2.Service.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.run.v2.Service.conditions: object expected"); + message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); + } + } + if (object.latestReadyRevision != null) + message.latestReadyRevision = String(object.latestReadyRevision); + if (object.latestCreatedRevision != null) + message.latestCreatedRevision = String(object.latestCreatedRevision); + if (object.trafficStatuses) { + if (!Array.isArray(object.trafficStatuses)) + throw TypeError(".google.cloud.run.v2.Service.trafficStatuses: array expected"); + message.trafficStatuses = []; + for (var i = 0; i < object.trafficStatuses.length; ++i) { + if (typeof object.trafficStatuses[i] !== "object") + throw TypeError(".google.cloud.run.v2.Service.trafficStatuses: object expected"); + message.trafficStatuses[i] = $root.google.cloud.run.v2.TrafficTargetStatus.fromObject(object.trafficStatuses[i]); + } + } + if (object.uri != null) + message.uri = String(object.uri); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.threatDetectionEnabled != null) + message.threatDetectionEnabled = Boolean(object.threatDetectionEnabled); + if (object.buildConfig != null) { + if (typeof object.buildConfig !== "object") + throw TypeError(".google.cloud.run.v2.Service.buildConfig: object expected"); + message.buildConfig = $root.google.cloud.run.v2.BuildConfig.fromObject(object.buildConfig); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Service message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Service + * @static + * @param {google.cloud.run.v2.Service} message Service + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Service.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.traffic = []; + object.urls = []; + object.conditions = []; + object.trafficStatuses = []; + object.customAudiences = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.creator = ""; + object.lastModifier = ""; + object.client = ""; + object.clientVersion = ""; + object.ingress = options.enums === String ? "INGRESS_TRAFFIC_UNSPECIFIED" : 0; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.binaryAuthorization = null; + object.template = null; + object.scaling = null; + object.invokerIamDisabled = false; + object.defaultUriDisabled = false; + object.iapEnabled = false; + object.multiRegionSettings = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.observedGeneration = options.longs === String ? "0" : 0; + object.terminalCondition = null; + object.latestReadyRevision = ""; + object.latestCreatedRevision = ""; + object.uri = ""; + object.satisfiesPzs = false; + object.threatDetectionEnabled = false; + object.buildConfig = null; + object.reconciling = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + object.lastModifier = message.lastModifier; + if (message.client != null && message.hasOwnProperty("client")) + object.client = message.client; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + if (message.ingress != null && message.hasOwnProperty("ingress")) + object.ingress = options.enums === String ? $root.google.cloud.run.v2.IngressTraffic[message.ingress] === undefined ? message.ingress : $root.google.cloud.run.v2.IngressTraffic[message.ingress] : message.ingress; + 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) + object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); + if (message.template != null && message.hasOwnProperty("template")) + object.template = $root.google.cloud.run.v2.RevisionTemplate.toObject(message.template, options); + if (message.traffic && message.traffic.length) { + object.traffic = []; + for (var j = 0; j < message.traffic.length; ++j) + object.traffic[j] = $root.google.cloud.run.v2.TrafficTarget.toObject(message.traffic[j], options); + } + if (message.scaling != null && message.hasOwnProperty("scaling")) + object.scaling = $root.google.cloud.run.v2.ServiceScaling.toObject(message.scaling, options); + if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) + object.invokerIamDisabled = message.invokerIamDisabled; + if (message.defaultUriDisabled != null && message.hasOwnProperty("defaultUriDisabled")) + object.defaultUriDisabled = message.defaultUriDisabled; + if (message.urls && message.urls.length) { + object.urls = []; + for (var j = 0; j < message.urls.length; ++j) + object.urls[j] = message.urls[j]; + } + if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) + object.iapEnabled = message.iapEnabled; + if (message.multiRegionSettings != null && message.hasOwnProperty("multiRegionSettings")) + object.multiRegionSettings = $root.google.cloud.run.v2.Service.MultiRegionSettings.toObject(message.multiRegionSettings, options); + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (typeof message.observedGeneration === "number") + object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; + else + object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) + object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); + } + if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) + object.latestReadyRevision = message.latestReadyRevision; + if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) + object.latestCreatedRevision = message.latestCreatedRevision; + if (message.trafficStatuses && message.trafficStatuses.length) { + object.trafficStatuses = []; + for (var j = 0; j < message.trafficStatuses.length; ++j) + object.trafficStatuses[j] = $root.google.cloud.run.v2.TrafficTargetStatus.toObject(message.trafficStatuses[j], options); + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.customAudiences && message.customAudiences.length) { + object.customAudiences = []; + for (var j = 0; j < message.customAudiences.length; ++j) + object.customAudiences[j] = message.customAudiences[j]; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) + object.threatDetectionEnabled = message.threatDetectionEnabled; + if (message.buildConfig != null && message.hasOwnProperty("buildConfig")) + object.buildConfig = $root.google.cloud.run.v2.BuildConfig.toObject(message.buildConfig, options); + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Service to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.Service + * @instance + * @returns {Object.} JSON object + */ + Service.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Service + * @function getTypeUrl + * @memberof google.cloud.run.v2.Service + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Service.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.Service"; + }; + + Service.MultiRegionSettings = (function() { + + /** + * Properties of a MultiRegionSettings. + * @memberof google.cloud.run.v2.Service + * @interface IMultiRegionSettings + * @property {Array.|null} [regions] MultiRegionSettings regions + * @property {string|null} [multiRegionId] MultiRegionSettings multiRegionId + */ + + /** + * Constructs a new MultiRegionSettings. + * @memberof google.cloud.run.v2.Service + * @classdesc Represents a MultiRegionSettings. + * @implements IMultiRegionSettings + * @constructor + * @param {google.cloud.run.v2.Service.IMultiRegionSettings=} [properties] Properties to set + */ + function MultiRegionSettings(properties) { + this.regions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiRegionSettings regions. + * @member {Array.} regions + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @instance + */ + MultiRegionSettings.prototype.regions = $util.emptyArray; + + /** + * MultiRegionSettings multiRegionId. + * @member {string} multiRegionId + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @instance + */ + MultiRegionSettings.prototype.multiRegionId = ""; + + /** + * Creates a new MultiRegionSettings instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @static + * @param {google.cloud.run.v2.Service.IMultiRegionSettings=} [properties] Properties to set + * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings instance + */ + MultiRegionSettings.create = function create(properties) { + return new MultiRegionSettings(properties); + }; + + /** + * Encodes the specified MultiRegionSettings message. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @static + * @param {google.cloud.run.v2.Service.IMultiRegionSettings} message MultiRegionSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiRegionSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regions != null && message.regions.length) + for (var i = 0; i < message.regions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.regions[i]); + if (message.multiRegionId != null && Object.hasOwnProperty.call(message, "multiRegionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.multiRegionId); + return writer; + }; + + /** + * Encodes the specified MultiRegionSettings message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @static + * @param {google.cloud.run.v2.Service.IMultiRegionSettings} message MultiRegionSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiRegionSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiRegionSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiRegionSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Service.MultiRegionSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.regions && message.regions.length)) + message.regions = []; + message.regions.push(reader.string()); + break; + } + case 2: { + message.multiRegionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiRegionSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiRegionSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiRegionSettings message. + * @function verify + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiRegionSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.regions != null && message.hasOwnProperty("regions")) { + if (!Array.isArray(message.regions)) + return "regions: array expected"; + for (var i = 0; i < message.regions.length; ++i) + if (!$util.isString(message.regions[i])) + return "regions: string[] expected"; + } + if (message.multiRegionId != null && message.hasOwnProperty("multiRegionId")) + if (!$util.isString(message.multiRegionId)) + return "multiRegionId: string expected"; + return null; + }; + + /** + * Creates a MultiRegionSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings + */ + MultiRegionSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Service.MultiRegionSettings) + return object; + var message = new $root.google.cloud.run.v2.Service.MultiRegionSettings(); + if (object.regions) { + if (!Array.isArray(object.regions)) + throw TypeError(".google.cloud.run.v2.Service.MultiRegionSettings.regions: array expected"); + message.regions = []; + for (var i = 0; i < object.regions.length; ++i) + message.regions[i] = String(object.regions[i]); + } + if (object.multiRegionId != null) + message.multiRegionId = String(object.multiRegionId); + return message; + }; + + /** + * Creates a plain object from a MultiRegionSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @static + * @param {google.cloud.run.v2.Service.MultiRegionSettings} message MultiRegionSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiRegionSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.regions = []; + if (options.defaults) + object.multiRegionId = ""; + if (message.regions && message.regions.length) { + object.regions = []; + for (var j = 0; j < message.regions.length; ++j) + object.regions[j] = message.regions[j]; + } + if (message.multiRegionId != null && message.hasOwnProperty("multiRegionId")) + object.multiRegionId = message.multiRegionId; + return object; + }; + + /** + * Converts this MultiRegionSettings to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @instance + * @returns {Object.} JSON object + */ + MultiRegionSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiRegionSettings + * @function getTypeUrl + * @memberof google.cloud.run.v2.Service.MultiRegionSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiRegionSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.Service.MultiRegionSettings"; + }; + + return MultiRegionSettings; + })(); + + return Service; + })(); + + v2.TrafficTarget = (function() { + + /** + * Properties of a TrafficTarget. + * @memberof google.cloud.run.v2 + * @interface ITrafficTarget + * @property {google.cloud.run.v2.TrafficTargetAllocationType|null} [type] TrafficTarget type + * @property {string|null} [revision] TrafficTarget revision + * @property {number|null} [percent] TrafficTarget percent + * @property {string|null} [tag] TrafficTarget tag + */ + + /** + * Constructs a new TrafficTarget. + * @memberof google.cloud.run.v2 + * @classdesc Represents a TrafficTarget. + * @implements ITrafficTarget + * @constructor + * @param {google.cloud.run.v2.ITrafficTarget=} [properties] Properties to set + */ + function TrafficTarget(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrafficTarget type. + * @member {google.cloud.run.v2.TrafficTargetAllocationType} type + * @memberof google.cloud.run.v2.TrafficTarget + * @instance + */ + TrafficTarget.prototype.type = 0; + + /** + * TrafficTarget revision. + * @member {string} revision + * @memberof google.cloud.run.v2.TrafficTarget + * @instance + */ + TrafficTarget.prototype.revision = ""; + + /** + * TrafficTarget percent. + * @member {number} percent + * @memberof google.cloud.run.v2.TrafficTarget + * @instance + */ + TrafficTarget.prototype.percent = 0; + + /** + * TrafficTarget tag. + * @member {string} tag + * @memberof google.cloud.run.v2.TrafficTarget + * @instance + */ + TrafficTarget.prototype.tag = ""; + + /** + * Creates a new TrafficTarget instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.TrafficTarget + * @static + * @param {google.cloud.run.v2.ITrafficTarget=} [properties] Properties to set + * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget instance + */ + TrafficTarget.create = function create(properties) { + return new TrafficTarget(properties); + }; + + /** + * Encodes the specified TrafficTarget message. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.TrafficTarget + * @static + * @param {google.cloud.run.v2.ITrafficTarget} message TrafficTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficTarget.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.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); + if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tag); + return writer; + }; + + /** + * Encodes the specified TrafficTarget message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.TrafficTarget + * @static + * @param {google.cloud.run.v2.ITrafficTarget} message TrafficTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficTarget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrafficTarget message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.TrafficTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficTarget.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TrafficTarget(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.revision = reader.string(); + break; + } + case 3: { + message.percent = reader.int32(); + break; + } + case 4: { + message.tag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrafficTarget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.TrafficTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficTarget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrafficTarget message. + * @function verify + * @memberof google.cloud.run.v2.TrafficTarget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrafficTarget.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.revision != null && message.hasOwnProperty("revision")) + if (!$util.isString(message.revision)) + return "revision: string expected"; + if (message.percent != null && message.hasOwnProperty("percent")) + if (!$util.isInteger(message.percent)) + return "percent: integer expected"; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + return null; + }; + + /** + * Creates a TrafficTarget message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.TrafficTarget + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget + */ + TrafficTarget.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.TrafficTarget) + return object; + var message = new $root.google.cloud.run.v2.TrafficTarget(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST": + case 1: + message.type = 1; + break; + case "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION": + case 2: + message.type = 2; + break; + } + if (object.revision != null) + message.revision = String(object.revision); + if (object.percent != null) + message.percent = object.percent | 0; + if (object.tag != null) + message.tag = String(object.tag); + return message; + }; + + /** + * Creates a plain object from a TrafficTarget message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.TrafficTarget + * @static + * @param {google.cloud.run.v2.TrafficTarget} message TrafficTarget + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrafficTarget.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED" : 0; + object.revision = ""; + object.percent = 0; + object.tag = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] : message.type; + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.percent != null && message.hasOwnProperty("percent")) + object.percent = message.percent; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + return object; + }; + + /** + * Converts this TrafficTarget to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.TrafficTarget + * @instance + * @returns {Object.} JSON object + */ + TrafficTarget.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrafficTarget + * @function getTypeUrl + * @memberof google.cloud.run.v2.TrafficTarget + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrafficTarget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.TrafficTarget"; + }; + + return TrafficTarget; + })(); + + v2.TrafficTargetStatus = (function() { + + /** + * Properties of a TrafficTargetStatus. + * @memberof google.cloud.run.v2 + * @interface ITrafficTargetStatus + * @property {google.cloud.run.v2.TrafficTargetAllocationType|null} [type] TrafficTargetStatus type + * @property {string|null} [revision] TrafficTargetStatus revision + * @property {number|null} [percent] TrafficTargetStatus percent + * @property {string|null} [tag] TrafficTargetStatus tag + * @property {string|null} [uri] TrafficTargetStatus uri + */ + + /** + * Constructs a new TrafficTargetStatus. + * @memberof google.cloud.run.v2 + * @classdesc Represents a TrafficTargetStatus. + * @implements ITrafficTargetStatus + * @constructor + * @param {google.cloud.run.v2.ITrafficTargetStatus=} [properties] Properties to set + */ + function TrafficTargetStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrafficTargetStatus type. + * @member {google.cloud.run.v2.TrafficTargetAllocationType} type + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @instance + */ + TrafficTargetStatus.prototype.type = 0; + + /** + * TrafficTargetStatus revision. + * @member {string} revision + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @instance + */ + TrafficTargetStatus.prototype.revision = ""; + + /** + * TrafficTargetStatus percent. + * @member {number} percent + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @instance + */ + TrafficTargetStatus.prototype.percent = 0; + + /** + * TrafficTargetStatus tag. + * @member {string} tag + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @instance + */ + TrafficTargetStatus.prototype.tag = ""; + + /** + * TrafficTargetStatus uri. + * @member {string} uri + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @instance + */ + TrafficTargetStatus.prototype.uri = ""; + + /** + * Creates a new TrafficTargetStatus instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @static + * @param {google.cloud.run.v2.ITrafficTargetStatus=} [properties] Properties to set + * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus instance + */ + TrafficTargetStatus.create = function create(properties) { + return new TrafficTargetStatus(properties); + }; + + /** + * Encodes the specified TrafficTargetStatus message. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @static + * @param {google.cloud.run.v2.ITrafficTargetStatus} message TrafficTargetStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficTargetStatus.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.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); + if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tag); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.uri); + return writer; + }; + + /** + * Encodes the specified TrafficTargetStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @static + * @param {google.cloud.run.v2.ITrafficTargetStatus} message TrafficTargetStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficTargetStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrafficTargetStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficTargetStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TrafficTargetStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.revision = reader.string(); + break; + } + case 3: { + message.percent = reader.int32(); + break; + } + case 4: { + message.tag = reader.string(); + break; + } + case 5: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrafficTargetStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficTargetStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrafficTargetStatus message. + * @function verify + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrafficTargetStatus.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.revision != null && message.hasOwnProperty("revision")) + if (!$util.isString(message.revision)) + return "revision: string expected"; + if (message.percent != null && message.hasOwnProperty("percent")) + if (!$util.isInteger(message.percent)) + return "percent: integer expected"; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a TrafficTargetStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus + */ + TrafficTargetStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.TrafficTargetStatus) + return object; + var message = new $root.google.cloud.run.v2.TrafficTargetStatus(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST": + case 1: + message.type = 1; + break; + case "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION": + case 2: + message.type = 2; + break; + } + if (object.revision != null) + message.revision = String(object.revision); + if (object.percent != null) + message.percent = object.percent | 0; + if (object.tag != null) + message.tag = String(object.tag); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a TrafficTargetStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @static + * @param {google.cloud.run.v2.TrafficTargetStatus} message TrafficTargetStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrafficTargetStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED" : 0; + object.revision = ""; + object.percent = 0; + object.tag = ""; + object.uri = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] : message.type; + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.percent != null && message.hasOwnProperty("percent")) + object.percent = message.percent; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this TrafficTargetStatus to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @instance + * @returns {Object.} JSON object + */ + TrafficTargetStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrafficTargetStatus + * @function getTypeUrl + * @memberof google.cloud.run.v2.TrafficTargetStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrafficTargetStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.TrafficTargetStatus"; + }; + + return TrafficTargetStatus; + })(); + + /** + * TrafficTargetAllocationType enum. + * @name google.cloud.run.v2.TrafficTargetAllocationType + * @enum {number} + * @property {number} TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED=0 TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED value + * @property {number} TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST=1 TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST value + * @property {number} TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION=2 TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION value + */ + v2.TrafficTargetAllocationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"] = 1; + values[valuesById[2] = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"] = 2; + return values; + })(); + + v2.Tasks = (function() { + + /** + * Constructs a new Tasks service. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Tasks + * @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 Tasks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Tasks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Tasks; + + /** + * Creates new Tasks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.run.v2.Tasks + * @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 {Tasks} RPC service. Useful where requests and/or responses are streamed. + */ + Tasks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.run.v2.Tasks|getTask}. + * @memberof google.cloud.run.v2.Tasks + * @typedef GetTaskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.Task} [response] Task + */ + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.run.v2.Tasks + * @instance + * @param {google.cloud.run.v2.IGetTaskRequest} request GetTaskRequest message or plain object + * @param {google.cloud.run.v2.Tasks.GetTaskCallback} callback Node-style callback called with the error, if any, and Task + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tasks.prototype.getTask = function getTask(request, callback) { + return this.rpcCall(getTask, $root.google.cloud.run.v2.GetTaskRequest, $root.google.cloud.run.v2.Task, request, callback); + }, "name", { value: "GetTask" }); + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.run.v2.Tasks + * @instance + * @param {google.cloud.run.v2.IGetTaskRequest} request GetTaskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Tasks|listTasks}. + * @memberof google.cloud.run.v2.Tasks + * @typedef ListTasksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.ListTasksResponse} [response] ListTasksResponse + */ + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.run.v2.Tasks + * @instance + * @param {google.cloud.run.v2.IListTasksRequest} request ListTasksRequest message or plain object + * @param {google.cloud.run.v2.Tasks.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Tasks.prototype.listTasks = function listTasks(request, callback) { + return this.rpcCall(listTasks, $root.google.cloud.run.v2.ListTasksRequest, $root.google.cloud.run.v2.ListTasksResponse, request, callback); + }, "name", { value: "ListTasks" }); + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.run.v2.Tasks + * @instance + * @param {google.cloud.run.v2.IListTasksRequest} request ListTasksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Tasks; + })(); + + v2.GetTaskRequest = (function() { + + /** + * Properties of a GetTaskRequest. + * @memberof google.cloud.run.v2 + * @interface IGetTaskRequest + * @property {string|null} [name] GetTaskRequest name + */ + + /** + * Constructs a new GetTaskRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GetTaskRequest. + * @implements IGetTaskRequest + * @constructor + * @param {google.cloud.run.v2.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.run.v2.GetTaskRequest + * @instance + */ + GetTaskRequest.prototype.name = ""; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GetTaskRequest + * @static + * @param {google.cloud.run.v2.IGetTaskRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.GetTaskRequest} GetTaskRequest instance + */ + GetTaskRequest.create = function create(properties) { + return new GetTaskRequest(properties); + }; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.run.v2.GetTaskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GetTaskRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.GetTaskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GetTaskRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetTaskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.GetTaskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GetTaskRequest} GetTaskRequest + */ + GetTaskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GetTaskRequest) + return object; + var message = new $root.google.cloud.run.v2.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.run.v2.GetTaskRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.GetTaskRequest"; + }; + + return GetTaskRequest; + })(); + + v2.ListTasksRequest = (function() { + + /** + * Properties of a ListTasksRequest. + * @memberof google.cloud.run.v2 + * @interface IListTasksRequest + * @property {string|null} [parent] ListTasksRequest parent + * @property {number|null} [pageSize] ListTasksRequest pageSize + * @property {string|null} [pageToken] ListTasksRequest pageToken + * @property {boolean|null} [showDeleted] ListTasksRequest showDeleted + */ + + /** + * Constructs a new ListTasksRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListTasksRequest. + * @implements IListTasksRequest + * @constructor + * @param {google.cloud.run.v2.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.run.v2.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.parent = ""; + + /** + * ListTasksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.run.v2.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageSize = 0; + + /** + * ListTasksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.run.v2.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageToken = ""; + + /** + * ListTasksRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.run.v2.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.showDeleted = false; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListTasksRequest + * @static + * @param {google.cloud.run.v2.IListTasksRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListTasksRequest} ListTasksRequest instance + */ + ListTasksRequest.create = function create(properties) { + return new ListTasksRequest(properties); + }; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.run.v2.ListTasksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListTasksRequest + * @static + * @param {google.cloud.run.v2.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.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListTasksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListTasksRequest + * @static + * @param {google.cloud.run.v2.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.run.v2.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListTasksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + 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.run.v2.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListTasksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListTasksRequest} ListTasksRequest + */ + ListTasksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListTasksRequest) + return object; + var message = new $root.google.cloud.run.v2.ListTasksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListTasksRequest + * @static + * @param {google.cloud.run.v2.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.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + 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.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListTasksRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListTasksRequest"; + }; + + return ListTasksRequest; + })(); + + v2.ListTasksResponse = (function() { + + /** + * Properties of a ListTasksResponse. + * @memberof google.cloud.run.v2 + * @interface IListTasksResponse + * @property {Array.|null} [tasks] ListTasksResponse tasks + * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken + */ + + /** + * Constructs a new ListTasksResponse. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListTasksResponse. + * @implements IListTasksResponse + * @constructor + * @param {google.cloud.run.v2.IListTasksResponse=} [properties] Properties to set + */ + function ListTasksResponse(properties) { + this.tasks = []; + if (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.run.v2.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.tasks = $util.emptyArray; + + /** + * ListTasksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.run.v2.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListTasksResponse + * @static + * @param {google.cloud.run.v2.IListTasksResponse=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListTasksResponse} ListTasksResponse instance + */ + ListTasksResponse.create = function create(properties) { + return new ListTasksResponse(properties); + }; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.run.v2.ListTasksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListTasksResponse + * @static + * @param {google.cloud.run.v2.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.run.v2.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); + return writer; + }; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListTasksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListTasksResponse + * @static + * @param {google.cloud.run.v2.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.run.v2.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListTasksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tasks && message.tasks.length)) + message.tasks = []; + message.tasks.push($root.google.cloud.run.v2.Task.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = 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.run.v2.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.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"; + return null; + }; + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListTasksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListTasksResponse} ListTasksResponse + */ + ListTasksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListTasksResponse) + return object; + var message = new $root.google.cloud.run.v2.ListTasksResponse(); + if (object.tasks) { + if (!Array.isArray(object.tasks)) + throw TypeError(".google.cloud.run.v2.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.run.v2.ListTasksResponse.tasks: object expected"); + message.tasks[i] = $root.google.cloud.run.v2.Task.fromObject(object.tasks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListTasksResponse + * @static + * @param {google.cloud.run.v2.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 = []; + 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.run.v2.Task.toObject(message.tasks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTasksResponse to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListTasksResponse"; + }; + + return ListTasksResponse; + })(); + + v2.Task = (function() { + + /** + * Properties of a Task. + * @memberof google.cloud.run.v2 + * @interface ITask + * @property {string|null} [name] Task name + * @property {string|null} [uid] Task uid + * @property {number|Long|null} [generation] Task generation + * @property {Object.|null} [labels] Task labels + * @property {Object.|null} [annotations] Task annotations + * @property {google.protobuf.ITimestamp|null} [createTime] Task createTime + * @property {google.protobuf.ITimestamp|null} [scheduledTime] Task scheduledTime + * @property {google.protobuf.ITimestamp|null} [startTime] Task startTime + * @property {google.protobuf.ITimestamp|null} [completionTime] Task completionTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Task updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Task deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Task expireTime + * @property {string|null} [job] Task job + * @property {string|null} [execution] Task execution + * @property {Array.|null} [containers] Task containers + * @property {Array.|null} [volumes] Task volumes + * @property {number|null} [maxRetries] Task maxRetries + * @property {google.protobuf.IDuration|null} [timeout] Task timeout + * @property {string|null} [serviceAccount] Task serviceAccount + * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] Task executionEnvironment + * @property {boolean|null} [reconciling] Task reconciling + * @property {Array.|null} [conditions] Task conditions + * @property {number|Long|null} [observedGeneration] Task observedGeneration + * @property {number|null} [index] Task index + * @property {number|null} [retried] Task retried + * @property {google.cloud.run.v2.ITaskAttemptResult|null} [lastAttemptResult] Task lastAttemptResult + * @property {string|null} [encryptionKey] Task encryptionKey + * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Task vpcAccess + * @property {string|null} [logUri] Task logUri + * @property {boolean|null} [satisfiesPzs] Task satisfiesPzs + * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Task nodeSelector + * @property {boolean|null} [gpuZonalRedundancyDisabled] Task gpuZonalRedundancyDisabled + * @property {string|null} [etag] Task etag + */ + + /** + * Constructs a new Task. + * @memberof google.cloud.run.v2 + * @classdesc Represents a Task. + * @implements ITask + * @constructor + * @param {google.cloud.run.v2.ITask=} [properties] Properties to set + */ + function Task(properties) { + this.labels = {}; + this.annotations = {}; + this.containers = []; + this.volumes = []; + this.conditions = []; + if (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.run.v2.Task + * @instance + */ + Task.prototype.name = ""; + + /** + * Task uid. + * @member {string} uid + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.uid = ""; + + /** + * Task generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Task labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.labels = $util.emptyObject; + + /** + * Task annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.annotations = $util.emptyObject; + + /** + * Task createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.createTime = null; + + /** + * Task scheduledTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduledTime + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.scheduledTime = null; + + /** + * Task startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.startTime = null; + + /** + * Task completionTime. + * @member {google.protobuf.ITimestamp|null|undefined} completionTime + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.completionTime = null; + + /** + * Task updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.updateTime = null; + + /** + * Task deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.deleteTime = null; + + /** + * Task expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.expireTime = null; + + /** + * Task job. + * @member {string} job + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.job = ""; + + /** + * Task execution. + * @member {string} execution + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.execution = ""; + + /** + * Task containers. + * @member {Array.} containers + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.containers = $util.emptyArray; + + /** + * Task volumes. + * @member {Array.} volumes + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.volumes = $util.emptyArray; + + /** + * Task maxRetries. + * @member {number} maxRetries + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.maxRetries = 0; + + /** + * Task timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.timeout = null; + + /** + * Task serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.serviceAccount = ""; + + /** + * Task executionEnvironment. + * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.executionEnvironment = 0; + + /** + * Task reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.reconciling = false; + + /** + * Task conditions. + * @member {Array.} conditions + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.conditions = $util.emptyArray; + + /** + * Task observedGeneration. + * @member {number|Long} observedGeneration + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Task index. + * @member {number} index + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.index = 0; + + /** + * Task retried. + * @member {number} retried + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.retried = 0; + + /** + * Task lastAttemptResult. + * @member {google.cloud.run.v2.ITaskAttemptResult|null|undefined} lastAttemptResult + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.lastAttemptResult = null; + + /** + * Task encryptionKey. + * @member {string} encryptionKey + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.encryptionKey = ""; + + /** + * Task vpcAccess. + * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.vpcAccess = null; + + /** + * Task logUri. + * @member {string} logUri + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.logUri = ""; + + /** + * Task satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.satisfiesPzs = false; + + /** + * Task nodeSelector. + * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.nodeSelector = null; + + /** + * Task gpuZonalRedundancyDisabled. + * @member {boolean|null|undefined} gpuZonalRedundancyDisabled + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.gpuZonalRedundancyDisabled = null; + + /** + * Task etag. + * @member {string} etag + * @memberof google.cloud.run.v2.Task + * @instance + */ + Task.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Task.prototype, "_gpuZonalRedundancyDisabled", { + get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Task instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Task + * @static + * @param {google.cloud.run.v2.ITask=} [properties] Properties to set + * @returns {google.cloud.run.v2.Task} Task instance + */ + Task.create = function create(properties) { + return new Task(properties); + }; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.run.v2.Task.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Task + * @static + * @param {google.cloud.run.v2.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.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) + $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.job); + if (message.execution != null && Object.hasOwnProperty.call(message, "execution")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.execution); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.maxRetries != null && Object.hasOwnProperty.call(message, "maxRetries")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.maxRetries); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.serviceAccount); + if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.executionEnvironment); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.reconciling); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.observedGeneration); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.index); + if (message.retried != null && Object.hasOwnProperty.call(message, "retried")) + writer.uint32(/* id 25, wireType 0 =*/200).int32(message.retried); + if (message.lastAttemptResult != null && Object.hasOwnProperty.call(message, "lastAttemptResult")) + $root.google.cloud.run.v2.TaskAttemptResult.encode(message.lastAttemptResult, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.encryptionKey); + if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) + $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) + writer.uint32(/* id 32, wireType 2 =*/258).string(message.logUri); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.satisfiesPzs); + if (message.scheduledTime != null && Object.hasOwnProperty.call(message, "scheduledTime")) + $root.google.protobuf.Timestamp.encode(message.scheduledTime, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) + $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) + writer.uint32(/* id 37, wireType 0 =*/296).bool(message.gpuZonalRedundancyDisabled); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.run.v2.Task.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Task + * @static + * @param {google.cloud.run.v2.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.run.v2.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Task(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 34: { + message.scheduledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 27: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.job = reader.string(); + break; + } + case 13: { + message.execution = reader.string(); + break; + } + case 14: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); + break; + } + case 15: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); + break; + } + case 16: { + message.maxRetries = reader.int32(); + break; + } + case 17: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 18: { + message.serviceAccount = reader.string(); + break; + } + case 20: { + message.executionEnvironment = reader.int32(); + break; + } + case 21: { + message.reconciling = reader.bool(); + break; + } + case 22: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); + break; + } + case 23: { + message.observedGeneration = reader.int64(); + break; + } + case 24: { + message.index = reader.int32(); + break; + } + case 25: { + message.retried = reader.int32(); + break; + } + case 26: { + message.lastAttemptResult = $root.google.cloud.run.v2.TaskAttemptResult.decode(reader, reader.uint32()); + break; + } + case 28: { + message.encryptionKey = reader.string(); + break; + } + case 29: { + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); + break; + } + case 32: { + message.logUri = reader.string(); + break; + } + case 33: { + message.satisfiesPzs = reader.bool(); + break; + } + case 36: { + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); + break; + } + case 37: { + message.gpuZonalRedundancyDisabled = reader.bool(); + break; + } + case 99: { + message.etag = reader.string(); + 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.run.v2.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.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.run.v2.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"; + var properties = {}; + 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.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.scheduledTime != null && message.hasOwnProperty("scheduledTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduledTime); + if (error) + return "scheduledTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.completionTime != null && message.hasOwnProperty("completionTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completionTime); + if (error) + return "completionTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.job != null && message.hasOwnProperty("job")) + if (!$util.isString(message.job)) + return "job: string expected"; + if (message.execution != null && message.hasOwnProperty("execution")) + if (!$util.isString(message.execution)) + return "execution: string expected"; + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + 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.run.v2.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) + if (!$util.isInteger(message.maxRetries)) + return "maxRetries: integer expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) + switch (message.executionEnvironment) { + default: + return "executionEnvironment: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) + return "observedGeneration: integer|Long expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.retried != null && message.hasOwnProperty("retried")) + if (!$util.isInteger(message.retried)) + return "retried: integer expected"; + if (message.lastAttemptResult != null && message.hasOwnProperty("lastAttemptResult")) { + var error = $root.google.cloud.run.v2.TaskAttemptResult.verify(message.lastAttemptResult); + if (error) + return "lastAttemptResult." + error; + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + if (!$util.isString(message.encryptionKey)) + return "encryptionKey: string expected"; + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { + var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); + if (error) + return "vpcAccess." + error; + } + if (message.logUri != null && message.hasOwnProperty("logUri")) + if (!$util.isString(message.logUri)) + return "logUri: string expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { + var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); + if (error) + return "nodeSelector." + error; + } + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + properties._gpuZonalRedundancyDisabled = 1; + if (typeof message.gpuZonalRedundancyDisabled !== "boolean") + return "gpuZonalRedundancyDisabled: boolean expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Task + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Task} Task + */ + Task.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Task) + return object; + var message = new $root.google.cloud.run.v2.Task(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.Task.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.Task.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.run.v2.Task.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.scheduledTime != null) { + if (typeof object.scheduledTime !== "object") + throw TypeError(".google.cloud.run.v2.Task.scheduledTime: object expected"); + message.scheduledTime = $root.google.protobuf.Timestamp.fromObject(object.scheduledTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.run.v2.Task.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.completionTime != null) { + if (typeof object.completionTime !== "object") + throw TypeError(".google.cloud.run.v2.Task.completionTime: object expected"); + message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.run.v2.Task.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.run.v2.Task.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.run.v2.Task.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.job != null) + message.job = String(object.job); + if (object.execution != null) + message.execution = String(object.execution); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.run.v2.Task.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.run.v2.Task.containers: object expected"); + message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); + } + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.run.v2.Task.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.run.v2.Task.volumes: object expected"); + message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); + } + } + if (object.maxRetries != null) + message.maxRetries = object.maxRetries | 0; + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.run.v2.Task.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + switch (object.executionEnvironment) { + default: + if (typeof object.executionEnvironment === "number") { + message.executionEnvironment = object.executionEnvironment; + break; + } + break; + case "EXECUTION_ENVIRONMENT_UNSPECIFIED": + case 0: + message.executionEnvironment = 0; + break; + case "EXECUTION_ENVIRONMENT_GEN1": + case 1: + message.executionEnvironment = 1; + break; + case "EXECUTION_ENVIRONMENT_GEN2": + case 2: + message.executionEnvironment = 2; + break; + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.run.v2.Task.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.run.v2.Task.conditions: object expected"); + message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); + } + } + if (object.observedGeneration != null) + if ($util.Long) + (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; + else if (typeof object.observedGeneration === "string") + message.observedGeneration = parseInt(object.observedGeneration, 10); + else if (typeof object.observedGeneration === "number") + message.observedGeneration = object.observedGeneration; + else if (typeof object.observedGeneration === "object") + message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); + if (object.index != null) + message.index = object.index | 0; + if (object.retried != null) + message.retried = object.retried | 0; + if (object.lastAttemptResult != null) { + if (typeof object.lastAttemptResult !== "object") + throw TypeError(".google.cloud.run.v2.Task.lastAttemptResult: object expected"); + message.lastAttemptResult = $root.google.cloud.run.v2.TaskAttemptResult.fromObject(object.lastAttemptResult); + } + if (object.encryptionKey != null) + message.encryptionKey = String(object.encryptionKey); + if (object.vpcAccess != null) { + if (typeof object.vpcAccess !== "object") + throw TypeError(".google.cloud.run.v2.Task.vpcAccess: object expected"); + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); + } + if (object.logUri != null) + message.logUri = String(object.logUri); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.nodeSelector != null) { + if (typeof object.nodeSelector !== "object") + throw TypeError(".google.cloud.run.v2.Task.nodeSelector: object expected"); + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); + } + if (object.gpuZonalRedundancyDisabled != null) + message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Task + * @static + * @param {google.cloud.run.v2.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.arrays || options.defaults) { + object.containers = []; + object.volumes = []; + object.conditions = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.createTime = null; + object.completionTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.job = ""; + object.execution = ""; + object.maxRetries = 0; + object.timeout = null; + object.serviceAccount = ""; + object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; + object.reconciling = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.observedGeneration = options.longs === String ? "0" : 0; + object.index = 0; + object.retried = 0; + object.lastAttemptResult = null; + object.startTime = null; + object.encryptionKey = ""; + object.vpcAccess = null; + object.logUri = ""; + object.satisfiesPzs = false; + object.scheduledTime = null; + object.nodeSelector = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.completionTime != null && message.hasOwnProperty("completionTime")) + object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.job != null && message.hasOwnProperty("job")) + object.job = message.job; + if (message.execution != null && message.hasOwnProperty("execution")) + object.execution = message.execution; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); + } + if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) + object.maxRetries = message.maxRetries; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) + object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); + } + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (typeof message.observedGeneration === "number") + object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; + else + object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.retried != null && message.hasOwnProperty("retried")) + object.retried = message.retried; + if (message.lastAttemptResult != null && message.hasOwnProperty("lastAttemptResult")) + object.lastAttemptResult = $root.google.cloud.run.v2.TaskAttemptResult.toObject(message.lastAttemptResult, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = message.encryptionKey; + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) + object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); + if (message.logUri != null && message.hasOwnProperty("logUri")) + object.logUri = message.logUri; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.scheduledTime != null && message.hasOwnProperty("scheduledTime")) + object.scheduledTime = $root.google.protobuf.Timestamp.toObject(message.scheduledTime, options); + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) + object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; + if (options.oneofs) + object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Task to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Task"; + }; + + return Task; + })(); + + v2.TaskAttemptResult = (function() { + + /** + * Properties of a TaskAttemptResult. + * @memberof google.cloud.run.v2 + * @interface ITaskAttemptResult + * @property {google.rpc.IStatus|null} [status] TaskAttemptResult status + * @property {number|null} [exitCode] TaskAttemptResult exitCode + * @property {number|null} [termSignal] TaskAttemptResult termSignal + */ + + /** + * Constructs a new TaskAttemptResult. + * @memberof google.cloud.run.v2 + * @classdesc Represents a TaskAttemptResult. + * @implements ITaskAttemptResult + * @constructor + * @param {google.cloud.run.v2.ITaskAttemptResult=} [properties] Properties to set + */ + function TaskAttemptResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskAttemptResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.run.v2.TaskAttemptResult + * @instance + */ + TaskAttemptResult.prototype.status = null; + + /** + * TaskAttemptResult exitCode. + * @member {number} exitCode + * @memberof google.cloud.run.v2.TaskAttemptResult + * @instance + */ + TaskAttemptResult.prototype.exitCode = 0; + + /** + * TaskAttemptResult termSignal. + * @member {number} termSignal + * @memberof google.cloud.run.v2.TaskAttemptResult + * @instance + */ + TaskAttemptResult.prototype.termSignal = 0; + + /** + * Creates a new TaskAttemptResult instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.TaskAttemptResult + * @static + * @param {google.cloud.run.v2.ITaskAttemptResult=} [properties] Properties to set + * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult instance + */ + TaskAttemptResult.create = function create(properties) { + return new TaskAttemptResult(properties); + }; + + /** + * Encodes the specified TaskAttemptResult message. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.TaskAttemptResult + * @static + * @param {google.cloud.run.v2.ITaskAttemptResult} message TaskAttemptResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskAttemptResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.exitCode); + if (message.termSignal != null && Object.hasOwnProperty.call(message, "termSignal")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.termSignal); + return writer; + }; + + /** + * Encodes the specified TaskAttemptResult message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.TaskAttemptResult + * @static + * @param {google.cloud.run.v2.ITaskAttemptResult} message TaskAttemptResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskAttemptResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskAttemptResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.TaskAttemptResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskAttemptResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TaskAttemptResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.exitCode = reader.int32(); + break; + } + case 3: { + message.termSignal = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskAttemptResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.TaskAttemptResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskAttemptResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskAttemptResult message. + * @function verify + * @memberof google.cloud.run.v2.TaskAttemptResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskAttemptResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + if (!$util.isInteger(message.exitCode)) + return "exitCode: integer expected"; + if (message.termSignal != null && message.hasOwnProperty("termSignal")) + if (!$util.isInteger(message.termSignal)) + return "termSignal: integer expected"; + return null; + }; + + /** + * Creates a TaskAttemptResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.TaskAttemptResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult + */ + TaskAttemptResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.TaskAttemptResult) + return object; + var message = new $root.google.cloud.run.v2.TaskAttemptResult(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.run.v2.TaskAttemptResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.exitCode != null) + message.exitCode = object.exitCode | 0; + if (object.termSignal != null) + message.termSignal = object.termSignal | 0; + return message; + }; + + /** + * Creates a plain object from a TaskAttemptResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.TaskAttemptResult + * @static + * @param {google.cloud.run.v2.TaskAttemptResult} message TaskAttemptResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskAttemptResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = null; + object.exitCode = 0; + object.termSignal = 0; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + object.exitCode = message.exitCode; + if (message.termSignal != null && message.hasOwnProperty("termSignal")) + object.termSignal = message.termSignal; + return object; + }; + + /** + * Converts this TaskAttemptResult to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.TaskAttemptResult + * @instance + * @returns {Object.} JSON object + */ + TaskAttemptResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskAttemptResult + * @function getTypeUrl + * @memberof google.cloud.run.v2.TaskAttemptResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskAttemptResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.TaskAttemptResult"; + }; + + return TaskAttemptResult; + })(); + + v2.WorkerPools = (function() { + + /** + * Constructs a new WorkerPools service. + * @memberof google.cloud.run.v2 + * @classdesc Represents a WorkerPools + * @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 WorkerPools(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (WorkerPools.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WorkerPools; + + /** + * Creates new WorkerPools service using the specified rpc implementation. + * @function create + * @memberof google.cloud.run.v2.WorkerPools + * @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 {WorkerPools} RPC service. Useful where requests and/or responses are streamed. + */ + WorkerPools.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|createWorkerPool}. + * @memberof google.cloud.run.v2.WorkerPools + * @typedef CreateWorkerPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateWorkerPool. + * @function createWorkerPool + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} request CreateWorkerPoolRequest message or plain object + * @param {google.cloud.run.v2.WorkerPools.CreateWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkerPools.prototype.createWorkerPool = function createWorkerPool(request, callback) { + return this.rpcCall(createWorkerPool, $root.google.cloud.run.v2.CreateWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateWorkerPool" }); + + /** + * Calls CreateWorkerPool. + * @function createWorkerPool + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} request CreateWorkerPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|getWorkerPool}. + * @memberof google.cloud.run.v2.WorkerPools + * @typedef GetWorkerPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.WorkerPool} [response] WorkerPool + */ + + /** + * Calls GetWorkerPool. + * @function getWorkerPool + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.cloud.run.v2.IGetWorkerPoolRequest} request GetWorkerPoolRequest message or plain object + * @param {google.cloud.run.v2.WorkerPools.GetWorkerPoolCallback} callback Node-style callback called with the error, if any, and WorkerPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkerPools.prototype.getWorkerPool = function getWorkerPool(request, callback) { + return this.rpcCall(getWorkerPool, $root.google.cloud.run.v2.GetWorkerPoolRequest, $root.google.cloud.run.v2.WorkerPool, request, callback); + }, "name", { value: "GetWorkerPool" }); + + /** + * Calls GetWorkerPool. + * @function getWorkerPool + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.cloud.run.v2.IGetWorkerPoolRequest} request GetWorkerPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|listWorkerPools}. + * @memberof google.cloud.run.v2.WorkerPools + * @typedef ListWorkerPoolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.ListWorkerPoolsResponse} [response] ListWorkerPoolsResponse + */ + + /** + * Calls ListWorkerPools. + * @function listWorkerPools + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.cloud.run.v2.IListWorkerPoolsRequest} request ListWorkerPoolsRequest message or plain object + * @param {google.cloud.run.v2.WorkerPools.ListWorkerPoolsCallback} callback Node-style callback called with the error, if any, and ListWorkerPoolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkerPools.prototype.listWorkerPools = function listWorkerPools(request, callback) { + return this.rpcCall(listWorkerPools, $root.google.cloud.run.v2.ListWorkerPoolsRequest, $root.google.cloud.run.v2.ListWorkerPoolsResponse, request, callback); + }, "name", { value: "ListWorkerPools" }); + + /** + * Calls ListWorkerPools. + * @function listWorkerPools + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.cloud.run.v2.IListWorkerPoolsRequest} request ListWorkerPoolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|updateWorkerPool}. + * @memberof google.cloud.run.v2.WorkerPools + * @typedef UpdateWorkerPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateWorkerPool. + * @function updateWorkerPool + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} request UpdateWorkerPoolRequest message or plain object + * @param {google.cloud.run.v2.WorkerPools.UpdateWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkerPools.prototype.updateWorkerPool = function updateWorkerPool(request, callback) { + return this.rpcCall(updateWorkerPool, $root.google.cloud.run.v2.UpdateWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateWorkerPool" }); + + /** + * Calls UpdateWorkerPool. + * @function updateWorkerPool + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} request UpdateWorkerPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|deleteWorkerPool}. + * @memberof google.cloud.run.v2.WorkerPools + * @typedef DeleteWorkerPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteWorkerPool. + * @function deleteWorkerPool + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} request DeleteWorkerPoolRequest message or plain object + * @param {google.cloud.run.v2.WorkerPools.DeleteWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkerPools.prototype.deleteWorkerPool = function deleteWorkerPool(request, callback) { + return this.rpcCall(deleteWorkerPool, $root.google.cloud.run.v2.DeleteWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteWorkerPool" }); + + /** + * Calls DeleteWorkerPool. + * @function deleteWorkerPool + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} request DeleteWorkerPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|getIamPolicy}. + * @memberof google.cloud.run.v2.WorkerPools + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.cloud.run.v2.WorkerPools.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkerPools.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|setIamPolicy}. + * @memberof google.cloud.run.v2.WorkerPools + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.cloud.run.v2.WorkerPools.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkerPools.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.WorkerPools|testIamPermissions}. + * @memberof google.cloud.run.v2.WorkerPools + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.cloud.run.v2.WorkerPools.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkerPools.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.run.v2.WorkerPools + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return WorkerPools; + })(); + + v2.CreateWorkerPoolRequest = (function() { + + /** + * Properties of a CreateWorkerPoolRequest. + * @memberof google.cloud.run.v2 + * @interface ICreateWorkerPoolRequest + * @property {string|null} [parent] CreateWorkerPoolRequest parent + * @property {google.cloud.run.v2.IWorkerPool|null} [workerPool] CreateWorkerPoolRequest workerPool + * @property {string|null} [workerPoolId] CreateWorkerPoolRequest workerPoolId + * @property {boolean|null} [validateOnly] CreateWorkerPoolRequest validateOnly + */ + + /** + * Constructs a new CreateWorkerPoolRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a CreateWorkerPoolRequest. + * @implements ICreateWorkerPoolRequest + * @constructor + * @param {google.cloud.run.v2.ICreateWorkerPoolRequest=} [properties] Properties to set + */ + function CreateWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkerPoolRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.parent = ""; + + /** + * CreateWorkerPoolRequest workerPool. + * @member {google.cloud.run.v2.IWorkerPool|null|undefined} workerPool + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.workerPool = null; + + /** + * CreateWorkerPoolRequest workerPoolId. + * @member {string} workerPoolId + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.workerPoolId = ""; + + /** + * CreateWorkerPoolRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.ICreateWorkerPoolRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest instance + */ + CreateWorkerPoolRequest.create = function create(properties) { + return new CreateWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified CreateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkerPoolRequest.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.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + $root.google.cloud.run.v2.WorkerPool.encode(message.workerPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.workerPoolId != null && Object.hasOwnProperty.call(message, "workerPoolId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.workerPoolId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkerPoolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateWorkerPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.workerPool = $root.google.cloud.run.v2.WorkerPool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.workerPoolId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkerPoolRequest message. + * @function verify + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkerPoolRequest.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.workerPool != null && message.hasOwnProperty("workerPool")) { + var error = $root.google.cloud.run.v2.WorkerPool.verify(message.workerPool); + if (error) + return "workerPool." + error; + } + if (message.workerPoolId != null && message.hasOwnProperty("workerPoolId")) + if (!$util.isString(message.workerPoolId)) + return "workerPoolId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest + */ + CreateWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.CreateWorkerPoolRequest) + return object; + var message = new $root.google.cloud.run.v2.CreateWorkerPoolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.workerPool != null) { + if (typeof object.workerPool !== "object") + throw TypeError(".google.cloud.run.v2.CreateWorkerPoolRequest.workerPool: object expected"); + message.workerPool = $root.google.cloud.run.v2.WorkerPool.fromObject(object.workerPool); + } + if (object.workerPoolId != null) + message.workerPoolId = String(object.workerPoolId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateWorkerPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.CreateWorkerPoolRequest} message CreateWorkerPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkerPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.workerPool = null; + object.workerPoolId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = $root.google.cloud.run.v2.WorkerPool.toObject(message.workerPool, options); + if (message.workerPoolId != null && message.hasOwnProperty("workerPoolId")) + object.workerPoolId = message.workerPoolId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateWorkerPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWorkerPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateWorkerPoolRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.CreateWorkerPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.CreateWorkerPoolRequest"; + }; + + return CreateWorkerPoolRequest; + })(); + + v2.UpdateWorkerPoolRequest = (function() { + + /** + * Properties of an UpdateWorkerPoolRequest. + * @memberof google.cloud.run.v2 + * @interface IUpdateWorkerPoolRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkerPoolRequest updateMask + * @property {google.cloud.run.v2.IWorkerPool|null} [workerPool] UpdateWorkerPoolRequest workerPool + * @property {boolean|null} [validateOnly] UpdateWorkerPoolRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateWorkerPoolRequest allowMissing + * @property {boolean|null} [forceNewRevision] UpdateWorkerPoolRequest forceNewRevision + */ + + /** + * Constructs a new UpdateWorkerPoolRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents an UpdateWorkerPoolRequest. + * @implements IUpdateWorkerPoolRequest + * @constructor + * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest=} [properties] Properties to set + */ + function UpdateWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWorkerPoolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @instance + */ + UpdateWorkerPoolRequest.prototype.updateMask = null; + + /** + * UpdateWorkerPoolRequest workerPool. + * @member {google.cloud.run.v2.IWorkerPool|null|undefined} workerPool + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @instance + */ + UpdateWorkerPoolRequest.prototype.workerPool = null; + + /** + * UpdateWorkerPoolRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @instance + */ + UpdateWorkerPoolRequest.prototype.validateOnly = false; + + /** + * UpdateWorkerPoolRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @instance + */ + UpdateWorkerPoolRequest.prototype.allowMissing = false; + + /** + * UpdateWorkerPoolRequest forceNewRevision. + * @member {boolean} forceNewRevision + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @instance + */ + UpdateWorkerPoolRequest.prototype.forceNewRevision = false; + + /** + * Creates a new UpdateWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest instance + */ + UpdateWorkerPoolRequest.create = function create(properties) { + return new UpdateWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified UpdateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkerPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + $root.google.cloud.run.v2.WorkerPool.encode(message.workerPool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + if (message.forceNewRevision != null && Object.hasOwnProperty.call(message, "forceNewRevision")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.forceNewRevision); + return writer; + }; + + /** + * Encodes the specified UpdateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkerPoolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.UpdateWorkerPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 1: { + message.workerPool = $root.google.cloud.run.v2.WorkerPool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + case 5: { + message.forceNewRevision = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWorkerPoolRequest message. + * @function verify + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWorkerPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) { + var error = $root.google.cloud.run.v2.WorkerPool.verify(message.workerPool); + if (error) + return "workerPool." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.forceNewRevision != null && message.hasOwnProperty("forceNewRevision")) + if (typeof message.forceNewRevision !== "boolean") + return "forceNewRevision: boolean expected"; + return null; + }; + + /** + * Creates an UpdateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest + */ + UpdateWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.UpdateWorkerPoolRequest) + return object; + var message = new $root.google.cloud.run.v2.UpdateWorkerPoolRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.run.v2.UpdateWorkerPoolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.workerPool != null) { + if (typeof object.workerPool !== "object") + throw TypeError(".google.cloud.run.v2.UpdateWorkerPoolRequest.workerPool: object expected"); + message.workerPool = $root.google.cloud.run.v2.WorkerPool.fromObject(object.workerPool); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.forceNewRevision != null) + message.forceNewRevision = Boolean(object.forceNewRevision); + return message; + }; + + /** + * Creates a plain object from an UpdateWorkerPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.UpdateWorkerPoolRequest} message UpdateWorkerPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWorkerPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workerPool = null; + object.updateMask = null; + object.validateOnly = false; + object.allowMissing = false; + object.forceNewRevision = false; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = $root.google.cloud.run.v2.WorkerPool.toObject(message.workerPool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.forceNewRevision != null && message.hasOwnProperty("forceNewRevision")) + object.forceNewRevision = message.forceNewRevision; + return object; + }; + + /** + * Converts this UpdateWorkerPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWorkerPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateWorkerPoolRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.UpdateWorkerPoolRequest"; + }; + + return UpdateWorkerPoolRequest; + })(); + + v2.ListWorkerPoolsRequest = (function() { + + /** + * Properties of a ListWorkerPoolsRequest. + * @memberof google.cloud.run.v2 + * @interface IListWorkerPoolsRequest + * @property {string|null} [parent] ListWorkerPoolsRequest parent + * @property {number|null} [pageSize] ListWorkerPoolsRequest pageSize + * @property {string|null} [pageToken] ListWorkerPoolsRequest pageToken + * @property {boolean|null} [showDeleted] ListWorkerPoolsRequest showDeleted + */ + + /** + * Constructs a new ListWorkerPoolsRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListWorkerPoolsRequest. + * @implements IListWorkerPoolsRequest + * @constructor + * @param {google.cloud.run.v2.IListWorkerPoolsRequest=} [properties] Properties to set + */ + function ListWorkerPoolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkerPoolsRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @instance + */ + ListWorkerPoolsRequest.prototype.parent = ""; + + /** + * ListWorkerPoolsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @instance + */ + ListWorkerPoolsRequest.prototype.pageSize = 0; + + /** + * ListWorkerPoolsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @instance + */ + ListWorkerPoolsRequest.prototype.pageToken = ""; + + /** + * ListWorkerPoolsRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @instance + */ + ListWorkerPoolsRequest.prototype.showDeleted = false; + + /** + * Creates a new ListWorkerPoolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @static + * @param {google.cloud.run.v2.IListWorkerPoolsRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest instance + */ + ListWorkerPoolsRequest.create = function create(properties) { + return new ListWorkerPoolsRequest(properties); + }; + + /** + * Encodes the specified ListWorkerPoolsRequest message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @static + * @param {google.cloud.run.v2.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkerPoolsRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListWorkerPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @static + * @param {google.cloud.run.v2.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkerPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkerPoolsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListWorkerPoolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkerPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkerPoolsRequest message. + * @function verify + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkerPoolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListWorkerPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest + */ + ListWorkerPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListWorkerPoolsRequest) + return object; + var message = new $root.google.cloud.run.v2.ListWorkerPoolsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListWorkerPoolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @static + * @param {google.cloud.run.v2.ListWorkerPoolsRequest} message ListWorkerPoolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkerPoolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + 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.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListWorkerPoolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListWorkerPoolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkerPoolsRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListWorkerPoolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkerPoolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListWorkerPoolsRequest"; + }; + + return ListWorkerPoolsRequest; + })(); + + v2.ListWorkerPoolsResponse = (function() { + + /** + * Properties of a ListWorkerPoolsResponse. + * @memberof google.cloud.run.v2 + * @interface IListWorkerPoolsResponse + * @property {Array.|null} [workerPools] ListWorkerPoolsResponse workerPools + * @property {string|null} [nextPageToken] ListWorkerPoolsResponse nextPageToken + */ + + /** + * Constructs a new ListWorkerPoolsResponse. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListWorkerPoolsResponse. + * @implements IListWorkerPoolsResponse + * @constructor + * @param {google.cloud.run.v2.IListWorkerPoolsResponse=} [properties] Properties to set + */ + function ListWorkerPoolsResponse(properties) { + this.workerPools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkerPoolsResponse workerPools. + * @member {Array.} workerPools + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @instance + */ + ListWorkerPoolsResponse.prototype.workerPools = $util.emptyArray; + + /** + * ListWorkerPoolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @instance + */ + ListWorkerPoolsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListWorkerPoolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @static + * @param {google.cloud.run.v2.IListWorkerPoolsResponse=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse instance + */ + ListWorkerPoolsResponse.create = function create(properties) { + return new ListWorkerPoolsResponse(properties); + }; + + /** + * Encodes the specified ListWorkerPoolsResponse message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @static + * @param {google.cloud.run.v2.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkerPoolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerPools != null && message.workerPools.length) + for (var i = 0; i < message.workerPools.length; ++i) + $root.google.cloud.run.v2.WorkerPool.encode(message.workerPools[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 ListWorkerPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @static + * @param {google.cloud.run.v2.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkerPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkerPoolsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListWorkerPoolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.workerPools && message.workerPools.length)) + message.workerPools = []; + message.workerPools.push($root.google.cloud.run.v2.WorkerPool.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkerPoolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkerPoolsResponse message. + * @function verify + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkerPoolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workerPools != null && message.hasOwnProperty("workerPools")) { + if (!Array.isArray(message.workerPools)) + return "workerPools: array expected"; + for (var i = 0; i < message.workerPools.length; ++i) { + var error = $root.google.cloud.run.v2.WorkerPool.verify(message.workerPools[i]); + if (error) + return "workerPools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListWorkerPoolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse + */ + ListWorkerPoolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListWorkerPoolsResponse) + return object; + var message = new $root.google.cloud.run.v2.ListWorkerPoolsResponse(); + if (object.workerPools) { + if (!Array.isArray(object.workerPools)) + throw TypeError(".google.cloud.run.v2.ListWorkerPoolsResponse.workerPools: array expected"); + message.workerPools = []; + for (var i = 0; i < object.workerPools.length; ++i) { + if (typeof object.workerPools[i] !== "object") + throw TypeError(".google.cloud.run.v2.ListWorkerPoolsResponse.workerPools: object expected"); + message.workerPools[i] = $root.google.cloud.run.v2.WorkerPool.fromObject(object.workerPools[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListWorkerPoolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @static + * @param {google.cloud.run.v2.ListWorkerPoolsResponse} message ListWorkerPoolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkerPoolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.workerPools = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.workerPools && message.workerPools.length) { + object.workerPools = []; + for (var j = 0; j < message.workerPools.length; ++j) + object.workerPools[j] = $root.google.cloud.run.v2.WorkerPool.toObject(message.workerPools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListWorkerPoolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListWorkerPoolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkerPoolsResponse + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListWorkerPoolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkerPoolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListWorkerPoolsResponse"; + }; + + return ListWorkerPoolsResponse; + })(); + + v2.GetWorkerPoolRequest = (function() { + + /** + * Properties of a GetWorkerPoolRequest. + * @memberof google.cloud.run.v2 + * @interface IGetWorkerPoolRequest + * @property {string|null} [name] GetWorkerPoolRequest name + */ + + /** + * Constructs a new GetWorkerPoolRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GetWorkerPoolRequest. + * @implements IGetWorkerPoolRequest + * @constructor + * @param {google.cloud.run.v2.IGetWorkerPoolRequest=} [properties] Properties to set + */ + function GetWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWorkerPoolRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @instance + */ + GetWorkerPoolRequest.prototype.name = ""; + + /** + * Creates a new GetWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.IGetWorkerPoolRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest instance + */ + GetWorkerPoolRequest.create = function create(properties) { + return new GetWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified GetWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkerPoolRequest.encode = function encode(message, writer) { + 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 GetWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkerPoolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetWorkerPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWorkerPoolRequest message. + * @function verify + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWorkerPoolRequest.verify = function verify(message) { + if (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 GetWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest + */ + GetWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GetWorkerPoolRequest) + return object; + var message = new $root.google.cloud.run.v2.GetWorkerPoolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWorkerPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.GetWorkerPoolRequest} message GetWorkerPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWorkerPoolRequest.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 GetWorkerPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @instance + * @returns {Object.} JSON object + */ + GetWorkerPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetWorkerPoolRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.GetWorkerPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.GetWorkerPoolRequest"; + }; + + return GetWorkerPoolRequest; + })(); + + v2.DeleteWorkerPoolRequest = (function() { + + /** + * Properties of a DeleteWorkerPoolRequest. + * @memberof google.cloud.run.v2 + * @interface IDeleteWorkerPoolRequest + * @property {string|null} [name] DeleteWorkerPoolRequest name + * @property {boolean|null} [validateOnly] DeleteWorkerPoolRequest validateOnly + * @property {string|null} [etag] DeleteWorkerPoolRequest etag + */ + + /** + * Constructs a new DeleteWorkerPoolRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a DeleteWorkerPoolRequest. + * @implements IDeleteWorkerPoolRequest + * @constructor + * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest=} [properties] Properties to set + */ + function DeleteWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWorkerPoolRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.name = ""; + + /** + * DeleteWorkerPoolRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.validateOnly = false; + + /** + * DeleteWorkerPoolRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.etag = ""; + + /** + * Creates a new DeleteWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest instance + */ + DeleteWorkerPoolRequest.create = function create(properties) { + return new DeleteWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified DeleteWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkerPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkerPoolRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteWorkerPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWorkerPoolRequest message. + * @function verify + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWorkerPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest + */ + DeleteWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.DeleteWorkerPoolRequest) + return object; + var message = new $root.google.cloud.run.v2.DeleteWorkerPoolRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteWorkerPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @static + * @param {google.cloud.run.v2.DeleteWorkerPoolRequest} message DeleteWorkerPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWorkerPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteWorkerPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWorkerPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteWorkerPoolRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.DeleteWorkerPoolRequest"; + }; + + return DeleteWorkerPoolRequest; + })(); + + v2.WorkerPool = (function() { + + /** + * Properties of a WorkerPool. + * @memberof google.cloud.run.v2 + * @interface IWorkerPool + * @property {string|null} [name] WorkerPool name + * @property {string|null} [description] WorkerPool description + * @property {string|null} [uid] WorkerPool uid + * @property {number|Long|null} [generation] WorkerPool generation + * @property {Object.|null} [labels] WorkerPool labels + * @property {Object.|null} [annotations] WorkerPool annotations + * @property {google.protobuf.ITimestamp|null} [createTime] WorkerPool createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] WorkerPool updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] WorkerPool deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] WorkerPool expireTime + * @property {string|null} [creator] WorkerPool creator + * @property {string|null} [lastModifier] WorkerPool lastModifier + * @property {string|null} [client] WorkerPool client + * @property {string|null} [clientVersion] WorkerPool clientVersion + * @property {google.api.LaunchStage|null} [launchStage] WorkerPool launchStage + * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] WorkerPool binaryAuthorization + * @property {google.cloud.run.v2.IWorkerPoolRevisionTemplate|null} [template] WorkerPool template + * @property {Array.|null} [instanceSplits] WorkerPool instanceSplits + * @property {google.cloud.run.v2.IWorkerPoolScaling|null} [scaling] WorkerPool scaling + * @property {number|Long|null} [observedGeneration] WorkerPool observedGeneration + * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] WorkerPool terminalCondition + * @property {Array.|null} [conditions] WorkerPool conditions + * @property {string|null} [latestReadyRevision] WorkerPool latestReadyRevision + * @property {string|null} [latestCreatedRevision] WorkerPool latestCreatedRevision + * @property {Array.|null} [instanceSplitStatuses] WorkerPool instanceSplitStatuses + * @property {boolean|null} [threatDetectionEnabled] WorkerPool threatDetectionEnabled + * @property {Array.|null} [customAudiences] WorkerPool customAudiences + * @property {boolean|null} [satisfiesPzs] WorkerPool satisfiesPzs + * @property {boolean|null} [reconciling] WorkerPool reconciling + * @property {string|null} [etag] WorkerPool etag + */ + + /** + * Constructs a new WorkerPool. + * @memberof google.cloud.run.v2 + * @classdesc Represents a WorkerPool. + * @implements IWorkerPool + * @constructor + * @param {google.cloud.run.v2.IWorkerPool=} [properties] Properties to set + */ + function WorkerPool(properties) { + this.labels = {}; + this.annotations = {}; + this.instanceSplits = []; + this.conditions = []; + this.instanceSplitStatuses = []; + this.customAudiences = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkerPool name. + * @member {string} name + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.name = ""; + + /** + * WorkerPool description. + * @member {string} description + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.description = ""; + + /** + * WorkerPool uid. + * @member {string} uid + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.uid = ""; + + /** + * WorkerPool generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * WorkerPool labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.labels = $util.emptyObject; + + /** + * WorkerPool annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.annotations = $util.emptyObject; + + /** + * WorkerPool createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.createTime = null; + + /** + * WorkerPool updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.updateTime = null; + + /** + * WorkerPool deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.deleteTime = null; + + /** + * WorkerPool expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.expireTime = null; + + /** + * WorkerPool creator. + * @member {string} creator + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.creator = ""; + + /** + * WorkerPool lastModifier. + * @member {string} lastModifier + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.lastModifier = ""; + + /** + * WorkerPool client. + * @member {string} client + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.client = ""; + + /** + * WorkerPool clientVersion. + * @member {string} clientVersion + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.clientVersion = ""; + + /** + * WorkerPool launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.launchStage = 0; + + /** + * WorkerPool binaryAuthorization. + * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.binaryAuthorization = null; + + /** + * WorkerPool template. + * @member {google.cloud.run.v2.IWorkerPoolRevisionTemplate|null|undefined} template + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.template = null; + + /** + * WorkerPool instanceSplits. + * @member {Array.} instanceSplits + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.instanceSplits = $util.emptyArray; + + /** + * WorkerPool scaling. + * @member {google.cloud.run.v2.IWorkerPoolScaling|null|undefined} scaling + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.scaling = null; + + /** + * WorkerPool observedGeneration. + * @member {number|Long} observedGeneration + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * WorkerPool terminalCondition. + * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.terminalCondition = null; + + /** + * WorkerPool conditions. + * @member {Array.} conditions + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.conditions = $util.emptyArray; + + /** + * WorkerPool latestReadyRevision. + * @member {string} latestReadyRevision + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.latestReadyRevision = ""; + + /** + * WorkerPool latestCreatedRevision. + * @member {string} latestCreatedRevision + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.latestCreatedRevision = ""; + + /** + * WorkerPool instanceSplitStatuses. + * @member {Array.} instanceSplitStatuses + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.instanceSplitStatuses = $util.emptyArray; + + /** + * WorkerPool threatDetectionEnabled. + * @member {boolean} threatDetectionEnabled + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.threatDetectionEnabled = false; + + /** + * WorkerPool customAudiences. + * @member {Array.} customAudiences + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.customAudiences = $util.emptyArray; + + /** + * WorkerPool satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.satisfiesPzs = false; + + /** + * WorkerPool reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.reconciling = false; + + /** + * WorkerPool etag. + * @member {string} etag + * @memberof google.cloud.run.v2.WorkerPool + * @instance + */ + WorkerPool.prototype.etag = ""; + + /** + * Creates a new WorkerPool instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.WorkerPool + * @static + * @param {google.cloud.run.v2.IWorkerPool=} [properties] Properties to set + * @returns {google.cloud.run.v2.WorkerPool} WorkerPool instance + */ + WorkerPool.create = function create(properties) { + return new WorkerPool(properties); + }; + + /** + * Encodes the specified WorkerPool message. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.WorkerPool + * @static + * @param {google.cloud.run.v2.IWorkerPool} message WorkerPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.generation); + 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.creator); + if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.lastModifier); + if (message.client != null && Object.hasOwnProperty.call(message, "client")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.client); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.clientVersion); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); + if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) + $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.template != null && Object.hasOwnProperty.call(message, "template")) + $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.encode(message.template, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) + $root.google.cloud.run.v2.WorkerPoolScaling.encode(message.scaling, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.instanceSplits != null && message.instanceSplits.length) + for (var i = 0; i < message.instanceSplits.length; ++i) + $root.google.cloud.run.v2.InstanceSplit.encode(message.instanceSplits[i], writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.instanceSplitStatuses != null && message.instanceSplitStatuses.length) + for (var i = 0; i < message.instanceSplitStatuses.length; ++i) + $root.google.cloud.run.v2.InstanceSplitStatus.encode(message.instanceSplitStatuses[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.threatDetectionEnabled != null && Object.hasOwnProperty.call(message, "threatDetectionEnabled")) + writer.uint32(/* id 28, wireType 0 =*/224).bool(message.threatDetectionEnabled); + if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) + writer.uint32(/* id 30, wireType 0 =*/240).int64(message.observedGeneration); + if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) + $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.latestReadyRevision != null && Object.hasOwnProperty.call(message, "latestReadyRevision")) + writer.uint32(/* id 33, wireType 2 =*/266).string(message.latestReadyRevision); + if (message.latestCreatedRevision != null && Object.hasOwnProperty.call(message, "latestCreatedRevision")) + writer.uint32(/* id 34, wireType 2 =*/274).string(message.latestCreatedRevision); + if (message.customAudiences != null && message.customAudiences.length) + for (var i = 0; i < message.customAudiences.length; ++i) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.customAudiences[i]); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 38, wireType 0 =*/304).bool(message.satisfiesPzs); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); + return writer; + }; + + /** + * Encodes the specified WorkerPool message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.WorkerPool + * @static + * @param {google.cloud.run.v2.IWorkerPool} message WorkerPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkerPool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.WorkerPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.WorkerPool} WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerPool.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.WorkerPool(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.generation = reader.int64(); + 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.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.creator = reader.string(); + break; + } + case 12: { + message.lastModifier = reader.string(); + break; + } + case 13: { + message.client = reader.string(); + break; + } + case 14: { + message.clientVersion = reader.string(); + break; + } + case 16: { + message.launchStage = reader.int32(); + break; + } + case 17: { + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); + break; + } + case 18: { + message.template = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.decode(reader, reader.uint32()); + break; + } + case 26: { + if (!(message.instanceSplits && message.instanceSplits.length)) + message.instanceSplits = []; + message.instanceSplits.push($root.google.cloud.run.v2.InstanceSplit.decode(reader, reader.uint32())); + break; + } + case 20: { + message.scaling = $root.google.cloud.run.v2.WorkerPoolScaling.decode(reader, reader.uint32()); + break; + } + case 30: { + message.observedGeneration = reader.int64(); + break; + } + case 31: { + message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); + break; + } + case 32: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); + break; + } + case 33: { + message.latestReadyRevision = reader.string(); + break; + } + case 34: { + message.latestCreatedRevision = reader.string(); + break; + } + case 27: { + if (!(message.instanceSplitStatuses && message.instanceSplitStatuses.length)) + message.instanceSplitStatuses = []; + message.instanceSplitStatuses.push($root.google.cloud.run.v2.InstanceSplitStatus.decode(reader, reader.uint32())); + break; + } + case 28: { + message.threatDetectionEnabled = reader.bool(); + break; + } + case 37: { + if (!(message.customAudiences && message.customAudiences.length)) + message.customAudiences = []; + message.customAudiences.push(reader.string()); + break; + } + case 38: { + message.satisfiesPzs = reader.bool(); + break; + } + case 98: { + message.reconciling = reader.bool(); + break; + } + case 99: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkerPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.WorkerPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.WorkerPool} WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerPool message. + * @function verify + * @memberof google.cloud.run.v2.WorkerPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerPool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + if (!$util.isString(message.lastModifier)) + return "lastModifier: string expected"; + if (message.client != null && message.hasOwnProperty("client")) + if (!$util.isString(message.client)) + return "client: string expected"; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { + var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); + if (error) + return "binaryAuthorization." + error; + } + if (message.template != null && message.hasOwnProperty("template")) { + var error = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.verify(message.template); + if (error) + return "template." + error; + } + if (message.instanceSplits != null && message.hasOwnProperty("instanceSplits")) { + if (!Array.isArray(message.instanceSplits)) + return "instanceSplits: array expected"; + for (var i = 0; i < message.instanceSplits.length; ++i) { + var error = $root.google.cloud.run.v2.InstanceSplit.verify(message.instanceSplits[i]); + if (error) + return "instanceSplits." + error; + } + } + if (message.scaling != null && message.hasOwnProperty("scaling")) { + var error = $root.google.cloud.run.v2.WorkerPoolScaling.verify(message.scaling); + if (error) + return "scaling." + error; + } + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) + return "observedGeneration: integer|Long expected"; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { + var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); + if (error) + return "terminalCondition." + error; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) + if (!$util.isString(message.latestReadyRevision)) + return "latestReadyRevision: string expected"; + if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) + if (!$util.isString(message.latestCreatedRevision)) + return "latestCreatedRevision: string expected"; + if (message.instanceSplitStatuses != null && message.hasOwnProperty("instanceSplitStatuses")) { + if (!Array.isArray(message.instanceSplitStatuses)) + return "instanceSplitStatuses: array expected"; + for (var i = 0; i < message.instanceSplitStatuses.length; ++i) { + var error = $root.google.cloud.run.v2.InstanceSplitStatus.verify(message.instanceSplitStatuses[i]); + if (error) + return "instanceSplitStatuses." + error; + } + } + if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) + if (typeof message.threatDetectionEnabled !== "boolean") + return "threatDetectionEnabled: boolean expected"; + if (message.customAudiences != null && message.hasOwnProperty("customAudiences")) { + if (!Array.isArray(message.customAudiences)) + return "customAudiences: array expected"; + for (var i = 0; i < message.customAudiences.length; ++i) + if (!$util.isString(message.customAudiences[i])) + return "customAudiences: string[] expected"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a WorkerPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.WorkerPool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.WorkerPool} WorkerPool + */ + WorkerPool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.WorkerPool) + return object; + var message = new $root.google.cloud.run.v2.WorkerPool(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.uid != null) + message.uid = String(object.uid); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.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.run.v2.WorkerPool.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.lastModifier != null) + message.lastModifier = String(object.lastModifier); + if (object.client != null) + message.client = String(object.client); + if (object.clientVersion != null) + message.clientVersion = String(object.clientVersion); + 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.binaryAuthorization != null) { + if (typeof object.binaryAuthorization !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.binaryAuthorization: object expected"); + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); + } + if (object.template != null) { + if (typeof object.template !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.template: object expected"); + message.template = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.fromObject(object.template); + } + if (object.instanceSplits) { + if (!Array.isArray(object.instanceSplits)) + throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplits: array expected"); + message.instanceSplits = []; + for (var i = 0; i < object.instanceSplits.length; ++i) { + if (typeof object.instanceSplits[i] !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplits: object expected"); + message.instanceSplits[i] = $root.google.cloud.run.v2.InstanceSplit.fromObject(object.instanceSplits[i]); + } + } + if (object.scaling != null) { + if (typeof object.scaling !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.scaling: object expected"); + message.scaling = $root.google.cloud.run.v2.WorkerPoolScaling.fromObject(object.scaling); + } + if (object.observedGeneration != null) + if ($util.Long) + (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; + else if (typeof object.observedGeneration === "string") + message.observedGeneration = parseInt(object.observedGeneration, 10); + else if (typeof object.observedGeneration === "number") + message.observedGeneration = object.observedGeneration; + else if (typeof object.observedGeneration === "object") + message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); + if (object.terminalCondition != null) { + if (typeof object.terminalCondition !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.terminalCondition: object expected"); + message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); + } + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.run.v2.WorkerPool.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.conditions: object expected"); + message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); + } + } + if (object.latestReadyRevision != null) + message.latestReadyRevision = String(object.latestReadyRevision); + if (object.latestCreatedRevision != null) + message.latestCreatedRevision = String(object.latestCreatedRevision); + if (object.instanceSplitStatuses) { + if (!Array.isArray(object.instanceSplitStatuses)) + throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplitStatuses: array expected"); + message.instanceSplitStatuses = []; + for (var i = 0; i < object.instanceSplitStatuses.length; ++i) { + if (typeof object.instanceSplitStatuses[i] !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplitStatuses: object expected"); + message.instanceSplitStatuses[i] = $root.google.cloud.run.v2.InstanceSplitStatus.fromObject(object.instanceSplitStatuses[i]); + } + } + if (object.threatDetectionEnabled != null) + message.threatDetectionEnabled = Boolean(object.threatDetectionEnabled); + if (object.customAudiences) { + if (!Array.isArray(object.customAudiences)) + throw TypeError(".google.cloud.run.v2.WorkerPool.customAudiences: array expected"); + message.customAudiences = []; + for (var i = 0; i < object.customAudiences.length; ++i) + message.customAudiences[i] = String(object.customAudiences[i]); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a WorkerPool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.WorkerPool + * @static + * @param {google.cloud.run.v2.WorkerPool} message WorkerPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instanceSplits = []; + object.instanceSplitStatuses = []; + object.conditions = []; + object.customAudiences = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.creator = ""; + object.lastModifier = ""; + object.client = ""; + object.clientVersion = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.binaryAuthorization = null; + object.template = null; + object.scaling = null; + object.threatDetectionEnabled = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.observedGeneration = options.longs === String ? "0" : 0; + object.terminalCondition = null; + object.latestReadyRevision = ""; + object.latestCreatedRevision = ""; + object.satisfiesPzs = false; + object.reconciling = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + object.lastModifier = message.lastModifier; + if (message.client != null && message.hasOwnProperty("client")) + object.client = message.client; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) + object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); + if (message.template != null && message.hasOwnProperty("template")) + object.template = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.toObject(message.template, options); + if (message.scaling != null && message.hasOwnProperty("scaling")) + object.scaling = $root.google.cloud.run.v2.WorkerPoolScaling.toObject(message.scaling, options); + if (message.instanceSplits && message.instanceSplits.length) { + object.instanceSplits = []; + for (var j = 0; j < message.instanceSplits.length; ++j) + object.instanceSplits[j] = $root.google.cloud.run.v2.InstanceSplit.toObject(message.instanceSplits[j], options); + } + if (message.instanceSplitStatuses && message.instanceSplitStatuses.length) { + object.instanceSplitStatuses = []; + for (var j = 0; j < message.instanceSplitStatuses.length; ++j) + object.instanceSplitStatuses[j] = $root.google.cloud.run.v2.InstanceSplitStatus.toObject(message.instanceSplitStatuses[j], options); + } + if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) + object.threatDetectionEnabled = message.threatDetectionEnabled; + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (typeof message.observedGeneration === "number") + object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; + else + object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) + object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); + } + if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) + object.latestReadyRevision = message.latestReadyRevision; + if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) + object.latestCreatedRevision = message.latestCreatedRevision; + if (message.customAudiences && message.customAudiences.length) { + object.customAudiences = []; + for (var j = 0; j < message.customAudiences.length; ++j) + object.customAudiences[j] = message.customAudiences[j]; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this WorkerPool to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.WorkerPool + * @instance + * @returns {Object.} JSON object + */ + WorkerPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkerPool + * @function getTypeUrl + * @memberof google.cloud.run.v2.WorkerPool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.WorkerPool"; + }; + + return WorkerPool; + })(); + + v2.WorkerPoolRevisionTemplate = (function() { + + /** + * Properties of a WorkerPoolRevisionTemplate. + * @memberof google.cloud.run.v2 + * @interface IWorkerPoolRevisionTemplate + * @property {string|null} [revision] WorkerPoolRevisionTemplate revision + * @property {Object.|null} [labels] WorkerPoolRevisionTemplate labels + * @property {Object.|null} [annotations] WorkerPoolRevisionTemplate annotations + * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] WorkerPoolRevisionTemplate vpcAccess + * @property {string|null} [serviceAccount] WorkerPoolRevisionTemplate serviceAccount + * @property {Array.|null} [containers] WorkerPoolRevisionTemplate containers + * @property {Array.|null} [volumes] WorkerPoolRevisionTemplate volumes + * @property {string|null} [encryptionKey] WorkerPoolRevisionTemplate encryptionKey + * @property {google.cloud.run.v2.IServiceMesh|null} [serviceMesh] WorkerPoolRevisionTemplate serviceMesh + * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] WorkerPoolRevisionTemplate encryptionKeyRevocationAction + * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] WorkerPoolRevisionTemplate encryptionKeyShutdownDuration + * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] WorkerPoolRevisionTemplate nodeSelector + * @property {boolean|null} [gpuZonalRedundancyDisabled] WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled + */ + + /** + * Constructs a new WorkerPoolRevisionTemplate. + * @memberof google.cloud.run.v2 + * @classdesc Represents a WorkerPoolRevisionTemplate. + * @implements IWorkerPoolRevisionTemplate + * @constructor + * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate=} [properties] Properties to set + */ + function WorkerPoolRevisionTemplate(properties) { + this.labels = {}; + this.annotations = {}; + this.containers = []; + 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]]; + } + + /** + * WorkerPoolRevisionTemplate revision. + * @member {string} revision + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.revision = ""; + + /** + * WorkerPoolRevisionTemplate labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.labels = $util.emptyObject; + + /** + * WorkerPoolRevisionTemplate annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.annotations = $util.emptyObject; + + /** + * WorkerPoolRevisionTemplate vpcAccess. + * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.vpcAccess = null; + + /** + * WorkerPoolRevisionTemplate serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.serviceAccount = ""; + + /** + * WorkerPoolRevisionTemplate containers. + * @member {Array.} containers + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.containers = $util.emptyArray; + + /** + * WorkerPoolRevisionTemplate volumes. + * @member {Array.} volumes + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.volumes = $util.emptyArray; + + /** + * WorkerPoolRevisionTemplate encryptionKey. + * @member {string} encryptionKey + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.encryptionKey = ""; + + /** + * WorkerPoolRevisionTemplate serviceMesh. + * @member {google.cloud.run.v2.IServiceMesh|null|undefined} serviceMesh + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.serviceMesh = null; + + /** + * WorkerPoolRevisionTemplate encryptionKeyRevocationAction. + * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.encryptionKeyRevocationAction = 0; + + /** + * WorkerPoolRevisionTemplate encryptionKeyShutdownDuration. + * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.encryptionKeyShutdownDuration = null; + + /** + * WorkerPoolRevisionTemplate nodeSelector. + * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.nodeSelector = null; + + /** + * WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled. + * @member {boolean|null|undefined} gpuZonalRedundancyDisabled + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + */ + WorkerPoolRevisionTemplate.prototype.gpuZonalRedundancyDisabled = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(WorkerPoolRevisionTemplate.prototype, "_gpuZonalRedundancyDisabled", { + get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WorkerPoolRevisionTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @static + * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate=} [properties] Properties to set + * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate instance + */ + WorkerPoolRevisionTemplate.create = function create(properties) { + return new WorkerPoolRevisionTemplate(properties); + }; + + /** + * Encodes the specified WorkerPoolRevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @static + * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate} message WorkerPoolRevisionTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerPoolRevisionTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.revision); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); + if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) + $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.encryptionKey); + if (message.serviceMesh != null && Object.hasOwnProperty.call(message, "serviceMesh")) + $root.google.cloud.run.v2.ServiceMesh.encode(message.serviceMesh, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.encryptionKeyRevocationAction); + if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) + $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) + $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.gpuZonalRedundancyDisabled); + return writer; + }; + + /** + * Encodes the specified WorkerPoolRevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @static + * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate} message WorkerPoolRevisionTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerPoolRevisionTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerPoolRevisionTemplate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.WorkerPoolRevisionTemplate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revision = reader.string(); + break; + } + case 2: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 3: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 4: { + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); + break; + } + case 5: { + message.serviceAccount = reader.string(); + break; + } + case 6: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); + break; + } + case 8: { + message.encryptionKey = reader.string(); + break; + } + case 9: { + message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.decode(reader, reader.uint32()); + break; + } + case 10: { + message.encryptionKeyRevocationAction = reader.int32(); + break; + } + case 11: { + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 13: { + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); + break; + } + case 16: { + message.gpuZonalRedundancyDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerPoolRevisionTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerPoolRevisionTemplate message. + * @function verify + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerPoolRevisionTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isString(message.revision)) + return "revision: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { + var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); + if (error) + return "vpcAccess." + error; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + 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.run.v2.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + if (!$util.isString(message.encryptionKey)) + return "encryptionKey: string expected"; + if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) { + var error = $root.google.cloud.run.v2.ServiceMesh.verify(message.serviceMesh); + if (error) + return "serviceMesh." + error; + } + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + switch (message.encryptionKeyRevocationAction) { + default: + return "encryptionKeyRevocationAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { + var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); + if (error) + return "encryptionKeyShutdownDuration." + error; + } + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { + var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); + if (error) + return "nodeSelector." + error; + } + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + properties._gpuZonalRedundancyDisabled = 1; + if (typeof message.gpuZonalRedundancyDisabled !== "boolean") + return "gpuZonalRedundancyDisabled: boolean expected"; + } + return null; + }; + + /** + * Creates a WorkerPoolRevisionTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate + */ + WorkerPoolRevisionTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.WorkerPoolRevisionTemplate) + return object; + var message = new $root.google.cloud.run.v2.WorkerPoolRevisionTemplate(); + if (object.revision != null) + message.revision = String(object.revision); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.vpcAccess != null) { + if (typeof object.vpcAccess !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.vpcAccess: object expected"); + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.containers: object expected"); + message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); + } + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.volumes: object expected"); + message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); + } + } + if (object.encryptionKey != null) + message.encryptionKey = String(object.encryptionKey); + if (object.serviceMesh != null) { + if (typeof object.serviceMesh !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.serviceMesh: object expected"); + message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.fromObject(object.serviceMesh); + } + switch (object.encryptionKeyRevocationAction) { + default: + if (typeof object.encryptionKeyRevocationAction === "number") { + message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; + break; + } + break; + case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": + case 0: + message.encryptionKeyRevocationAction = 0; + break; + case "PREVENT_NEW": + case 1: + message.encryptionKeyRevocationAction = 1; + break; + case "SHUTDOWN": + case 2: + message.encryptionKeyRevocationAction = 2; + break; + } + if (object.encryptionKeyShutdownDuration != null) { + if (typeof object.encryptionKeyShutdownDuration !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.encryptionKeyShutdownDuration: object expected"); + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); + } + if (object.nodeSelector != null) { + if (typeof object.nodeSelector !== "object") + throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.nodeSelector: object expected"); + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); + } + if (object.gpuZonalRedundancyDisabled != null) + message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); + return message; + }; + + /** + * Creates a plain object from a WorkerPoolRevisionTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @static + * @param {google.cloud.run.v2.WorkerPoolRevisionTemplate} message WorkerPoolRevisionTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerPoolRevisionTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.containers = []; + object.volumes = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.revision = ""; + object.vpcAccess = null; + object.serviceAccount = ""; + object.encryptionKey = ""; + object.serviceMesh = null; + object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; + object.encryptionKeyShutdownDuration = null; + object.nodeSelector = null; + } + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) + object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = message.encryptionKey; + if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) + object.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.toObject(message.serviceMesh, options); + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) + object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) + object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; + if (options.oneofs) + object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; + } + return object; + }; + + /** + * Converts this WorkerPoolRevisionTemplate to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @instance + * @returns {Object.} JSON object + */ + WorkerPoolRevisionTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkerPoolRevisionTemplate + * @function getTypeUrl + * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerPoolRevisionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.WorkerPoolRevisionTemplate"; + }; + + return WorkerPoolRevisionTemplate; + })(); + + return v2; + })(); + + return run; + })(); + + 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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.RoutingRule = (function() { + + /** + * Properties of a RoutingRule. + * @memberof google.api + * @interface IRoutingRule + * @property {Array.|null} [routingParameters] RoutingRule routingParameters + */ + + /** + * Constructs a new RoutingRule. + * @memberof google.api + * @classdesc Represents a RoutingRule. + * @implements IRoutingRule + * @constructor + * @param {google.api.IRoutingRule=} [properties] Properties to set + */ + function RoutingRule(properties) { + this.routingParameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingRule routingParameters. + * @member {Array.} routingParameters + * @memberof google.api.RoutingRule + * @instance + */ + RoutingRule.prototype.routingParameters = $util.emptyArray; + + /** + * Creates a new RoutingRule instance using the specified properties. + * @function create + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule=} [properties] Properties to set + * @returns {google.api.RoutingRule} RoutingRule instance + */ + RoutingRule.create = function create(properties) { + return new RoutingRule(properties); + }; + + /** + * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @function encode + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routingParameters != null && message.routingParameters.length) + for (var i = 0; i < message.routingParameters.length; ++i) + $root.google.api.RoutingParameter.encode(message.routingParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RoutingRule + * @static + * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.RoutingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RoutingRule} RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.routingParameters && message.routingParameters.length)) + message.routingParameters = []; + message.routingParameters.push($root.google.api.RoutingParameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RoutingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RoutingRule} RoutingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingRule message. + * @function verify + * @memberof google.api.RoutingRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { + if (!Array.isArray(message.routingParameters)) + return "routingParameters: array expected"; + for (var i = 0; i < message.routingParameters.length; ++i) { + var error = $root.google.api.RoutingParameter.verify(message.routingParameters[i]); + if (error) + return "routingParameters." + error; + } + } + return null; + }; + + /** + * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RoutingRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.RoutingRule} RoutingRule + */ + RoutingRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RoutingRule) + return object; + var message = new $root.google.api.RoutingRule(); + if (object.routingParameters) { + if (!Array.isArray(object.routingParameters)) + throw TypeError(".google.api.RoutingRule.routingParameters: array expected"); + message.routingParameters = []; + for (var i = 0; i < object.routingParameters.length; ++i) { + if (typeof object.routingParameters[i] !== "object") + throw TypeError(".google.api.RoutingRule.routingParameters: object expected"); + message.routingParameters[i] = $root.google.api.RoutingParameter.fromObject(object.routingParameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RoutingRule + * @static + * @param {google.api.RoutingRule} message RoutingRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.routingParameters = []; + if (message.routingParameters && message.routingParameters.length) { + object.routingParameters = []; + for (var j = 0; j < message.routingParameters.length; ++j) + object.routingParameters[j] = $root.google.api.RoutingParameter.toObject(message.routingParameters[j], options); + } + return object; + }; + + /** + * Converts this RoutingRule to JSON. + * @function toJSON + * @memberof google.api.RoutingRule + * @instance + * @returns {Object.} JSON object + */ + RoutingRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingRule + * @function getTypeUrl + * @memberof google.api.RoutingRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RoutingRule"; + }; + + return RoutingRule; + })(); + + api.RoutingParameter = (function() { + + /** + * Properties of a RoutingParameter. + * @memberof google.api + * @interface IRoutingParameter + * @property {string|null} [field] RoutingParameter field + * @property {string|null} [pathTemplate] RoutingParameter pathTemplate + */ + + /** + * Constructs a new RoutingParameter. + * @memberof google.api + * @classdesc Represents a RoutingParameter. + * @implements IRoutingParameter + * @constructor + * @param {google.api.IRoutingParameter=} [properties] Properties to set + */ + function RoutingParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingParameter field. + * @member {string} field + * @memberof google.api.RoutingParameter + * @instance + */ + RoutingParameter.prototype.field = ""; + + /** + * RoutingParameter pathTemplate. + * @member {string} pathTemplate + * @memberof google.api.RoutingParameter + * @instance + */ + RoutingParameter.prototype.pathTemplate = ""; + + /** + * Creates a new RoutingParameter instance using the specified properties. + * @function create + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter=} [properties] Properties to set + * @returns {google.api.RoutingParameter} RoutingParameter instance + */ + RoutingParameter.create = function create(properties) { + return new RoutingParameter(properties); + }; + + /** + * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @function encode + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pathTemplate); + return writer; + }; + + /** + * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer. + * @function decode + * @memberof google.api.RoutingParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RoutingParameter} RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.pathTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RoutingParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RoutingParameter} RoutingParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingParameter message. + * @function verify + * @memberof google.api.RoutingParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + if (!$util.isString(message.pathTemplate)) + return "pathTemplate: string expected"; + return null; + }; + + /** + * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RoutingParameter + * @static + * @param {Object.} object Plain object + * @returns {google.api.RoutingParameter} RoutingParameter + */ + RoutingParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RoutingParameter) + return object; + var message = new $root.google.api.RoutingParameter(); + if (object.field != null) + message.field = String(object.field); + if (object.pathTemplate != null) + message.pathTemplate = String(object.pathTemplate); + return message; + }; + + /** + * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RoutingParameter + * @static + * @param {google.api.RoutingParameter} message RoutingParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.pathTemplate = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + object.pathTemplate = message.pathTemplate; + return object; + }; + + /** + * Converts this RoutingParameter to JSON. + * @function toJSON + * @memberof google.api.RoutingParameter + * @instance + * @returns {Object.} JSON object + */ + RoutingParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingParameter + * @function getTypeUrl + * @memberof google.api.RoutingParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RoutingParameter"; + }; + + return RoutingParameter; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.api.IRoutingRule|null} [".google.api.routing"] MethodOptions .google.api.routing + * @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.api.routing. + * @member {google.api.IRoutingRule|null|undefined} .google.api.routing + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.routing"] = null; + + /** + * 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(); + if (message[".google.api.routing"] != null && Object.hasOwnProperty.call(message, ".google.api.routing")) + $root.google.api.RoutingRule.encode(message[".google.api.routing"], writer.uint32(/* id 72295729, wireType 2 =*/578365834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 72295729: { + message[".google.api.routing"] = $root.google.api.RoutingRule.decode(reader, reader.uint32()); + 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.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { + var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"]); + if (error) + return ".google.api.routing." + error; + } + 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.api.routing"] != null) { + if (typeof object[".google.api.routing"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.routing: object expected"); + message[".google.api.routing"] = $root.google.api.RoutingRule.fromObject(object[".google.api.routing"]); + } + 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; + object[".google.api.routing"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) + object[".google.api.routing"] = $root.google.api.RoutingRule.toObject(message[".google.api.routing"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.IAMPolicy = (function() { + + /** + * Constructs a new IAMPolicy service. + * @memberof google.iam.v1 + * @classdesc Represents a IAMPolicy + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; + + /** + * Creates new IAMPolicy service using the specified rpc implementation. + * @function create + * @memberof google.iam.v1.IAMPolicy + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. + */ + IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. + * @memberof google.iam.v1.IAMPolicy + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. + * @memberof google.iam.v1.IAMPolicy + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.iam.v1.IAMPolicy + * @instance + * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return IAMPolicy; + })(); + + v1.SetIamPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface ISetIamPolicyRequest + * @property {string|null} [resource] SetIamPolicyRequest resource + * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy + * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask + */ + + /** + * Constructs a new SetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a SetIamPolicyRequest. + * @implements ISetIamPolicyRequest + * @constructor + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.resource = ""; + + /** + * SetIamPolicyRequest policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.policy = null; + + /** + * SetIamPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + */ + SetIamPolicyRequest.prototype.updateMask = null; + + /** + * Creates a new SetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance + */ + SetIamPolicyRequest.create = function create(properties) { + return new SetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest + */ + SetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.SetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.policy = null; + object.updateMask = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.SetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.SetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; + }; + + return SetIamPolicyRequest; + })(); + + v1.GetIamPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyRequest. + * @memberof google.iam.v1 + * @interface IGetIamPolicyRequest + * @property {string|null} [resource] GetIamPolicyRequest resource + * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options + */ + + /** + * Constructs a new GetIamPolicyRequest. + * @memberof google.iam.v1 + * @classdesc Represents a GetIamPolicyRequest. + * @implements IGetIamPolicyRequest + * @constructor + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyRequest resource. + * @member {string} resource + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.resource = ""; + + /** + * GetIamPolicyRequest options. + * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + */ + GetIamPolicyRequest.prototype.options = null; + + /** + * Creates a new GetIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance + */ + GetIamPolicyRequest.create = function create(properties) { + return new GetIamPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRequest message. + * @function verify + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest + */ + GetIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) + return object; + var message = new $root.google.iam.v1.GetIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); + message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.options = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this GetIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.GetIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetIamPolicyRequest + * @function getTypeUrl + * @memberof google.iam.v1.GetIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; + }; + + return GetIamPolicyRequest; + })(); + + v1.TestIamPermissionsRequest = (function() { + + /** + * Properties of a TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsRequest + * @property {string|null} [resource] TestIamPermissionsRequest resource + * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions + */ + + /** + * Constructs a new TestIamPermissionsRequest. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsRequest. + * @implements ITestIamPermissionsRequest + * @constructor + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + */ + function TestIamPermissionsRequest(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRequest resource. + * @member {string} resource + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + */ + TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance + */ + TestIamPermissionsRequest.create = function create(properties) { + return new TestIamPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRequest message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest + */ + TestIamPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsRequest to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsRequest + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; + }; + + return TestIamPermissionsRequest; + })(); + + v1.TestIamPermissionsResponse = (function() { + + /** + * Properties of a TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @interface ITestIamPermissionsResponse + * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions + */ + + /** + * Constructs a new TestIamPermissionsResponse. + * @memberof google.iam.v1 + * @classdesc Represents a TestIamPermissionsResponse. + * @implements ITestIamPermissionsResponse + * @constructor + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + */ + function TestIamPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + */ + TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestIamPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance + */ + TestIamPermissionsResponse.create = function create(properties) { + return new TestIamPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResponse message. + * @function verify + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) + if (!$util.isString(message.permissions[i])) + return "permissions: string[] expected"; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse + */ + TestIamPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) + return object; + var message = new $root.google.iam.v1.TestIamPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) + message.permissions[i] = String(object.permissions[i]); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + return object; + }; + + /** + * Converts this TestIamPermissionsResponse to JSON. + * @function toJSON + * @memberof google.iam.v1.TestIamPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TestIamPermissionsResponse + * @function getTypeUrl + * @memberof google.iam.v1.TestIamPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; + }; + + return TestIamPermissionsResponse; + })(); + + v1.GetPolicyOptions = (function() { + + /** + * Properties of a GetPolicyOptions. + * @memberof google.iam.v1 + * @interface IGetPolicyOptions + * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion + */ + + /** + * Constructs a new GetPolicyOptions. + * @memberof google.iam.v1 + * @classdesc Represents a GetPolicyOptions. + * @implements IGetPolicyOptions + * @constructor + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + */ + function GetPolicyOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPolicyOptions requestedPolicyVersion. + * @member {number} requestedPolicyVersion + * @memberof google.iam.v1.GetPolicyOptions + * @instance + */ + GetPolicyOptions.prototype.requestedPolicyVersion = 0; + + /** + * Creates a new GetPolicyOptions instance using the specified properties. + * @function create + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance + */ + GetPolicyOptions.create = function create(properties) { + return new GetPolicyOptions(properties); + }; + + /** + * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestedPolicyVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyOptions message. + * @function verify + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (!$util.isInteger(message.requestedPolicyVersion)) + return "requestedPolicyVersion: integer expected"; + return null; + }; + + /** + * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions + */ + GetPolicyOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.GetPolicyOptions) + return object; + var message = new $root.google.iam.v1.GetPolicyOptions(); + if (object.requestedPolicyVersion != null) + message.requestedPolicyVersion = object.requestedPolicyVersion | 0; + return message; + }; + + /** + * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.requestedPolicyVersion = 0; + if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + object.requestedPolicyVersion = message.requestedPolicyVersion; + return object; + }; + + /** + * Converts this GetPolicyOptions to JSON. + * @function toJSON + * @memberof google.iam.v1.GetPolicyOptions + * @instance + * @returns {Object.} JSON object + */ + GetPolicyOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyOptions + * @function getTypeUrl + * @memberof google.iam.v1.GetPolicyOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; + }; + + return GetPolicyOptions; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-run/protos/protos.json b/owl-bot-staging/google-cloud-run/protos/protos.json new file mode 100644 index 00000000000..cdebe0a282b --- /dev/null +++ b/owl-bot-staging/google-cloud-run/protos/protos.json @@ -0,0 +1,7802 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "run": { + "nested": { + "v2": { + "options": { + "go_package": "cloud.google.com/go/run/apiv2/runpb;runpb", + "java_multiple_files": true, + "java_outer_classname": "WorkerPoolRevisionTemplateProto", + "java_package": "com.google.cloud.run.v2", + "(google.api.resource_definition).type": "cloudbuild.googleapis.com/Build", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/builds/{build}" + }, + "nested": { + "Builds": { + "options": { + "(google.api.default_host)": "run.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "SubmitBuild": { + "requestType": "SubmitBuildRequest", + "responseType": "SubmitBuildResponse", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/builds:submit", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*}/builds:submit", + "body": "*" + } + } + ] + } + } + }, + "SubmitBuildRequest": { + "oneofs": { + "source": { + "oneof": [ + "storageSource" + ] + }, + "buildType": { + "oneof": [ + "buildpackBuild", + "dockerBuild" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "storageSource": { + "type": "StorageSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "imageUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "buildpackBuild": { + "type": "BuildpacksBuild", + "id": 4 + }, + "dockerBuild": { + "type": "DockerBuild", + "id": 5 + }, + "serviceAccount": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "workerPool": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/BuildWorkerPool" + } + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "machineType": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "releaseTrack": { + "type": "google.api.LaunchStage", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "client": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "DockerBuild": { + "fields": {} + }, + "BuildpacksBuild": { + "fields": { + "runtime": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "functionTarget": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cacheImageUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "baseImage": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environmentVariables": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableAutomaticUpdates": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "projectDescriptor": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "SubmitBuildResponse": { + "fields": { + "buildOperation": { + "type": "google.longrunning.Operation", + "id": 1 + }, + "baseImageUri": { + "type": "string", + "id": 2 + }, + "baseImageWarning": { + "type": "string", + "id": 3 + } + } + }, + "StorageSource": { + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Condition": { + "oneofs": { + "reasons": { + "oneof": [ + "reason", + "revisionReason", + "executionReason" + ] + } + }, + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2 + }, + "message": { + "type": "string", + "id": 3 + }, + "lastTransitionTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "severity": { + "type": "Severity", + "id": 5 + }, + "reason": { + "type": "CommonReason", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionReason": { + "type": "RevisionReason", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionReason": { + "type": "ExecutionReason", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CONDITION_PENDING": 1, + "CONDITION_RECONCILING": 2, + "CONDITION_FAILED": 3, + "CONDITION_SUCCEEDED": 4 + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "ERROR": 1, + "WARNING": 2, + "INFO": 3 + } + }, + "CommonReason": { + "values": { + "COMMON_REASON_UNDEFINED": 0, + "UNKNOWN": 1, + "REVISION_FAILED": 3, + "PROGRESS_DEADLINE_EXCEEDED": 4, + "CONTAINER_MISSING": 6, + "CONTAINER_PERMISSION_DENIED": 7, + "CONTAINER_IMAGE_UNAUTHORIZED": 8, + "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED": 9, + "ENCRYPTION_KEY_PERMISSION_DENIED": 10, + "ENCRYPTION_KEY_CHECK_FAILED": 11, + "SECRETS_ACCESS_CHECK_FAILED": 12, + "WAITING_FOR_OPERATION": 13, + "IMMEDIATE_RETRY": 14, + "POSTPONED_RETRY": 15, + "INTERNAL": 16, + "VPC_NETWORK_NOT_FOUND": 17 + } + }, + "RevisionReason": { + "values": { + "REVISION_REASON_UNDEFINED": 0, + "PENDING": 1, + "RESERVE": 2, + "RETIRED": 3, + "RETIRING": 4, + "RECREATING": 5, + "HEALTH_CHECK_CONTAINER_ERROR": 6, + "CUSTOMIZED_PATH_RESPONSE_PENDING": 7, + "MIN_INSTANCES_NOT_PROVISIONED": 8, + "ACTIVE_REVISION_LIMIT_REACHED": 9, + "NO_DEPLOYMENT": 10, + "HEALTH_CHECK_SKIPPED": 11, + "MIN_INSTANCES_WARMING": 12 + } + }, + "ExecutionReason": { + "values": { + "EXECUTION_REASON_UNDEFINED": 0, + "JOB_STATUS_SERVICE_POLLING_ERROR": 1, + "NON_ZERO_EXIT_CODE": 2, + "CANCELLED": 3, + "CANCELLING": 4, + "DELETED": 5, + "DELAYED_START_PENDING": 6 + } + } + } + }, + "ContainerStatus": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "imageDigest": { + "type": "string", + "id": 2 + } + } + }, + "Executions": { + "options": { + "(google.api.default_host)": "run.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetExecution": { + "requestType": "GetExecutionRequest", + "responseType": "Execution", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListExecutions": { + "requestType": "ListExecutionsRequest", + "responseType": "ListExecutionsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*/jobs/*}/executions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*/jobs/*}/executions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteExecution": { + "requestType": "DeleteExecutionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Execution", + "(google.longrunning.operation_info).metadata_type": "Execution" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Execution", + "metadata_type": "Execution" + } + } + ] + }, + "CancelExecution": { + "requestType": "CancelExecutionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Execution", + "(google.longrunning.operation_info).metadata_type": "Execution" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Execution", + "metadata_type": "Execution" + } + } + ] + } + } + }, + "GetExecutionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Execution" + } + } + } + }, + "ListExecutionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Execution" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "showDeleted": { + "type": "bool", + "id": 4 + } + } + }, + "ListExecutionsResponse": { + "fields": { + "executions": { + "rule": "repeated", + "type": "Execution", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteExecutionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Execution" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "CancelExecutionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Execution" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "Execution": { + "options": { + "(google.api.resource).type": "run.googleapis.com/Execution", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "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" + } + }, + "creator": { + "type": "string", + "id": 32, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completionTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "launchStage": { + "type": "google.api.LaunchStage", + "id": 11 + }, + "job": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "run.googleapis.com/Job" + } + }, + "parallelism": { + "type": "int32", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "taskCount": { + "type": "int32", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "template": { + "type": "TaskTemplate", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedGeneration": { + "type": "int64", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "runningCount": { + "type": "int32", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "succeededCount": { + "type": "int32", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failedCount": { + "type": "int32", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cancelledCount": { + "type": "int32", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "retriedCount": { + "type": "int32", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logUri": { + "type": "string", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 27, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 99, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TaskTemplate": { + "oneofs": { + "retries": { + "oneof": [ + "maxRetries" + ] + }, + "_gpuZonalRedundancyDisabled": { + "oneof": [ + "gpuZonalRedundancyDisabled" + ] + } + }, + "fields": { + "containers": { + "rule": "repeated", + "type": "Container", + "id": 1 + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxRetries": { + "type": "int32", + "id": 3 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "executionEnvironment": { + "type": "ExecutionEnvironment", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionKey": { + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "vpcAccess": { + "type": "VpcAccess", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeSelector": { + "type": "NodeSelector", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gpuZonalRedundancyDisabled": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Container": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "image": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceCode": { + "type": "SourceCode", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "command": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "env": { + "rule": "repeated", + "type": "EnvVar", + "id": 5 + }, + "resources": { + "type": "ResourceRequirements", + "id": 6 + }, + "ports": { + "rule": "repeated", + "type": "ContainerPort", + "id": 7 + }, + "volumeMounts": { + "rule": "repeated", + "type": "VolumeMount", + "id": 8 + }, + "workingDir": { + "type": "string", + "id": 9 + }, + "livenessProbe": { + "type": "Probe", + "id": 10 + }, + "startupProbe": { + "type": "Probe", + "id": 11 + }, + "readinessProbe": { + "type": "Probe", + "id": 14 + }, + "dependsOn": { + "rule": "repeated", + "type": "string", + "id": 12 + }, + "baseImageUri": { + "type": "string", + "id": 13 + }, + "buildInfo": { + "type": "BuildInfo", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ResourceRequirements": { + "fields": { + "limits": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "cpuIdle": { + "type": "bool", + "id": 2 + }, + "startupCpuBoost": { + "type": "bool", + "id": 3 + } + } + }, + "EnvVar": { + "oneofs": { + "values": { + "oneof": [ + "value", + "valueSource" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "value": { + "type": "string", + "id": 2 + }, + "valueSource": { + "type": "EnvVarSource", + "id": 3 + } + } + }, + "EnvVarSource": { + "fields": { + "secretKeyRef": { + "type": "SecretKeySelector", + "id": 1 + } + } + }, + "SecretKeySelector": { + "fields": { + "secret": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/Secret" + } + }, + "version": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + }, + "ContainerPort": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "containerPort": { + "type": "int32", + "id": 3 + } + } + }, + "VolumeMount": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mountPath": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subPath": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Volume": { + "oneofs": { + "volumeType": { + "oneof": [ + "secret", + "cloudSqlInstance", + "emptyDir", + "nfs", + "gcs" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "secret": { + "type": "SecretVolumeSource", + "id": 2 + }, + "cloudSqlInstance": { + "type": "CloudSqlInstance", + "id": 3 + }, + "emptyDir": { + "type": "EmptyDirVolumeSource", + "id": 4 + }, + "nfs": { + "type": "NFSVolumeSource", + "id": 5 + }, + "gcs": { + "type": "GCSVolumeSource", + "id": 6 + } + } + }, + "SecretVolumeSource": { + "fields": { + "secret": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "items": { + "rule": "repeated", + "type": "VersionToPath", + "id": 2 + }, + "defaultMode": { + "type": "int32", + "id": 3 + } + } + }, + "VersionToPath": { + "fields": { + "path": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "version": { + "type": "string", + "id": 2 + }, + "mode": { + "type": "int32", + "id": 3 + } + } + }, + "CloudSqlInstance": { + "fields": { + "instances": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "EmptyDirVolumeSource": { + "fields": { + "medium": { + "type": "Medium", + "id": 1 + }, + "sizeLimit": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Medium": { + "values": { + "MEDIUM_UNSPECIFIED": 0, + "MEMORY": 1 + } + } + } + }, + "NFSVolumeSource": { + "fields": { + "server": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + }, + "readOnly": { + "type": "bool", + "id": 3 + } + } + }, + "GCSVolumeSource": { + "fields": { + "bucket": { + "type": "string", + "id": 1 + }, + "readOnly": { + "type": "bool", + "id": 2 + }, + "mountOptions": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "Probe": { + "oneofs": { + "probeType": { + "oneof": [ + "httpGet", + "tcpSocket", + "grpc" + ] + } + }, + "fields": { + "initialDelaySeconds": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeoutSeconds": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "periodSeconds": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "failureThreshold": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "httpGet": { + "type": "HTTPGetAction", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tcpSocket": { + "type": "TCPSocketAction", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "grpc": { + "type": "GRPCAction", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "HTTPGetAction": { + "fields": { + "path": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "httpHeaders": { + "rule": "repeated", + "type": "HTTPHeader", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "port": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "HTTPHeader": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "value": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TCPSocketAction": { + "fields": { + "port": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GRPCAction": { + "fields": { + "port": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "service": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BuildInfo": { + "fields": { + "functionTarget": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceLocation": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SourceCode": { + "oneofs": { + "sourceType": { + "oneof": [ + "cloudStorageSource" + ] + } + }, + "fields": { + "cloudStorageSource": { + "type": "CloudStorageSource", + "id": 1 + } + }, + "nested": { + "CloudStorageSource": { + "fields": { + "bucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "object": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "VpcAccess": { + "fields": { + "connector": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "vpcaccess.googleapis.com/Connector" + } + }, + "egress": { + "type": "VpcEgress", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "VpcEgress": { + "values": { + "VPC_EGRESS_UNSPECIFIED": 0, + "ALL_TRAFFIC": 1, + "PRIVATE_RANGES_ONLY": 2 + } + }, + "NetworkInterface": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subnetwork": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "BinaryAuthorization": { + "oneofs": { + "binauthzMethod": { + "oneof": [ + "useDefault", + "policy" + ] + } + }, + "fields": { + "useDefault": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "policy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "binaryauthorization.googleapis.com/Policy" + } + }, + "breakglassJustification": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RevisionScaling": { + "fields": { + "minInstanceCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxInstanceCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ServiceMesh": { + "fields": { + "mesh": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "networkservices.googleapis.com/Mesh" + } + } + } + }, + "ServiceScaling": { + "oneofs": { + "_manualInstanceCount": { + "oneof": [ + "manualInstanceCount" + ] + } + }, + "fields": { + "minInstanceCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scalingMode": { + "type": "ScalingMode", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxInstanceCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "manualInstanceCount": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "ScalingMode": { + "values": { + "SCALING_MODE_UNSPECIFIED": 0, + "AUTOMATIC": 1, + "MANUAL": 2 + } + } + } + }, + "WorkerPoolScaling": { + "oneofs": { + "_manualInstanceCount": { + "oneof": [ + "manualInstanceCount" + ] + } + }, + "fields": { + "manualInstanceCount": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "NodeSelector": { + "fields": { + "accelerator": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BuildConfig": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "sourceLocation": { + "type": "string", + "id": 2 + }, + "functionTarget": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "imageUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "baseImage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableAutomaticUpdates": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "workerPool": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/BuildWorkerPool" + } + }, + "environmentVariables": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "IngressTraffic": { + "values": { + "INGRESS_TRAFFIC_UNSPECIFIED": 0, + "INGRESS_TRAFFIC_ALL": 1, + "INGRESS_TRAFFIC_INTERNAL_ONLY": 2, + "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": 3, + "INGRESS_TRAFFIC_NONE": 4 + } + }, + "ExecutionEnvironment": { + "values": { + "EXECUTION_ENVIRONMENT_UNSPECIFIED": 0, + "EXECUTION_ENVIRONMENT_GEN1": 1, + "EXECUTION_ENVIRONMENT_GEN2": 2 + } + }, + "EncryptionKeyRevocationAction": { + "values": { + "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": 0, + "PREVENT_NEW": 1, + "SHUTDOWN": 2 + } + }, + "ExecutionTemplate": { + "fields": { + "labels": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "parallelism": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "taskCount": { + "type": "int32", + "id": 4 + }, + "template": { + "type": "TaskTemplate", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Instances": { + "options": { + "(google.api.default_host)": "run.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "instance", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent,instance", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*}/instances", + "body": "instance" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent,instance" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/instances/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/instances/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/instances", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*}/instances" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "StopInstance": { + "requestType": "StopInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/instances/*}:stop", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/instances/*}:stop", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + }, + "StartInstance": { + "requestType": "StartInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/instances/*}:start", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/instances/*}:start", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Instance" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "showDeleted": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "StopInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StartInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "run.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance" + }, + "oneofs": { + "_gpuZonalRedundancyDisabled": { + "oneof": [ + "gpuZonalRedundancyDisabled" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 3 + }, + "uid": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "generation": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModifier": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "client": { + "type": "string", + "id": 14 + }, + "clientVersion": { + "type": "string", + "id": 15 + }, + "launchStage": { + "type": "google.api.LaunchStage", + "id": 16 + }, + "binaryAuthorization": { + "type": "BinaryAuthorization", + "id": 17 + }, + "vpcAccess": { + "type": "VpcAccess", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 19 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 20, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 21 + }, + "encryptionKey": { + "type": "string", + "id": 22, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "encryptionKeyRevocationAction": { + "type": "EncryptionKeyRevocationAction", + "id": 24 + }, + "encryptionKeyShutdownDuration": { + "type": "google.protobuf.Duration", + "id": 25 + }, + "nodeSelector": { + "type": "NodeSelector", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gpuZonalRedundancyDisabled": { + "type": "bool", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ingress": { + "type": "IngressTraffic", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "invokerIamDisabled": { + "type": "bool", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "iapEnabled": { + "type": "bool", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "observedGeneration": { + "type": "int64", + "id": 40, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logUri": { + "type": "string", + "id": 41, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "terminalCondition": { + "type": "Condition", + "id": 42, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 43, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "containerStatuses": { + "rule": "repeated", + "type": "ContainerStatus", + "id": 44, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 46, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "urls": { + "rule": "repeated", + "type": "string", + "id": 45, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 98, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 99, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstanceSplit": { + "fields": { + "type": { + "type": "InstanceSplitAllocationType", + "id": 1 + }, + "revision": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "percent": { + "type": "int32", + "id": 3 + } + } + }, + "InstanceSplitStatus": { + "fields": { + "type": { + "type": "InstanceSplitAllocationType", + "id": 1 + }, + "revision": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "percent": { + "type": "int32", + "id": 3 + } + } + }, + "InstanceSplitAllocationType": { + "values": { + "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED": 0, + "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST": 1, + "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION": 2 + } + }, + "Jobs": { + "options": { + "(google.api.default_host)": "run.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateJob": { + "requestType": "CreateJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/jobs", + "(google.api.http).body": "job", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent,job,job_id", + "(google.longrunning.operation_info).response_type": "Job", + "(google.longrunning.operation_info).metadata_type": "Job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*}/jobs", + "body": "job" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent,job,job_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Job", + "metadata_type": "Job" + } + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/jobs/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/jobs", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*}/jobs" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateJob": { + "requestType": "UpdateJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{job.name=projects/*/locations/*/jobs/*}", + "(google.api.http).body": "job", + "(google.api.routing).routing_parameters.field": "job.name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "job", + "(google.longrunning.operation_info).response_type": "Job", + "(google.longrunning.operation_info).metadata_type": "Job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{job.name=projects/*/locations/*/jobs/*}", + "body": "job" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "job.name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "job" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Job", + "metadata_type": "Job" + } + } + ] + }, + "DeleteJob": { + "requestType": "DeleteJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/jobs/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Job", + "(google.longrunning.operation_info).metadata_type": "Job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Job", + "metadata_type": "Job" + } + } + ] + }, + "RunJob": { + "requestType": "RunJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/jobs/*}:run", + "(google.api.http).body": "*", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Execution", + "(google.longrunning.operation_info).metadata_type": "Execution" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/jobs/*}:run", + "body": "*" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Execution", + "metadata_type": "Execution" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).get": "/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy" + } + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "CreateJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Job" + } + }, + "job": { + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "GetJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Job" + } + } + } + }, + "UpdateJobRequest": { + "fields": { + "job": { + "type": "Job", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Job" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "showDeleted": { + "type": "bool", + "id": 4 + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Job" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + }, + "etag": { + "type": "string", + "id": 4 + } + } + }, + "RunJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Job" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + }, + "overrides": { + "type": "Overrides", + "id": 4 + } + }, + "nested": { + "Overrides": { + "fields": { + "containerOverrides": { + "rule": "repeated", + "type": "ContainerOverride", + "id": 1 + }, + "taskCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + }, + "nested": { + "ContainerOverride": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "env": { + "rule": "repeated", + "type": "EnvVar", + "id": 3 + }, + "clearArgs": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "Job": { + "options": { + "(google.api.resource).type": "run.googleapis.com/Job", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "createExecution": { + "oneof": [ + "startExecutionToken", + "runExecutionToken" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModifier": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "client": { + "type": "string", + "id": 12 + }, + "clientVersion": { + "type": "string", + "id": 13 + }, + "launchStage": { + "type": "google.api.LaunchStage", + "id": 14 + }, + "binaryAuthorization": { + "type": "BinaryAuthorization", + "id": 15 + }, + "template": { + "type": "ExecutionTemplate", + "id": 16, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "observedGeneration": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "terminalCondition": { + "type": "Condition", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "executionCount": { + "type": "int32", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latestCreatedExecution": { + "type": "ExecutionReference", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startExecutionToken": { + "type": "string", + "id": 26 + }, + "runExecutionToken": { + "type": "string", + "id": 27 + }, + "etag": { + "type": "string", + "id": 99, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecutionReference": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "run.googleapis.com/Execution" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "completionTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "completionStatus": { + "type": "CompletionStatus", + "id": 4 + } + }, + "nested": { + "CompletionStatus": { + "values": { + "COMPLETION_STATUS_UNSPECIFIED": 0, + "EXECUTION_SUCCEEDED": 1, + "EXECUTION_FAILED": 2, + "EXECUTION_RUNNING": 3, + "EXECUTION_PENDING": 4, + "EXECUTION_CANCELLED": 5 + } + } + } + }, + "Revisions": { + "options": { + "(google.api.default_host)": "run.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetRevision": { + "requestType": "GetRevisionRequest", + "responseType": "Revision", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", + "additional_bindings": { + "get": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListRevisions": { + "requestType": "ListRevisionsRequest", + "responseType": "ListRevisionsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*/services/*}/revisions", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*/workerPools/*}/revisions", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*/services/*}/revisions", + "additional_bindings": { + "get": "/v2/{parent=projects/*/locations/*/workerPools/*}/revisions" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteRevision": { + "requestType": "DeleteRevisionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Revision", + "(google.longrunning.operation_info).metadata_type": "Revision" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", + "additional_bindings": { + "delete": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" + } + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Revision", + "metadata_type": "Revision" + } + } + ] + } + } + }, + "GetRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + } + } + }, + "ListRevisionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Revision" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "showDeleted": { + "type": "bool", + "id": 4 + } + } + }, + "ListRevisionsResponse": { + "fields": { + "revisions": { + "rule": "repeated", + "type": "Revision", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "Revision": { + "options": { + "(google.api.resource).type": "run.googleapis.com/Revision", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/services/{service}/revisions/{revision}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "_gpuZonalRedundancyDisabled": { + "oneof": [ + "gpuZonalRedundancyDisabled" + ] + } + }, + "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" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "launchStage": { + "type": "google.api.LaunchStage", + "id": 10 + }, + "service": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "run.googleapis.com/Service" + } + }, + "scaling": { + "type": "RevisionScaling", + "id": 12 + }, + "vpcAccess": { + "type": "VpcAccess", + "id": 13 + }, + "maxInstanceRequestConcurrency": { + "type": "int32", + "id": 34 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 15 + }, + "serviceAccount": { + "type": "string", + "id": 16 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 17 + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 18 + }, + "executionEnvironment": { + "type": "ExecutionEnvironment", + "id": 20 + }, + "encryptionKey": { + "type": "string", + "id": 21, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "serviceMesh": { + "type": "ServiceMesh", + "id": 22 + }, + "encryptionKeyRevocationAction": { + "type": "EncryptionKeyRevocationAction", + "id": 23 + }, + "encryptionKeyShutdownDuration": { + "type": "google.protobuf.Duration", + "id": 24 + }, + "reconciling": { + "type": "bool", + "id": 30, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 31, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedGeneration": { + "type": "int64", + "id": 32, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logUri": { + "type": "string", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 37, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sessionAffinity": { + "type": "bool", + "id": 38 + }, + "scalingStatus": { + "type": "RevisionScalingStatus", + "id": 39, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodeSelector": { + "type": "NodeSelector", + "id": 40 + }, + "gpuZonalRedundancyDisabled": { + "type": "bool", + "id": 48, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "creator": { + "type": "string", + "id": 49, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 99, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RevisionScalingStatus": { + "fields": { + "desiredMinInstanceCount": { + "type": "int32", + "id": 1 + } + } + }, + "RevisionTemplate": { + "oneofs": { + "_gpuZonalRedundancyDisabled": { + "oneof": [ + "gpuZonalRedundancyDisabled" + ] + } + }, + "fields": { + "revision": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scaling": { + "type": "RevisionScaling", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "vpcAccess": { + "type": "VpcAccess", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 10 + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "executionEnvironment": { + "type": "ExecutionEnvironment", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionKey": { + "type": "string", + "id": 14, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "maxInstanceRequestConcurrency": { + "type": "int32", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceMesh": { + "type": "ServiceMesh", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionKeyRevocationAction": { + "type": "EncryptionKeyRevocationAction", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionKeyShutdownDuration": { + "type": "google.protobuf.Duration", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sessionAffinity": { + "type": "bool", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "healthCheckDisabled": { + "type": "bool", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeSelector": { + "type": "NodeSelector", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gpuZonalRedundancyDisabled": { + "type": "bool", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Services": { + "options": { + "(google.api.default_host)": "run.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateService": { + "requestType": "CreateServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/services", + "(google.api.http).body": "service", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent,service,service_id", + "(google.longrunning.operation_info).response_type": "Service", + "(google.longrunning.operation_info).metadata_type": "Service" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*}/services", + "body": "service" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent,service,service_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Service", + "metadata_type": "Service" + } + } + ] + }, + "GetService": { + "requestType": "GetServiceRequest", + "responseType": "Service", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/services/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/services/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListServices": { + "requestType": "ListServicesRequest", + "responseType": "ListServicesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/services", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*}/services" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateService": { + "requestType": "UpdateServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{service.name=projects/*/locations/*/services/*}", + "(google.api.http).body": "service", + "(google.api.routing).routing_parameters.field": "service.name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "service,update_mask", + "(google.longrunning.operation_info).response_type": "Service", + "(google.longrunning.operation_info).metadata_type": "Service" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{service.name=projects/*/locations/*/services/*}", + "body": "service" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "service.name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "service" + }, + { + "(google.api.method_signature)": "service,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Service", + "metadata_type": "Service" + } + } + ] + }, + "DeleteService": { + "requestType": "DeleteServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/services/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Service", + "(google.longrunning.operation_info).metadata_type": "Service" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/services/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Service", + "metadata_type": "Service" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).get": "/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy" + } + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "CreateServiceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Service" + } + }, + "service": { + "type": "Service", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "serviceId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "UpdateServiceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "service": { + "type": "Service", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListServicesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Service" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "showDeleted": { + "type": "bool", + "id": 4 + } + } + }, + "ListServicesResponse": { + "fields": { + "services": { + "rule": "repeated", + "type": "Service", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Service" + } + } + } + }, + "DeleteServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Service" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "Service": { + "options": { + "(google.api.resource).type": "run.googleapis.com/Service", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/services/{service}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "generation": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModifier": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "client": { + "type": "string", + "id": 13 + }, + "clientVersion": { + "type": "string", + "id": 14 + }, + "ingress": { + "type": "IngressTraffic", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "launchStage": { + "type": "google.api.LaunchStage", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "binaryAuthorization": { + "type": "BinaryAuthorization", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "template": { + "type": "RevisionTemplate", + "id": 18, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "traffic": { + "rule": "repeated", + "type": "TrafficTarget", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scaling": { + "type": "ServiceScaling", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "invokerIamDisabled": { + "type": "bool", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultUriDisabled": { + "type": "bool", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "urls": { + "rule": "repeated", + "type": "string", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "iapEnabled": { + "type": "bool", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "multiRegionSettings": { + "type": "MultiRegionSettings", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customAudiences": { + "rule": "repeated", + "type": "string", + "id": 37 + }, + "observedGeneration": { + "type": "int64", + "id": 30, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "terminalCondition": { + "type": "Condition", + "id": 31, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 32, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latestReadyRevision": { + "type": "string", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "latestCreatedRevision": { + "type": "string", + "id": 34, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "trafficStatuses": { + "rule": "repeated", + "type": "TrafficTargetStatus", + "id": 35, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uri": { + "type": "string", + "id": 36, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 38, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "threatDetectionEnabled": { + "type": "bool", + "id": 40, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "buildConfig": { + "type": "BuildConfig", + "id": 41, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "reconciling": { + "type": "bool", + "id": 98, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 99, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "MultiRegionSettings": { + "fields": { + "regions": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "multiRegionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "TrafficTarget": { + "fields": { + "type": { + "type": "TrafficTargetAllocationType", + "id": 1 + }, + "revision": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "percent": { + "type": "int32", + "id": 3 + }, + "tag": { + "type": "string", + "id": 4 + } + } + }, + "TrafficTargetStatus": { + "fields": { + "type": { + "type": "TrafficTargetAllocationType", + "id": 1 + }, + "revision": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "percent": { + "type": "int32", + "id": 3 + }, + "tag": { + "type": "string", + "id": 4 + }, + "uri": { + "type": "string", + "id": 5 + } + } + }, + "TrafficTargetAllocationType": { + "values": { + "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED": 0, + "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST": 1, + "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION": 2 + } + }, + "Tasks": { + "options": { + "(google.api.default_host)": "run.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetTask": { + "requestType": "GetTaskRequest", + "responseType": "Task", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTasks": { + "requestType": "ListTasksRequest", + "responseType": "ListTasksResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "GetTaskRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Task" + } + } + } + }, + "ListTasksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Task" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "showDeleted": { + "type": "bool", + "id": 4 + } + } + }, + "ListTasksResponse": { + "fields": { + "tasks": { + "rule": "repeated", + "type": "Task", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Task": { + "options": { + "(google.api.resource).type": "run.googleapis.com/Task", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "_gpuZonalRedundancyDisabled": { + "oneof": [ + "gpuZonalRedundancyDisabled" + ] + } + }, + "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" + } + }, + "generation": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "scheduledTime": { + "type": "google.protobuf.Timestamp", + "id": 34, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 27, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completionTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "job": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "run.googleapis.com/Job" + } + }, + "execution": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "run.googleapis.com/Execution" + } + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 14 + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 15 + }, + "maxRetries": { + "type": "int32", + "id": 16 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 17 + }, + "serviceAccount": { + "type": "string", + "id": 18 + }, + "executionEnvironment": { + "type": "ExecutionEnvironment", + "id": 20 + }, + "reconciling": { + "type": "bool", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "observedGeneration": { + "type": "int64", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "index": { + "type": "int32", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "retried": { + "type": "int32", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastAttemptResult": { + "type": "TaskAttemptResult", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "encryptionKey": { + "type": "string", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "vpcAccess": { + "type": "VpcAccess", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logUri": { + "type": "string", + "id": 32, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodeSelector": { + "type": "NodeSelector", + "id": 36, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gpuZonalRedundancyDisabled": { + "type": "bool", + "id": 37, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "etag": { + "type": "string", + "id": 99, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TaskAttemptResult": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "exitCode": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "termSignal": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WorkerPools": { + "options": { + "(google.api.default_host)": "run.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateWorkerPool": { + "requestType": "CreateWorkerPoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/workerPools", + "(google.api.http).body": "worker_pool", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent,worker_pool,worker_pool_id", + "(google.longrunning.operation_info).response_type": "WorkerPool", + "(google.longrunning.operation_info).metadata_type": "WorkerPool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*}/workerPools", + "body": "worker_pool" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent,worker_pool,worker_pool_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkerPool", + "metadata_type": "WorkerPool" + } + } + ] + }, + "GetWorkerPool": { + "requestType": "GetWorkerPoolRequest", + "responseType": "WorkerPool", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/workerPools/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/workerPools/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListWorkerPools": { + "requestType": "ListWorkerPoolsRequest", + "responseType": "ListWorkerPoolsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/workerPools", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*}/workerPools" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateWorkerPool": { + "requestType": "UpdateWorkerPoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{worker_pool.name=projects/*/locations/*/workerPools/*}", + "(google.api.http).body": "worker_pool", + "(google.api.routing).routing_parameters.field": "worker_pool.name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "worker_pool,update_mask", + "(google.longrunning.operation_info).response_type": "WorkerPool", + "(google.longrunning.operation_info).metadata_type": "WorkerPool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{worker_pool.name=projects/*/locations/*/workerPools/*}", + "body": "worker_pool" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "worker_pool.name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "worker_pool" + }, + { + "(google.api.method_signature)": "worker_pool,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkerPool", + "metadata_type": "WorkerPool" + } + } + ] + }, + "DeleteWorkerPool": { + "requestType": "DeleteWorkerPoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/workerPools/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "WorkerPool", + "(google.longrunning.operation_info).metadata_type": "WorkerPool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/workerPools/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkerPool", + "metadata_type": "WorkerPool" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "google.iam.v1.GetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).get": "/v2/{resource=projects/*/locations/*/workerPools/*}:getIamPolicy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{resource=projects/*/locations/*/workerPools/*}:getIamPolicy" + } + } + ] + }, + "SetIamPolicy": { + "requestType": "google.iam.v1.SetIamPolicyRequest", + "responseType": "google.iam.v1.Policy", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/locations/*/workerPools/*}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/locations/*/workerPools/*}:setIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "google.iam.v1.TestIamPermissionsRequest", + "responseType": "google.iam.v1.TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v2/{resource=projects/*/locations/*/workerPools/*}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{resource=projects/*/locations/*/workerPools/*}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "CreateWorkerPoolRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/WorkerPool" + } + }, + "workerPool": { + "type": "WorkerPool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "workerPoolId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateWorkerPoolRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "workerPool": { + "type": "WorkerPool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "forceNewRevision": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListWorkerPoolsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/WorkerPool" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "showDeleted": { + "type": "bool", + "id": 4 + } + } + }, + "ListWorkerPoolsResponse": { + "fields": { + "workerPools": { + "rule": "repeated", + "type": "WorkerPool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetWorkerPoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/WorkerPool" + } + } + } + }, + "DeleteWorkerPoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/WorkerPool" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "WorkerPool": { + "options": { + "(google.api.resource).type": "run.googleapis.com/WorkerPool", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/workerPools/{worker_pool}", + "(google.api.resource).plural": "workerPools", + "(google.api.resource).singular": "workerPool", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "generation": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModifier": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "client": { + "type": "string", + "id": 13 + }, + "clientVersion": { + "type": "string", + "id": 14 + }, + "launchStage": { + "type": "google.api.LaunchStage", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "binaryAuthorization": { + "type": "BinaryAuthorization", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "template": { + "type": "WorkerPoolRevisionTemplate", + "id": 18, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceSplits": { + "rule": "repeated", + "type": "InstanceSplit", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scaling": { + "type": "WorkerPoolScaling", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "observedGeneration": { + "type": "int64", + "id": 30, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "terminalCondition": { + "type": "Condition", + "id": 31, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 32, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latestReadyRevision": { + "type": "string", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "latestCreatedRevision": { + "type": "string", + "id": 34, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "instanceSplitStatuses": { + "rule": "repeated", + "type": "InstanceSplitStatus", + "id": 27, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "threatDetectionEnabled": { + "type": "bool", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "customAudiences": { + "rule": "repeated", + "type": "string", + "id": 37 + }, + "satisfiesPzs": { + "type": "bool", + "id": 38, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 98, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 99, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "WorkerPoolRevisionTemplate": { + "oneofs": { + "_gpuZonalRedundancyDisabled": { + "oneof": [ + "gpuZonalRedundancyDisabled" + ] + } + }, + "fields": { + "revision": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "run.googleapis.com/Revision" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "vpcAccess": { + "type": "VpcAccess", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 6 + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionKey": { + "type": "string", + "id": 8, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "serviceMesh": { + "type": "ServiceMesh", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionKeyRevocationAction": { + "type": "EncryptionKeyRevocationAction", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionKeyShutdownDuration": { + "type": "google.protobuf.Duration", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeSelector": { + "type": "NodeSelector", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gpuZonalRedundancyDisabled": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "RoutingProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "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 + } + }, + "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 + } + } + }, + "routing": { + "type": "google.api.RoutingRule", + "id": 72295729, + "extend": "google.protobuf.MethodOptions" + }, + "RoutingRule": { + "fields": { + "routingParameters": { + "rule": "repeated", + "type": "RoutingParameter", + "id": 2 + } + } + }, + "RoutingParameter": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "pathTemplate": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "IAMPolicy": { + "options": { + "(google.api.default_host)": "iam-meta-api.googleapis.com" + }, + "methods": { + "SetIamPolicy": { + "requestType": "SetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:setIamPolicy", + "body": "*" + } + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:getIamPolicy", + "body": "*" + } + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRequest", + "responseType": "TestIamPermissionsResponse", + "options": { + "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{resource=**}:testIamPermissions", + "body": "*" + } + } + ] + } + } + }, + "SetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "policy": { + "type": "Policy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "GetIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "options": { + "type": "GetPolicyOptions", + "id": 2 + } + } + }, + "TestIamPermissionsRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GetPolicyOptions": { + "fields": { + "requestedPolicyVersion": { + "type": "int32", + "id": 1 + } + } + }, + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js new file mode 100644 index 00000000000..c9e3c774387 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js @@ -0,0 +1,114 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, storageSource, imageUri) { + // [START run_v2_generated_Builds_SubmitBuild_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 project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. Source for the build. + */ + // const storageSource = {} + /** + * Required. Artifact Registry URI to store the built image. + */ + // const imageUri = 'abc123' + /** + * Build the source using Buildpacks. + */ + // const buildpackBuild = {} + /** + * Build the source using Docker. This means the source has a Dockerfile. + */ + // const dockerBuild = {} + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + */ + // const serviceAccount = 'abc123' + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + */ + // const workerPool = 'abc123' + /** + * Optional. Additional tags to annotate the build. + */ + // const tags = ['abc','def'] + /** + * Optional. The machine type from default pool to use for the build. If left + * blank, cloudbuild will use a sensible default. Currently only E2_HIGHCPU_8 + * is supported. If worker_pool is set, this field will be ignored. + */ + // const machineType = 'abc123' + /** + * Optional. The release track of the client that initiated the build request. + */ + // const releaseTrack = {} + /** + * Optional. The client that initiated the build request. + */ + // const client = 'abc123' + + // Imports the Run library + const {BuildsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new BuildsClient(); + + async function callSubmitBuild() { + // Construct request + const request = { + parent, + storageSource, + imageUri, + }; + + // Run request + const response = await runClient.submitBuild(request); + console.log(response); + } + + callSubmitBuild(); + // [END run_v2_generated_Builds_SubmitBuild_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-run/samples/generated/v2/executions.cancel_execution.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.cancel_execution.js new file mode 100644 index 00000000000..e5d07e70ce6 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.cancel_execution.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Executions_CancelExecution_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 name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + */ + // const name = 'abc123' + /** + * Indicates that the request should be validated without actually + * cancelling any resources. + */ + // const validateOnly = true + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + + // Imports the Run library + const {ExecutionsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ExecutionsClient(); + + async function callCancelExecution() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.cancelExecution(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCancelExecution(); + // [END run_v2_generated_Executions_CancelExecution_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-run/samples/generated/v2/executions.delete_execution.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.delete_execution.js new file mode 100644 index 00000000000..4cf6452e469 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.delete_execution.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Executions_DeleteExecution_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 name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + */ + // const name = 'abc123' + /** + * Indicates that the request should be validated without actually + * deleting any resources. + */ + // const validateOnly = true + /** + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + + // Imports the Run library + const {ExecutionsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ExecutionsClient(); + + async function callDeleteExecution() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.deleteExecution(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteExecution(); + // [END run_v2_generated_Executions_DeleteExecution_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-run/samples/generated/v2/executions.get_execution.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.get_execution.js new file mode 100644 index 00000000000..d93f467a9d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.get_execution.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 run_v2_generated_Executions_GetExecution_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 full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + */ + // const name = 'abc123' + + // Imports the Run library + const {ExecutionsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ExecutionsClient(); + + async function callGetExecution() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await runClient.getExecution(request); + console.log(response); + } + + callGetExecution(); + // [END run_v2_generated_Executions_GetExecution_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-run/samples/generated/v2/executions.list_executions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.list_executions.js new file mode 100644 index 00000000000..a7019ecc2e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.list_executions.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START run_v2_generated_Executions_ListExecutions_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 Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + */ + // const parent = 'abc123' + /** + * Maximum number of Executions to return in this call. + */ + // const pageSize = 1234 + /** + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + */ + // const pageToken = 'abc123' + /** + * If true, returns deleted (but unexpired) resources along with active ones. + */ + // const showDeleted = true + + // Imports the Run library + const {ExecutionsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ExecutionsClient(); + + async function callListExecutions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = runClient.listExecutionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExecutions(); + // [END run_v2_generated_Executions_ListExecutions_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-run/samples/generated/v2/instances.create_instance.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.create_instance.js new file mode 100644 index 00000000000..1e6dfa06595 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.create_instance.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, instance, instanceId) { + // [START run_v2_generated_Instances_CreateInstance_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. + */ + /** + */ + // const parent = 'abc123' + /** + */ + // const instance = {} + /** + * Required. The unique identifier for the Instance. It must begin with + * letter, and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the instance becomes {parent}/instances/{instance_id}. + */ + // const instanceId = 'abc123' + /** + * Optional. Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + */ + // const validateOnly = true + + // Imports the Run library + const {InstancesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new InstancesClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instance, + instanceId, + }; + + // Run request + const [operation] = await runClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END run_v2_generated_Instances_CreateInstance_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-run/samples/generated/v2/instances.delete_instance.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.delete_instance.js new file mode 100644 index 00000000000..bfd242e9bd9 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.delete_instance.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Instances_DeleteInstance_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. + */ + /** + */ + // const name = 'abc123' + /** + * Optional. Indicates that the request should be validated without actually + * deleting any resources. + */ + // const validateOnly = true + /** + * Optional. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + + // Imports the Run library + const {InstancesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new InstancesClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END run_v2_generated_Instances_DeleteInstance_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-run/samples/generated/v2/instances.get_instance.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.get_instance.js new file mode 100644 index 00000000000..350d1273ebb --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.get_instance.js @@ -0,0 +1,60 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Instances_GetInstance_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. + */ + /** + */ + // const name = 'abc123' + + // Imports the Run library + const {InstancesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new InstancesClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await runClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END run_v2_generated_Instances_GetInstance_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-run/samples/generated/v2/instances.list_instances.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.list_instances.js new file mode 100644 index 00000000000..36050f2cd4d --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.list_instances.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START run_v2_generated_Instances_ListInstances_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 location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of Instances to return in this call. + */ + // const pageSize = 1234 + /** + * Optional. A page token received from a previous call to ListInstances. + * All other parameters must match. + */ + // const pageToken = 'abc123' + /** + * Optional. If true, returns deleted (but unexpired) resources along with + * active ones. + */ + // const showDeleted = true + + // Imports the Run library + const {InstancesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new InstancesClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = runClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END run_v2_generated_Instances_ListInstances_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-run/samples/generated/v2/instances.start_instance.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.start_instance.js new file mode 100644 index 00000000000..34d808b00af --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.start_instance.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Instances_StartInstance_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 name of the Instance to stop. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}`, + * where `{project}` can be project id or number. + */ + // const name = 'abc123' + /** + * Optional. Indicates that the request should be validated without actually + * stopping any resources. + */ + // const validateOnly = true + /** + * Optional. A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + + // Imports the Run library + const {InstancesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new InstancesClient(); + + async function callStartInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.startInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStartInstance(); + // [END run_v2_generated_Instances_StartInstance_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-run/samples/generated/v2/instances.stop_instance.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.stop_instance.js new file mode 100644 index 00000000000..f8ed62f2f31 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.stop_instance.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Instances_StopInstance_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 name of the Instance to stop. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}`, + * where `{project}` can be project id or number. + */ + // const name = 'abc123' + /** + * Optional. Indicates that the request should be validated without actually + * stopping any resources. + */ + // const validateOnly = true + /** + * Optional. A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + + // Imports the Run library + const {InstancesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new InstancesClient(); + + async function callStopInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.stopInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStopInstance(); + // [END run_v2_generated_Instances_StopInstance_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-run/samples/generated/v2/jobs.create_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.create_job.js new file mode 100644 index 00000000000..f667a3423de --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.create_job.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, job, jobId) { + // [START run_v2_generated_Jobs_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 location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + */ + // const parent = 'abc123' + /** + * Required. The Job instance to create. + */ + // const job = {} + /** + * Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + */ + // const jobId = 'abc123' + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + */ + // const validateOnly = true + + // Imports the Run library + const {JobsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new JobsClient(); + + async function callCreateJob() { + // Construct request + const request = { + parent, + job, + jobId, + }; + + // Run request + const [operation] = await runClient.createJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateJob(); + // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.delete_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.delete_job.js new file mode 100644 index 00000000000..d1c47ab094f --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.delete_job.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Jobs_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. + */ + /** + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + */ + // const name = 'abc123' + /** + * Indicates that the request should be validated without actually + * deleting any resources. + */ + // const validateOnly = true + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + + // Imports the Run library + const {JobsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new JobsClient(); + + async function callDeleteJob() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.deleteJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteJob(); + // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.get_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js new file mode 100644 index 00000000000..b7a9ffdac4d --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource) { + // [START run_v2_generated_Jobs_GetIamPolicy_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 resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Run library + const {JobsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new JobsClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await runClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END run_v2_generated_Jobs_GetIamPolicy_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-run/samples/generated/v2/jobs.get_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_job.js new file mode 100644 index 00000000000..14128597e57 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_job.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Jobs_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. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + */ + // const name = 'abc123' + + // Imports the Run library + const {JobsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new JobsClient(); + + async function callGetJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await runClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.list_jobs.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.list_jobs.js new file mode 100644 index 00000000000..6841d7dd00f --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.list_jobs.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START run_v2_generated_Jobs_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. + */ + /** + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + */ + // const parent = 'abc123' + /** + * Maximum number of Jobs to return in this call. + */ + // const pageSize = 1234 + /** + * A page token received from a previous call to ListJobs. + * All other parameters must match. + */ + // const pageToken = 'abc123' + /** + * If true, returns deleted (but unexpired) resources along with active ones. + */ + // const showDeleted = true + + // Imports the Run library + const {JobsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new JobsClient(); + + async function callListJobs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = runClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.run_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.run_job.js new file mode 100644 index 00000000000..667b19a3569 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.run_job.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Jobs_RunJob_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 full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + */ + // const name = 'abc123' + /** + * Indicates that the request should be validated without actually + * deleting any resources. + */ + // const validateOnly = true + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + /** + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + */ + // const overrides = {} + + // Imports the Run library + const {JobsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new JobsClient(); + + async function callRunJob() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.runJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunJob(); + // [END run_v2_generated_Jobs_RunJob_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-run/samples/generated/v2/jobs.set_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js new file mode 100644 index 00000000000..252e9c83914 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, policy) { + // [START run_v2_generated_Jobs_SetIamPolicy_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 resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Run library + const {JobsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new JobsClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await runClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END run_v2_generated_Jobs_SetIamPolicy_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-run/samples/generated/v2/jobs.test_iam_permissions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js new file mode 100644 index 00000000000..53cbddb3960 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, permissions) { + // [START run_v2_generated_Jobs_TestIamPermissions_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 resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = ['abc','def'] + + // Imports the Run library + const {JobsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new JobsClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await runClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END run_v2_generated_Jobs_TestIamPermissions_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-run/samples/generated/v2/jobs.update_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.update_job.js new file mode 100644 index 00000000000..3e18108e07c --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.update_job.js @@ -0,0 +1,73 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(job) { + // [START run_v2_generated_Jobs_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 be updated. + */ + // const job = {} + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + */ + // const validateOnly = true + /** + * Optional. If set to true, and if the Job does not exist, it will create a + * new one. Caller must have both create and update permissions for this call + * if this is set to true. + */ + // const allowMissing = true + + // Imports the Run library + const {JobsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new JobsClient(); + + async function callUpdateJob() { + // Construct request + const request = { + job, + }; + + // Run request + const [operation] = await runClient.updateJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateJob(); + // [END run_v2_generated_Jobs_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-run/samples/generated/v2/revisions.delete_revision.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.delete_revision.js new file mode 100644 index 00000000000..c8f2d93d6eb --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.delete_revision.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Revisions_DeleteRevision_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 name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + */ + // const name = 'abc123' + /** + * Indicates that the request should be validated without actually + * deleting any resources. + */ + // const validateOnly = true + /** + * A system-generated fingerprint for this version of the + * resource. This may be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + + // Imports the Run library + const {RevisionsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new RevisionsClient(); + + async function callDeleteRevision() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.deleteRevision(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteRevision(); + // [END run_v2_generated_Revisions_DeleteRevision_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-run/samples/generated/v2/revisions.get_revision.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.get_revision.js new file mode 100644 index 00000000000..c5388577b21 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.get_revision.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Revisions_GetRevision_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 full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + */ + // const name = 'abc123' + + // Imports the Run library + const {RevisionsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new RevisionsClient(); + + async function callGetRevision() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await runClient.getRevision(request); + console.log(response); + } + + callGetRevision(); + // [END run_v2_generated_Revisions_GetRevision_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-run/samples/generated/v2/revisions.list_revisions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.list_revisions.js new file mode 100644 index 00000000000..3ab293f98f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.list_revisions.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START run_v2_generated_Revisions_ListRevisions_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 Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + */ + // const parent = 'abc123' + /** + * Maximum number of revisions to return in this call. + */ + // const pageSize = 1234 + /** + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + */ + // const pageToken = 'abc123' + /** + * If true, returns deleted (but unexpired) resources along with active ones. + */ + // const showDeleted = true + + // Imports the Run library + const {RevisionsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new RevisionsClient(); + + async function callListRevisions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = runClient.listRevisionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRevisions(); + // [END run_v2_generated_Revisions_ListRevisions_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-run/samples/generated/v2/services.create_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.create_service.js new file mode 100644 index 00000000000..6cec74a186b --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.create_service.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, service, serviceId) { + // [START run_v2_generated_Services_CreateService_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 location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. + */ + // const parent = 'abc123' + /** + * Required. The Service instance to create. + */ + // const service = {} + /** + * Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + */ + // const serviceId = 'abc123' + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + */ + // const validateOnly = true + + // Imports the Run library + const {ServicesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ServicesClient(); + + async function callCreateService() { + // Construct request + const request = { + parent, + service, + serviceId, + }; + + // Run request + const [operation] = await runClient.createService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateService(); + // [END run_v2_generated_Services_CreateService_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-run/samples/generated/v2/services.delete_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.delete_service.js new file mode 100644 index 00000000000..15fc933afbf --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.delete_service.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Services_DeleteService_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 full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + */ + // const name = 'abc123' + /** + * Indicates that the request should be validated without actually + * deleting any resources. + */ + // const validateOnly = true + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + + // Imports the Run library + const {ServicesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ServicesClient(); + + async function callDeleteService() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.deleteService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteService(); + // [END run_v2_generated_Services_DeleteService_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-run/samples/generated/v2/services.get_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_iam_policy.js new file mode 100644 index 00000000000..43c848a8036 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource) { + // [START run_v2_generated_Services_GetIamPolicy_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 resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Run library + const {ServicesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ServicesClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await runClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END run_v2_generated_Services_GetIamPolicy_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-run/samples/generated/v2/services.get_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_service.js new file mode 100644 index 00000000000..817c4f8129a --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_service.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Services_GetService_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 full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + */ + // const name = 'abc123' + + // Imports the Run library + const {ServicesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ServicesClient(); + + async function callGetService() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await runClient.getService(request); + console.log(response); + } + + callGetService(); + // [END run_v2_generated_Services_GetService_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-run/samples/generated/v2/services.list_services.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.list_services.js new file mode 100644 index 00000000000..609e3ca2e81 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.list_services.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START run_v2_generated_Services_ListServices_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 location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + */ + // const parent = 'abc123' + /** + * Maximum number of Services to return in this call. + */ + // const pageSize = 1234 + /** + * A page token received from a previous call to ListServices. + * All other parameters must match. + */ + // const pageToken = 'abc123' + /** + * If true, returns deleted (but unexpired) resources along with active ones. + */ + // const showDeleted = true + + // Imports the Run library + const {ServicesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ServicesClient(); + + async function callListServices() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = runClient.listServicesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListServices(); + // [END run_v2_generated_Services_ListServices_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-run/samples/generated/v2/services.set_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.set_iam_policy.js new file mode 100644 index 00000000000..64b239c5461 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, policy) { + // [START run_v2_generated_Services_SetIamPolicy_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 resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Run library + const {ServicesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ServicesClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await runClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END run_v2_generated_Services_SetIamPolicy_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-run/samples/generated/v2/services.test_iam_permissions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js new file mode 100644 index 00000000000..d69dc7c7991 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, permissions) { + // [START run_v2_generated_Services_TestIamPermissions_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 resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = ['abc','def'] + + // Imports the Run library + const {ServicesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ServicesClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await runClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END run_v2_generated_Services_TestIamPermissions_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-run/samples/generated/v2/services.update_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.update_service.js new file mode 100644 index 00000000000..fff4ac4ad3f --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.update_service.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(service) { + // [START run_v2_generated_Services_UpdateService_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. + */ + /** + * Optional. The list of fields to be updated. + */ + // const updateMask = {} + /** + * Required. The Service to be updated. + */ + // const service = {} + /** + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + */ + // const validateOnly = true + /** + * Optional. If set to true, and if the Service does not exist, it will create + * a new one. The caller must have 'run.services.create' permissions if this + * is set to true and the Service does not exist. + */ + // const allowMissing = true + + // Imports the Run library + const {ServicesClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new ServicesClient(); + + async function callUpdateService() { + // Construct request + const request = { + service, + }; + + // Run request + const [operation] = await runClient.updateService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateService(); + // [END run_v2_generated_Services_UpdateService_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-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json b/owl-bot-staging/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json new file mode 100644 index 00000000000..4ff250fc8b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json @@ -0,0 +1,1995 @@ +{ + "clientLibrary": { + "name": "nodejs-run", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.run.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "run_v2_generated_Builds_SubmitBuild_async", + "title": "Builds submitBuild Sample", + "origin": "API_DEFINITION", + "description": " Submits a build in a given project.", + "canonical": true, + "file": "builds.submit_build.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 106, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SubmitBuild", + "fullName": "google.cloud.run.v2.Builds.SubmitBuild", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "storage_source", + "type": ".google.cloud.run.v2.StorageSource" + }, + { + "name": "image_uri", + "type": "TYPE_STRING" + }, + { + "name": "buildpack_build", + "type": ".google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild" + }, + { + "name": "docker_build", + "type": ".google.cloud.run.v2.SubmitBuildRequest.DockerBuild" + }, + { + "name": "service_account", + "type": "TYPE_STRING" + }, + { + "name": "worker_pool", + "type": "TYPE_STRING" + }, + { + "name": "tags", + "type": "TYPE_STRING[]" + }, + { + "name": "machine_type", + "type": "TYPE_STRING" + }, + { + "name": "release_track", + "type": ".google.api.LaunchStage" + }, + { + "name": "client", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.run.v2.SubmitBuildResponse", + "client": { + "shortName": "BuildsClient", + "fullName": "google.cloud.run.v2.BuildsClient" + }, + "method": { + "shortName": "SubmitBuild", + "fullName": "google.cloud.run.v2.Builds.SubmitBuild", + "service": { + "shortName": "Builds", + "fullName": "google.cloud.run.v2.Builds" + } + } + } + }, + { + "regionTag": "run_v2_generated_Executions_GetExecution_async", + "title": "Builds getExecution Sample", + "origin": "API_DEFINITION", + "description": " Gets information about an Execution.", + "canonical": true, + "file": "executions.get_execution.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetExecution", + "fullName": "google.cloud.run.v2.Executions.GetExecution", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.run.v2.Execution", + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "GetExecution", + "fullName": "google.cloud.run.v2.Executions.GetExecution", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + } + }, + { + "regionTag": "run_v2_generated_Executions_ListExecutions_async", + "title": "Builds listExecutions Sample", + "origin": "API_DEFINITION", + "description": " Lists Executions from a Job. Results are sorted by creation time, descending.", + "canonical": true, + "file": "executions.list_executions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListExecutions", + "fullName": "google.cloud.run.v2.Executions.ListExecutions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.run.v2.ListExecutionsResponse", + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "ListExecutions", + "fullName": "google.cloud.run.v2.Executions.ListExecutions", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + } + }, + { + "regionTag": "run_v2_generated_Executions_DeleteExecution_async", + "title": "Builds deleteExecution Sample", + "origin": "API_DEFINITION", + "description": " Deletes an Execution.", + "canonical": true, + "file": "executions.delete_execution.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteExecution", + "fullName": "google.cloud.run.v2.Executions.DeleteExecution", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "DeleteExecution", + "fullName": "google.cloud.run.v2.Executions.DeleteExecution", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + } + }, + { + "regionTag": "run_v2_generated_Executions_CancelExecution_async", + "title": "Builds cancelExecution Sample", + "origin": "API_DEFINITION", + "description": " Cancels an Execution.", + "canonical": true, + "file": "executions.cancel_execution.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelExecution", + "fullName": "google.cloud.run.v2.Executions.CancelExecution", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ExecutionsClient", + "fullName": "google.cloud.run.v2.ExecutionsClient" + }, + "method": { + "shortName": "CancelExecution", + "fullName": "google.cloud.run.v2.Executions.CancelExecution", + "service": { + "shortName": "Executions", + "fullName": "google.cloud.run.v2.Executions" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_CreateInstance_async", + "title": "Builds createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates an Instance.", + "canonical": true, + "file": "instances.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.run.v2.Instances.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.run.v2.Instance" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.run.v2.Instances.CreateInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_DeleteInstance_async", + "title": "Builds deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Instance", + "canonical": true, + "file": "instances.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.run.v2.Instances.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.run.v2.Instances.DeleteInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_GetInstance_async", + "title": "Builds getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets a Instance", + "canonical": true, + "file": "instances.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.run.v2.Instances.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.run.v2.Instance", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.run.v2.Instances.GetInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_ListInstances_async", + "title": "Builds listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances. Results are sorted by creation time, descending.", + "canonical": true, + "file": "instances.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.run.v2.Instances.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.run.v2.ListInstancesResponse", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.run.v2.Instances.ListInstances", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_StopInstance_async", + "title": "Builds stopInstance Sample", + "origin": "API_DEFINITION", + "description": " Stops an Instance.", + "canonical": true, + "file": "instances.stop_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopInstance", + "fullName": "google.cloud.run.v2.Instances.StopInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "StopInstance", + "fullName": "google.cloud.run.v2.Instances.StopInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_StartInstance_async", + "title": "Builds startInstance Sample", + "origin": "API_DEFINITION", + "description": " Starts an Instance.", + "canonical": true, + "file": "instances.start_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartInstance", + "fullName": "google.cloud.run.v2.Instances.StartInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "StartInstance", + "fullName": "google.cloud.run.v2.Instances.StartInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Jobs_CreateJob_async", + "title": "Builds createJob Sample", + "origin": "API_DEFINITION", + "description": " Creates a Job.", + "canonical": true, + "file": "jobs.create_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJob", + "fullName": "google.cloud.run.v2.Jobs.CreateJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.run.v2.Job" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "CreateJob", + "fullName": "google.cloud.run.v2.Jobs.CreateJob", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + } + }, + { + "regionTag": "run_v2_generated_Jobs_GetJob_async", + "title": "Builds getJob Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a Job.", + "canonical": true, + "file": "jobs.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.run.v2.Jobs.GetJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.run.v2.Job", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.run.v2.Jobs.GetJob", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + } + }, + { + "regionTag": "run_v2_generated_Jobs_ListJobs_async", + "title": "Builds listJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists Jobs. Results are sorted by creation time, descending.", + "canonical": true, + "file": "jobs.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.run.v2.Jobs.ListJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.run.v2.ListJobsResponse", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.run.v2.Jobs.ListJobs", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + } + }, + { + "regionTag": "run_v2_generated_Jobs_UpdateJob_async", + "title": "Builds updateJob Sample", + "origin": "API_DEFINITION", + "description": " Updates a Job.", + "canonical": true, + "file": "jobs.update_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateJob", + "fullName": "google.cloud.run.v2.Jobs.UpdateJob", + "async": true, + "parameters": [ + { + "name": "job", + "type": ".google.cloud.run.v2.Job" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "UpdateJob", + "fullName": "google.cloud.run.v2.Jobs.UpdateJob", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + } + }, + { + "regionTag": "run_v2_generated_Jobs_DeleteJob_async", + "title": "Builds deleteJob Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Job.", + "canonical": true, + "file": "jobs.delete_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJob", + "fullName": "google.cloud.run.v2.Jobs.DeleteJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "DeleteJob", + "fullName": "google.cloud.run.v2.Jobs.DeleteJob", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + } + }, + { + "regionTag": "run_v2_generated_Jobs_RunJob_async", + "title": "Builds runJob Sample", + "origin": "API_DEFINITION", + "description": " Triggers creation of a new Execution of this Job.", + "canonical": true, + "file": "jobs.run_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunJob", + "fullName": "google.cloud.run.v2.Jobs.RunJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "overrides", + "type": ".google.cloud.run.v2.RunJobRequest.Overrides" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "RunJob", + "fullName": "google.cloud.run.v2.Jobs.RunJob", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + } + }, + { + "regionTag": "run_v2_generated_Jobs_GetIamPolicy_async", + "title": "Builds getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the IAM Access Control policy currently in effect for the given Job. This result does not include any inherited policies.", + "canonical": true, + "file": "jobs.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.run.v2.Jobs.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.run.v2.Jobs.GetIamPolicy", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + } + }, + { + "regionTag": "run_v2_generated_Jobs_SetIamPolicy_async", + "title": "Builds setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the IAM Access control policy for the specified Job. Overwrites any existing policy.", + "canonical": true, + "file": "jobs.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.run.v2.Jobs.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.run.v2.Jobs.SetIamPolicy", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + } + }, + { + "regionTag": "run_v2_generated_Jobs_TestIamPermissions_async", + "title": "Builds testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.", + "canonical": true, + "file": "jobs.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.run.v2.Jobs.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "JobsClient", + "fullName": "google.cloud.run.v2.JobsClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.run.v2.Jobs.TestIamPermissions", + "service": { + "shortName": "Jobs", + "fullName": "google.cloud.run.v2.Jobs" + } + } + } + }, + { + "regionTag": "run_v2_generated_Revisions_GetRevision_async", + "title": "Builds getRevision Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a Revision.", + "canonical": true, + "file": "revisions.get_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRevision", + "fullName": "google.cloud.run.v2.Revisions.GetRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.run.v2.Revision", + "client": { + "shortName": "RevisionsClient", + "fullName": "google.cloud.run.v2.RevisionsClient" + }, + "method": { + "shortName": "GetRevision", + "fullName": "google.cloud.run.v2.Revisions.GetRevision", + "service": { + "shortName": "Revisions", + "fullName": "google.cloud.run.v2.Revisions" + } + } + } + }, + { + "regionTag": "run_v2_generated_Revisions_ListRevisions_async", + "title": "Builds listRevisions Sample", + "origin": "API_DEFINITION", + "description": " Lists Revisions from a given Service, or from a given location. Results are sorted by creation time, descending.", + "canonical": true, + "file": "revisions.list_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRevisions", + "fullName": "google.cloud.run.v2.Revisions.ListRevisions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.run.v2.ListRevisionsResponse", + "client": { + "shortName": "RevisionsClient", + "fullName": "google.cloud.run.v2.RevisionsClient" + }, + "method": { + "shortName": "ListRevisions", + "fullName": "google.cloud.run.v2.Revisions.ListRevisions", + "service": { + "shortName": "Revisions", + "fullName": "google.cloud.run.v2.Revisions" + } + } + } + }, + { + "regionTag": "run_v2_generated_Revisions_DeleteRevision_async", + "title": "Builds deleteRevision Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Revision.", + "canonical": true, + "file": "revisions.delete_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRevision", + "fullName": "google.cloud.run.v2.Revisions.DeleteRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RevisionsClient", + "fullName": "google.cloud.run.v2.RevisionsClient" + }, + "method": { + "shortName": "DeleteRevision", + "fullName": "google.cloud.run.v2.Revisions.DeleteRevision", + "service": { + "shortName": "Revisions", + "fullName": "google.cloud.run.v2.Revisions" + } + } + } + }, + { + "regionTag": "run_v2_generated_Services_CreateService_async", + "title": "Builds createService Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Service in a given project and location.", + "canonical": true, + "file": "services.create_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateService", + "fullName": "google.cloud.run.v2.Services.CreateService", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "service", + "type": ".google.cloud.run.v2.Service" + }, + { + "name": "service_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "CreateService", + "fullName": "google.cloud.run.v2.Services.CreateService", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + } + }, + { + "regionTag": "run_v2_generated_Services_GetService_async", + "title": "Builds getService Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a Service.", + "canonical": true, + "file": "services.get_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetService", + "fullName": "google.cloud.run.v2.Services.GetService", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.run.v2.Service", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "GetService", + "fullName": "google.cloud.run.v2.Services.GetService", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + } + }, + { + "regionTag": "run_v2_generated_Services_ListServices_async", + "title": "Builds listServices Sample", + "origin": "API_DEFINITION", + "description": " Lists Services. Results are sorted by creation time, descending.", + "canonical": true, + "file": "services.list_services.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListServices", + "fullName": "google.cloud.run.v2.Services.ListServices", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.run.v2.ListServicesResponse", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "ListServices", + "fullName": "google.cloud.run.v2.Services.ListServices", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + } + }, + { + "regionTag": "run_v2_generated_Services_UpdateService_async", + "title": "Builds updateService Sample", + "origin": "API_DEFINITION", + "description": " Updates a Service.", + "canonical": true, + "file": "services.update_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateService", + "fullName": "google.cloud.run.v2.Services.UpdateService", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "service", + "type": ".google.cloud.run.v2.Service" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "UpdateService", + "fullName": "google.cloud.run.v2.Services.UpdateService", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + } + }, + { + "regionTag": "run_v2_generated_Services_DeleteService_async", + "title": "Builds deleteService Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.", + "canonical": true, + "file": "services.delete_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteService", + "fullName": "google.cloud.run.v2.Services.DeleteService", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "DeleteService", + "fullName": "google.cloud.run.v2.Services.DeleteService", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + } + }, + { + "regionTag": "run_v2_generated_Services_GetIamPolicy_async", + "title": "Builds getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.", + "canonical": true, + "file": "services.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.run.v2.Services.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.run.v2.Services.GetIamPolicy", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + } + }, + { + "regionTag": "run_v2_generated_Services_SetIamPolicy_async", + "title": "Builds setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.", + "canonical": true, + "file": "services.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.run.v2.Services.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.run.v2.Services.SetIamPolicy", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + } + }, + { + "regionTag": "run_v2_generated_Services_TestIamPermissions_async", + "title": "Builds testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.", + "canonical": true, + "file": "services.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.run.v2.Services.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "ServicesClient", + "fullName": "google.cloud.run.v2.ServicesClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.run.v2.Services.TestIamPermissions", + "service": { + "shortName": "Services", + "fullName": "google.cloud.run.v2.Services" + } + } + } + }, + { + "regionTag": "run_v2_generated_Tasks_GetTask_async", + "title": "Builds getTask Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a Task.", + "canonical": true, + "file": "tasks.get_task.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTask", + "fullName": "google.cloud.run.v2.Tasks.GetTask", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.run.v2.Task", + "client": { + "shortName": "TasksClient", + "fullName": "google.cloud.run.v2.TasksClient" + }, + "method": { + "shortName": "GetTask", + "fullName": "google.cloud.run.v2.Tasks.GetTask", + "service": { + "shortName": "Tasks", + "fullName": "google.cloud.run.v2.Tasks" + } + } + } + }, + { + "regionTag": "run_v2_generated_Tasks_ListTasks_async", + "title": "Builds listTasks Sample", + "origin": "API_DEFINITION", + "description": " Lists Tasks from an Execution of a Job.", + "canonical": true, + "file": "tasks.list_tasks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTasks", + "fullName": "google.cloud.run.v2.Tasks.ListTasks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.run.v2.ListTasksResponse", + "client": { + "shortName": "TasksClient", + "fullName": "google.cloud.run.v2.TasksClient" + }, + "method": { + "shortName": "ListTasks", + "fullName": "google.cloud.run.v2.Tasks.ListTasks", + "service": { + "shortName": "Tasks", + "fullName": "google.cloud.run.v2.Tasks" + } + } + } + }, + { + "regionTag": "run_v2_generated_WorkerPools_CreateWorkerPool_async", + "title": "Builds createWorkerPool Sample", + "origin": "API_DEFINITION", + "description": " Creates a new WorkerPool in a given project and location.", + "canonical": true, + "file": "worker_pools.create_worker_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkerPool", + "fullName": "google.cloud.run.v2.WorkerPools.CreateWorkerPool", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "worker_pool", + "type": ".google.cloud.run.v2.WorkerPool" + }, + { + "name": "worker_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkerPoolsClient", + "fullName": "google.cloud.run.v2.WorkerPoolsClient" + }, + "method": { + "shortName": "CreateWorkerPool", + "fullName": "google.cloud.run.v2.WorkerPools.CreateWorkerPool", + "service": { + "shortName": "WorkerPools", + "fullName": "google.cloud.run.v2.WorkerPools" + } + } + } + }, + { + "regionTag": "run_v2_generated_WorkerPools_GetWorkerPool_async", + "title": "Builds getWorkerPool Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a WorkerPool.", + "canonical": true, + "file": "worker_pools.get_worker_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkerPool", + "fullName": "google.cloud.run.v2.WorkerPools.GetWorkerPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.run.v2.WorkerPool", + "client": { + "shortName": "WorkerPoolsClient", + "fullName": "google.cloud.run.v2.WorkerPoolsClient" + }, + "method": { + "shortName": "GetWorkerPool", + "fullName": "google.cloud.run.v2.WorkerPools.GetWorkerPool", + "service": { + "shortName": "WorkerPools", + "fullName": "google.cloud.run.v2.WorkerPools" + } + } + } + }, + { + "regionTag": "run_v2_generated_WorkerPools_ListWorkerPools_async", + "title": "Builds listWorkerPools Sample", + "origin": "API_DEFINITION", + "description": " Lists WorkerPools. Results are sorted by creation time, descending.", + "canonical": true, + "file": "worker_pools.list_worker_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkerPools", + "fullName": "google.cloud.run.v2.WorkerPools.ListWorkerPools", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.run.v2.ListWorkerPoolsResponse", + "client": { + "shortName": "WorkerPoolsClient", + "fullName": "google.cloud.run.v2.WorkerPoolsClient" + }, + "method": { + "shortName": "ListWorkerPools", + "fullName": "google.cloud.run.v2.WorkerPools.ListWorkerPools", + "service": { + "shortName": "WorkerPools", + "fullName": "google.cloud.run.v2.WorkerPools" + } + } + } + }, + { + "regionTag": "run_v2_generated_WorkerPools_UpdateWorkerPool_async", + "title": "Builds updateWorkerPool Sample", + "origin": "API_DEFINITION", + "description": " Updates a WorkerPool.", + "canonical": true, + "file": "worker_pools.update_worker_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateWorkerPool", + "fullName": "google.cloud.run.v2.WorkerPools.UpdateWorkerPool", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "worker_pool", + "type": ".google.cloud.run.v2.WorkerPool" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "force_new_revision", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkerPoolsClient", + "fullName": "google.cloud.run.v2.WorkerPoolsClient" + }, + "method": { + "shortName": "UpdateWorkerPool", + "fullName": "google.cloud.run.v2.WorkerPools.UpdateWorkerPool", + "service": { + "shortName": "WorkerPools", + "fullName": "google.cloud.run.v2.WorkerPools" + } + } + } + }, + { + "regionTag": "run_v2_generated_WorkerPools_DeleteWorkerPool_async", + "title": "Builds deleteWorkerPool Sample", + "origin": "API_DEFINITION", + "description": " Deletes a WorkerPool.", + "canonical": true, + "file": "worker_pools.delete_worker_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkerPool", + "fullName": "google.cloud.run.v2.WorkerPools.DeleteWorkerPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkerPoolsClient", + "fullName": "google.cloud.run.v2.WorkerPoolsClient" + }, + "method": { + "shortName": "DeleteWorkerPool", + "fullName": "google.cloud.run.v2.WorkerPools.DeleteWorkerPool", + "service": { + "shortName": "WorkerPools", + "fullName": "google.cloud.run.v2.WorkerPools" + } + } + } + }, + { + "regionTag": "run_v2_generated_WorkerPools_GetIamPolicy_async", + "title": "Builds getIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets the IAM Access Control policy currently in effect for the given Cloud Run WorkerPool. This result does not include any inherited policies.", + "canonical": true, + "file": "worker_pools.get_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.run.v2.WorkerPools.GetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "options", + "type": ".google.iam.v1.GetPolicyOptions" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "WorkerPoolsClient", + "fullName": "google.cloud.run.v2.WorkerPoolsClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.run.v2.WorkerPools.GetIamPolicy", + "service": { + "shortName": "WorkerPools", + "fullName": "google.cloud.run.v2.WorkerPools" + } + } + } + }, + { + "regionTag": "run_v2_generated_WorkerPools_SetIamPolicy_async", + "title": "Builds setIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Sets the IAM Access control policy for the specified WorkerPool. Overwrites any existing policy.", + "canonical": true, + "file": "worker_pools.set_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.run.v2.WorkerPools.SetIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.iam.v1.Policy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.iam.v1.Policy", + "client": { + "shortName": "WorkerPoolsClient", + "fullName": "google.cloud.run.v2.WorkerPoolsClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.run.v2.WorkerPools.SetIamPolicy", + "service": { + "shortName": "WorkerPools", + "fullName": "google.cloud.run.v2.WorkerPools" + } + } + } + }, + { + "regionTag": "run_v2_generated_WorkerPools_TestIamPermissions_async", + "title": "Builds testIamPermissions Sample", + "origin": "API_DEFINITION", + "description": " Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.", + "canonical": true, + "file": "worker_pools.test_iam_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.run.v2.WorkerPools.TestIamPermissions", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "permissions", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.iam.v1.TestIamPermissionsResponse", + "client": { + "shortName": "WorkerPoolsClient", + "fullName": "google.cloud.run.v2.WorkerPoolsClient" + }, + "method": { + "shortName": "TestIamPermissions", + "fullName": "google.cloud.run.v2.WorkerPools.TestIamPermissions", + "service": { + "shortName": "WorkerPools", + "fullName": "google.cloud.run.v2.WorkerPools" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js new file mode 100644 index 00000000000..c87bd60b7f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_Tasks_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. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + */ + // const name = 'abc123' + + // Imports the Run library + const {TasksClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new TasksClient(); + + async function callGetTask() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await runClient.getTask(request); + console.log(response); + } + + callGetTask(); + // [END run_v2_generated_Tasks_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-run/samples/generated/v2/tasks.list_tasks.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.list_tasks.js new file mode 100644 index 00000000000..08ad5515de0 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.list_tasks.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START run_v2_generated_Tasks_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. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + */ + // const parent = 'abc123' + /** + * Maximum number of Tasks to return in this call. + */ + // const pageSize = 1234 + /** + * A page token received from a previous call to ListTasks. + * All other parameters must match. + */ + // const pageToken = 'abc123' + /** + * If true, returns deleted (but unexpired) resources along with active ones. + */ + // const showDeleted = true + + // Imports the Run library + const {TasksClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new TasksClient(); + + async function callListTasks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = runClient.listTasksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTasks(); + // [END run_v2_generated_Tasks_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-run/samples/generated/v2/worker_pools.create_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js new file mode 100644 index 00000000000..f8685dd8aad --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js @@ -0,0 +1,83 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, workerPool, workerPoolId) { + // [START run_v2_generated_WorkerPools_CreateWorkerPool_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 location and project in which this worker pool should be + * created. Format: `projects/{project}/locations/{location}`, where + * `{project}` can be project id or number. Only lowercase characters, digits, + * and hyphens. + */ + // const parent = 'abc123' + /** + * Required. The WorkerPool instance to create. + */ + // const workerPool = {} + /** + * Required. The unique identifier for the WorkerPool. It must begin with + * letter, and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the worker pool becomes + * `{parent}/workerPools/{worker_pool_id}`. + */ + // const workerPoolId = 'abc123' + /** + * Optional. Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + */ + // const validateOnly = true + + // Imports the Run library + const {WorkerPoolsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new WorkerPoolsClient(); + + async function callCreateWorkerPool() { + // Construct request + const request = { + parent, + workerPool, + workerPoolId, + }; + + // Run request + const [operation] = await runClient.createWorkerPool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateWorkerPool(); + // [END run_v2_generated_WorkerPools_CreateWorkerPool_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-run/samples/generated/v2/worker_pools.delete_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js new file mode 100644 index 00000000000..ed78edb9df4 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START run_v2_generated_WorkerPools_DeleteWorkerPool_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 full name of the WorkerPool. + * Format: + * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where + * `{project}` can be project id or number. + */ + // const name = 'abc123' + /** + * Optional. Indicates that the request should be validated without actually + * deleting any resources. + */ + // const validateOnly = true + /** + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + */ + // const etag = 'abc123' + + // Imports the Run library + const {WorkerPoolsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new WorkerPoolsClient(); + + async function callDeleteWorkerPool() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await runClient.deleteWorkerPool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteWorkerPool(); + // [END run_v2_generated_WorkerPools_DeleteWorkerPool_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-run/samples/generated/v2/worker_pools.get_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js new file mode 100644 index 00000000000..12ac3d07e05 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource) { + // [START run_v2_generated_WorkerPools_GetIamPolicy_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 resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + */ + // const options = {} + + // Imports the Run library + const {WorkerPoolsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new WorkerPoolsClient(); + + async function callGetIamPolicy() { + // Construct request + const request = { + resource, + }; + + // Run request + const response = await runClient.getIamPolicy(request); + console.log(response); + } + + callGetIamPolicy(); + // [END run_v2_generated_WorkerPools_GetIamPolicy_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-run/samples/generated/v2/worker_pools.get_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js new file mode 100644 index 00000000000..53f15c17f05 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 run_v2_generated_WorkerPools_GetWorkerPool_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 full name of the WorkerPool. + * Format: + * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where + * `{project}` can be project id or number. + */ + // const name = 'abc123' + + // Imports the Run library + const {WorkerPoolsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new WorkerPoolsClient(); + + async function callGetWorkerPool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await runClient.getWorkerPool(request); + console.log(response); + } + + callGetWorkerPool(); + // [END run_v2_generated_WorkerPools_GetWorkerPool_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-run/samples/generated/v2/worker_pools.list_worker_pools.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js new file mode 100644 index 00000000000..d96211dd232 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js @@ -0,0 +1,79 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START run_v2_generated_WorkerPools_ListWorkerPools_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 location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: `projects/{project}/locations/{location}`, where + * `{project}` can be project id or number. + */ + // const parent = 'abc123' + /** + * Maximum number of WorkerPools to return in this call. + */ + // const pageSize = 1234 + /** + * A page token received from a previous call to ListWorkerPools. + * All other parameters must match. + */ + // const pageToken = 'abc123' + /** + * If true, returns deleted (but unexpired) resources along with active ones. + */ + // const showDeleted = true + + // Imports the Run library + const {WorkerPoolsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new WorkerPoolsClient(); + + async function callListWorkerPools() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = runClient.listWorkerPoolsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWorkerPools(); + // [END run_v2_generated_WorkerPools_ListWorkerPools_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-run/samples/generated/v2/worker_pools.set_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js new file mode 100644 index 00000000000..1e4c1332759 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, policy) { + // [START run_v2_generated_WorkerPools_SetIamPolicy_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 resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + // const policy = {} + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * `paths: "bindings, etag"` + */ + // const updateMask = {} + + // Imports the Run library + const {WorkerPoolsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new WorkerPoolsClient(); + + async function callSetIamPolicy() { + // Construct request + const request = { + resource, + policy, + }; + + // Run request + const response = await runClient.setIamPolicy(request); + console.log(response); + } + + callSetIamPolicy(); + // [END run_v2_generated_WorkerPools_SetIamPolicy_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-run/samples/generated/v2/worker_pools.test_iam_permissions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js new file mode 100644 index 00000000000..ea171ddf125 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, permissions) { + // [START run_v2_generated_WorkerPools_TestIamPermissions_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 resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = ['abc','def'] + + // Imports the Run library + const {WorkerPoolsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new WorkerPoolsClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await runClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END run_v2_generated_WorkerPools_TestIamPermissions_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-run/samples/generated/v2/worker_pools.update_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js new file mode 100644 index 00000000000..43bcb8e1cfe --- /dev/null +++ b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workerPool) { + // [START run_v2_generated_WorkerPools_UpdateWorkerPool_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. + */ + /** + * Optional. The list of fields to be updated. + */ + // const updateMask = {} + /** + * Required. The WorkerPool to be updated. + */ + // const workerPool = {} + /** + * Optional. Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + */ + // const validateOnly = true + /** + * Optional. If set to true, and if the WorkerPool does not exist, it will + * create a new one. The caller must have 'run.workerpools.create' permissions + * if this is set to true and the WorkerPool does not exist. + */ + // const allowMissing = true + /** + * Optional. If set to true, a new revision will be created from the template + * even if the system doesn't detect any changes from the previously deployed + * revision. + * This may be useful for cases where the underlying resources need to be + * recreated or reinitialized. For example if the image is specified by label, + * but the underlying image digest has changed) or if the container performs + * deployment initialization work that needs to be performed again. + */ + // const forceNewRevision = true + + // Imports the Run library + const {WorkerPoolsClient} = require('@google-cloud/run').v2; + + // Instantiates a client + const runClient = new WorkerPoolsClient(); + + async function callUpdateWorkerPool() { + // Construct request + const request = { + workerPool, + }; + + // Run request + const [operation] = await runClient.updateWorkerPool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateWorkerPool(); + // [END run_v2_generated_WorkerPools_UpdateWorkerPool_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-run/src/index.ts b/owl-bot-staging/google-cloud-run/src/index.ts new file mode 100644 index 00000000000..3c28cf6bbfb --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/index.ts @@ -0,0 +1,41 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v2 from './v2'; + +const BuildsClient = v2.BuildsClient; +type BuildsClient = v2.BuildsClient; +const ExecutionsClient = v2.ExecutionsClient; +type ExecutionsClient = v2.ExecutionsClient; +const InstancesClient = v2.InstancesClient; +type InstancesClient = v2.InstancesClient; +const JobsClient = v2.JobsClient; +type JobsClient = v2.JobsClient; +const RevisionsClient = v2.RevisionsClient; +type RevisionsClient = v2.RevisionsClient; +const ServicesClient = v2.ServicesClient; +type ServicesClient = v2.ServicesClient; +const TasksClient = v2.TasksClient; +type TasksClient = v2.TasksClient; +const WorkerPoolsClient = v2.WorkerPoolsClient; +type WorkerPoolsClient = v2.WorkerPoolsClient; + +export {v2, BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; +export default {v2, BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-run/src/v2/builds_client.ts b/owl-bot-staging/google-cloud-run/src/v2/builds_client.ts new file mode 100644 index 00000000000..9cbdf164888 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/builds_client.ts @@ -0,0 +1,974 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, LocationsClient, LocationProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/builds_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './builds_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Run Build Control Plane API + * @class + * @memberof v2 + */ +export class BuildsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('run'); + + 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}; + buildsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BuildsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new BuildsClient({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 BuildsClient; + 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 = 'run.' + 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 = { + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}' + ), + revisionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' + ), + servicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.run.v2.Builds', 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.buildsStub) { + return this.buildsStub; + } + + // Put together the "service stub" for + // google.cloud.run.v2.Builds. + this.buildsStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Builds') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.run.v2.Builds, + 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 buildsStubMethods = + ['submitBuild']; + for (const methodName of buildsStubMethods) { + const callPromise = this.buildsStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.buildsStub; + } + + /** + * 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 'run.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 'run.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 -- + // ------------------- +/** + * Submits a build in a given project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * @param {google.cloud.run.v2.StorageSource} request.storageSource + * Required. Source for the build. + * @param {string} request.imageUri + * Required. Artifact Registry URI to store the built image. + * @param {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} request.buildpackBuild + * Build the source using Buildpacks. + * @param {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} request.dockerBuild + * Build the source using Docker. This means the source has a Dockerfile. + * @param {string} [request.serviceAccount] + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * @param {string} [request.workerPool] + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * @param {string[]} [request.tags] + * Optional. Additional tags to annotate the build. + * @param {string} [request.machineType] + * Optional. The machine type from default pool to use for the build. If left + * blank, cloudbuild will use a sensible default. Currently only E2_HIGHCPU_8 + * is supported. If worker_pool is set, this field will be ignored. + * @param {google.api.LaunchStage} [request.releaseTrack] + * Optional. The release track of the client that initiated the build request. + * @param {string} [request.client] + * Optional. The client that initiated the build request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.run.v2.SubmitBuildResponse|SubmitBuildResponse}. + * 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/v2/builds.submit_build.js + * region_tag:run_v2_generated_Builds_SubmitBuild_async + */ + submitBuild( + request?: protos.google.cloud.run.v2.ISubmitBuildRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.ISubmitBuildResponse, + protos.google.cloud.run.v2.ISubmitBuildRequest|undefined, {}|undefined + ]>; + submitBuild( + request: protos.google.cloud.run.v2.ISubmitBuildRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.run.v2.ISubmitBuildResponse, + protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, + {}|null|undefined>): void; + submitBuild( + request: protos.google.cloud.run.v2.ISubmitBuildRequest, + callback: Callback< + protos.google.cloud.run.v2.ISubmitBuildResponse, + protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, + {}|null|undefined>): void; + submitBuild( + request?: protos.google.cloud.run.v2.ISubmitBuildRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.run.v2.ISubmitBuildResponse, + protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.run.v2.ISubmitBuildResponse, + protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.run.v2.ISubmitBuildResponse, + protos.google.cloud.run.v2.ISubmitBuildRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('submitBuild request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.run.v2.ISubmitBuildResponse, + protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('submitBuild response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.submitBuild(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.run.v2.ISubmitBuildResponse, + protos.google.cloud.run.v2.ISubmitBuildRequest|undefined, + {}|undefined + ]) => { + this._log.info('submitBuild response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Gets information about a 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,job:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the job from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the job. + */ + matchJobFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).job; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified 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 revision resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @param {string} revision + * @returns {string} Resource name string. + */ + revisionPath(project:string,location:string,service:string,revision:string) { + return this.pathTemplates.revisionPathTemplate.render({ + project: project, + location: location, + service: service, + revision: revision, + }); + } + + /** + * Parse the project from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).project; + } + + /** + * Parse the location from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).location; + } + + /** + * Parse the service from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the service. + */ + matchServiceFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).service; + } + + /** + * Parse the revision from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the revision. + */ + matchRevisionFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; + } + + /** + * Return a fully-qualified service resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @returns {string} Resource name string. + */ + servicePath(project:string,location:string,service:string) { + return this.pathTemplates.servicePathTemplate.render({ + project: project, + location: location, + service: service, + }); + } + + /** + * Parse the project from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).project; + } + + /** + * Parse the location from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).location; + } + + /** + * Parse the service from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).service; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,execution:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + 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 execution from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).execution; + } + + /** + * 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 workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project:string,location:string,workerPool:string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; + } + + /** + * 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.buildsStub && !this._terminated) { + return this.buildsStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json new file mode 100644 index 00000000000..91ddeab6580 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.run.v2.Builds": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "SubmitBuild": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json new file mode 100644 index 00000000000..0d5d6ea6137 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/run/v2/build.proto", + "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", + "../../protos/google/cloud/run/v2/execution.proto", + "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", + "../../protos/google/cloud/run/v2/instance_split.proto", + "../../protos/google/cloud/run/v2/job.proto", + "../../protos/google/cloud/run/v2/k8s.min.proto", + "../../protos/google/cloud/run/v2/revision.proto", + "../../protos/google/cloud/run/v2/revision_template.proto", + "../../protos/google/cloud/run/v2/service.proto", + "../../protos/google/cloud/run/v2/status.proto", + "../../protos/google/cloud/run/v2/task.proto", + "../../protos/google/cloud/run/v2/task_template.proto", + "../../protos/google/cloud/run/v2/traffic_target.proto", + "../../protos/google/cloud/run/v2/vendor_settings.proto", + "../../protos/google/cloud/run/v2/worker_pool.proto", + "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" +] diff --git a/owl-bot-staging/google-cloud-run/src/v2/executions_client.ts b/owl-bot-staging/google-cloud-run/src/v2/executions_client.ts new file mode 100644 index 00000000000..29b7e4871fb --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/executions_client.ts @@ -0,0 +1,1722 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/executions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './executions_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Run Execution Control Plane API. + * @class + * @memberof v2 + */ +export class ExecutionsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('run'); + + 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; + executionsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ExecutionsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ExecutionsClient({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 ExecutionsClient; + 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 = 'run.' + 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 = { + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + 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}' + ), + revisionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' + ), + servicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // 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 = { + listExecutions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'executions') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const deleteExecutionResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Execution') as gax.protobuf.Type; + const deleteExecutionMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Execution') as gax.protobuf.Type; + const cancelExecutionResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Execution') as gax.protobuf.Type; + const cancelExecutionMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Execution') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteExecution: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteExecutionResponse.decode.bind(deleteExecutionResponse), + deleteExecutionMetadata.decode.bind(deleteExecutionMetadata)), + cancelExecution: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + cancelExecutionResponse.decode.bind(cancelExecutionResponse), + cancelExecutionMetadata.decode.bind(cancelExecutionMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.run.v2.Executions', 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.executionsStub) { + return this.executionsStub; + } + + // Put together the "service stub" for + // google.cloud.run.v2.Executions. + this.executionsStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Executions') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.run.v2.Executions, + 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 executionsStubMethods = + ['getExecution', 'listExecutions', 'deleteExecution', 'cancelExecution']; + for (const methodName of executionsStubMethods) { + const callPromise = this.executionsStub.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.executionsStub; + } + + /** + * 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 'run.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 'run.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 -- + // ------------------- +/** + * Gets information about an Execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the Execution. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.Execution|Execution}. + * 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/v2/executions.get_execution.js + * region_tag:run_v2_generated_Executions_GetExecution_async + */ + getExecution( + request?: protos.google.cloud.run.v2.IGetExecutionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IGetExecutionRequest|undefined, {}|undefined + ]>; + getExecution( + request: protos.google.cloud.run.v2.IGetExecutionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, + {}|null|undefined>): void; + getExecution( + request: protos.google.cloud.run.v2.IGetExecutionRequest, + callback: Callback< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, + {}|null|undefined>): void; + getExecution( + request?: protos.google.cloud.run.v2.IGetExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IGetExecutionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getExecution request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getExecution response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getExecution(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.run.v2.IExecution, + protos.google.cloud.run.v2.IGetExecutionRequest|undefined, + {}|undefined + ]) => { + this._log.info('getExecution response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Deletes an Execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Execution to delete. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * @param {boolean} request.validateOnly + * Indicates that the request should be validated without actually + * deleting any resources. + * @param {string} request.etag + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/executions.delete_execution.js + * region_tag:run_v2_generated_Executions_DeleteExecution_async + */ + deleteExecution( + request?: protos.google.cloud.run.v2.IDeleteExecutionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteExecution( + request: protos.google.cloud.run.v2.IDeleteExecutionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteExecution( + request: protos.google.cloud.run.v2.IDeleteExecutionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteExecution( + request?: protos.google.cloud.run.v2.IDeleteExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteExecution response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteExecution request %j', request); + return this.innerApiCalls.deleteExecution(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteExecution response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteExecution()`. + * @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/v2/executions.delete_execution.js + * region_tag:run_v2_generated_Executions_DeleteExecution_async + */ + async checkDeleteExecutionProgress(name: string): Promise>{ + this._log.info('deleteExecution long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteExecution, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Cancels an Execution. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Execution to cancel. + * Format: + * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, + * where `{project}` can be project id or number. + * @param {boolean} request.validateOnly + * Indicates that the request should be validated without actually + * cancelling any resources. + * @param {string} request.etag + * A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/executions.cancel_execution.js + * region_tag:run_v2_generated_Executions_CancelExecution_async + */ + cancelExecution( + request?: protos.google.cloud.run.v2.ICancelExecutionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + cancelExecution( + request: protos.google.cloud.run.v2.ICancelExecutionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + cancelExecution( + request: protos.google.cloud.run.v2.ICancelExecutionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + cancelExecution( + request?: protos.google.cloud.run.v2.ICancelExecutionRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('cancelExecution response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('cancelExecution request %j', request); + return this.innerApiCalls.cancelExecution(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('cancelExecution response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `cancelExecution()`. + * @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/v2/executions.cancel_execution.js + * region_tag:run_v2_generated_Executions_CancelExecution_async + */ + async checkCancelExecutionProgress(name: string): Promise>{ + this._log.info('cancelExecution long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.cancelExecution, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Executions from a Job. Results are sorted by creation time, + * descending. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * @param {number} request.pageSize + * Maximum number of Executions to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.run.v2.Execution|Execution}. + * 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 `listExecutionsAsync()` + * 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. + */ + listExecutions( + request?: protos.google.cloud.run.v2.IListExecutionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IExecution[], + protos.google.cloud.run.v2.IListExecutionsRequest|null, + protos.google.cloud.run.v2.IListExecutionsResponse + ]>; + listExecutions( + request: protos.google.cloud.run.v2.IListExecutionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListExecutionsRequest, + protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, + protos.google.cloud.run.v2.IExecution>): void; + listExecutions( + request: protos.google.cloud.run.v2.IListExecutionsRequest, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListExecutionsRequest, + protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, + protos.google.cloud.run.v2.IExecution>): void; + listExecutions( + request?: protos.google.cloud.run.v2.IListExecutionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.run.v2.IListExecutionsRequest, + protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, + protos.google.cloud.run.v2.IExecution>, + callback?: PaginationCallback< + protos.google.cloud.run.v2.IListExecutionsRequest, + protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, + protos.google.cloud.run.v2.IExecution>): + Promise<[ + protos.google.cloud.run.v2.IExecution[], + protos.google.cloud.run.v2.IListExecutionsRequest|null, + protos.google.cloud.run.v2.IListExecutionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.run.v2.IListExecutionsRequest, + protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, + protos.google.cloud.run.v2.IExecution>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listExecutions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listExecutions request %j', request); + return this.innerApiCalls + .listExecutions(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.run.v2.IExecution[], + protos.google.cloud.run.v2.IListExecutionsRequest|null, + protos.google.cloud.run.v2.IListExecutionsResponse + ]) => { + this._log.info('listExecutions values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listExecutions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * @param {number} request.pageSize + * Maximum number of Executions to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.Execution|Execution} 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 `listExecutionsAsync()` + * 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. + */ + listExecutionsStream( + request?: protos.google.cloud.run.v2.IListExecutionsRequest, + 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['listExecutions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listExecutions stream %j', request); + return this.descriptors.page.listExecutions.createStream( + this.innerApiCalls.listExecutions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listExecutions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Execution from which the Executions should be listed. + * To list all Executions across Jobs, use "-" instead of Job name. + * Format: `projects/{project}/locations/{location}/jobs/{job}`, where + * `{project}` can be project id or number. + * @param {number} request.pageSize + * Maximum number of Executions to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListExecutions. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.Execution|Execution}. 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/v2/executions.list_executions.js + * region_tag:run_v2_generated_Executions_ListExecutions_async + */ + listExecutionsAsync( + request?: protos.google.cloud.run.v2.IListExecutionsRequest, + 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['listExecutions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listExecutions iterate %j', request); + return this.descriptors.page.listExecutions.asyncIterate( + this.innerApiCalls['listExecutions'] 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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,job:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the job from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the job. + */ + matchJobFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).job; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified 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 revision resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @param {string} revision + * @returns {string} Resource name string. + */ + revisionPath(project:string,location:string,service:string,revision:string) { + return this.pathTemplates.revisionPathTemplate.render({ + project: project, + location: location, + service: service, + revision: revision, + }); + } + + /** + * Parse the project from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).project; + } + + /** + * Parse the location from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).location; + } + + /** + * Parse the service from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the service. + */ + matchServiceFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).service; + } + + /** + * Parse the revision from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the revision. + */ + matchRevisionFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; + } + + /** + * Return a fully-qualified service resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @returns {string} Resource name string. + */ + servicePath(project:string,location:string,service:string) { + return this.pathTemplates.servicePathTemplate.render({ + project: project, + location: location, + service: service, + }); + } + + /** + * Parse the project from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).project; + } + + /** + * Parse the location from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).location; + } + + /** + * Parse the service from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).service; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,execution:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + 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 execution from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).execution; + } + + /** + * 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 workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project:string,location:string,workerPool:string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; + } + + /** + * 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.executionsStub && !this._terminated) { + return this.executionsStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json new file mode 100644 index 00000000000..20bcbf69f35 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.run.v2.Executions": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListExecutions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelExecution": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json new file mode 100644 index 00000000000..0d5d6ea6137 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/run/v2/build.proto", + "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", + "../../protos/google/cloud/run/v2/execution.proto", + "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", + "../../protos/google/cloud/run/v2/instance_split.proto", + "../../protos/google/cloud/run/v2/job.proto", + "../../protos/google/cloud/run/v2/k8s.min.proto", + "../../protos/google/cloud/run/v2/revision.proto", + "../../protos/google/cloud/run/v2/revision_template.proto", + "../../protos/google/cloud/run/v2/service.proto", + "../../protos/google/cloud/run/v2/status.proto", + "../../protos/google/cloud/run/v2/task.proto", + "../../protos/google/cloud/run/v2/task_template.proto", + "../../protos/google/cloud/run/v2/traffic_target.proto", + "../../protos/google/cloud/run/v2/vendor_settings.proto", + "../../protos/google/cloud/run/v2/worker_pool.proto", + "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" +] diff --git a/owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json b/owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json new file mode 100644 index 00000000000..2276e2b6394 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json @@ -0,0 +1,559 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.run.v2", + "libraryPackage": "@google-cloud/run", + "services": { + "Builds": { + "clients": { + "grpc": { + "libraryClient": "BuildsClient", + "rpcs": { + "SubmitBuild": { + "methods": [ + "submitBuild" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BuildsClient", + "rpcs": { + "SubmitBuild": { + "methods": [ + "submitBuild" + ] + } + } + } + } + }, + "Executions": { + "clients": { + "grpc": { + "libraryClient": "ExecutionsClient", + "rpcs": { + "GetExecution": { + "methods": [ + "getExecution" + ] + }, + "DeleteExecution": { + "methods": [ + "deleteExecution" + ] + }, + "CancelExecution": { + "methods": [ + "cancelExecution" + ] + }, + "ListExecutions": { + "methods": [ + "listExecutions", + "listExecutionsStream", + "listExecutionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ExecutionsClient", + "rpcs": { + "GetExecution": { + "methods": [ + "getExecution" + ] + }, + "DeleteExecution": { + "methods": [ + "deleteExecution" + ] + }, + "CancelExecution": { + "methods": [ + "cancelExecution" + ] + }, + "ListExecutions": { + "methods": [ + "listExecutions", + "listExecutionsStream", + "listExecutionsAsync" + ] + } + } + } + } + }, + "Instances": { + "clients": { + "grpc": { + "libraryClient": "InstancesClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "StopInstance": { + "methods": [ + "stopInstance" + ] + }, + "StartInstance": { + "methods": [ + "startInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InstancesClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "StopInstance": { + "methods": [ + "stopInstance" + ] + }, + "StartInstance": { + "methods": [ + "startInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + }, + "Jobs": { + "clients": { + "grpc": { + "libraryClient": "JobsClient", + "rpcs": { + "GetJob": { + "methods": [ + "getJob" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "RunJob": { + "methods": [ + "runJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "JobsClient", + "rpcs": { + "GetJob": { + "methods": [ + "getJob" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "RunJob": { + "methods": [ + "runJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + } + } + } + } + }, + "Revisions": { + "clients": { + "grpc": { + "libraryClient": "RevisionsClient", + "rpcs": { + "GetRevision": { + "methods": [ + "getRevision" + ] + }, + "DeleteRevision": { + "methods": [ + "deleteRevision" + ] + }, + "ListRevisions": { + "methods": [ + "listRevisions", + "listRevisionsStream", + "listRevisionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RevisionsClient", + "rpcs": { + "GetRevision": { + "methods": [ + "getRevision" + ] + }, + "DeleteRevision": { + "methods": [ + "deleteRevision" + ] + }, + "ListRevisions": { + "methods": [ + "listRevisions", + "listRevisionsStream", + "listRevisionsAsync" + ] + } + } + } + } + }, + "Services": { + "clients": { + "grpc": { + "libraryClient": "ServicesClient", + "rpcs": { + "GetService": { + "methods": [ + "getService" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateService": { + "methods": [ + "createService" + ] + }, + "UpdateService": { + "methods": [ + "updateService" + ] + }, + "DeleteService": { + "methods": [ + "deleteService" + ] + }, + "ListServices": { + "methods": [ + "listServices", + "listServicesStream", + "listServicesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ServicesClient", + "rpcs": { + "GetService": { + "methods": [ + "getService" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateService": { + "methods": [ + "createService" + ] + }, + "UpdateService": { + "methods": [ + "updateService" + ] + }, + "DeleteService": { + "methods": [ + "deleteService" + ] + }, + "ListServices": { + "methods": [ + "listServices", + "listServicesStream", + "listServicesAsync" + ] + } + } + } + } + }, + "Tasks": { + "clients": { + "grpc": { + "libraryClient": "TasksClient", + "rpcs": { + "GetTask": { + "methods": [ + "getTask" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TasksClient", + "rpcs": { + "GetTask": { + "methods": [ + "getTask" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + } + } + } + } + }, + "WorkerPools": { + "clients": { + "grpc": { + "libraryClient": "WorkerPoolsClient", + "rpcs": { + "GetWorkerPool": { + "methods": [ + "getWorkerPool" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateWorkerPool": { + "methods": [ + "createWorkerPool" + ] + }, + "UpdateWorkerPool": { + "methods": [ + "updateWorkerPool" + ] + }, + "DeleteWorkerPool": { + "methods": [ + "deleteWorkerPool" + ] + }, + "ListWorkerPools": { + "methods": [ + "listWorkerPools", + "listWorkerPoolsStream", + "listWorkerPoolsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WorkerPoolsClient", + "rpcs": { + "GetWorkerPool": { + "methods": [ + "getWorkerPool" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "CreateWorkerPool": { + "methods": [ + "createWorkerPool" + ] + }, + "UpdateWorkerPool": { + "methods": [ + "updateWorkerPool" + ] + }, + "DeleteWorkerPool": { + "methods": [ + "deleteWorkerPool" + ] + }, + "ListWorkerPools": { + "methods": [ + "listWorkerPools", + "listWorkerPoolsStream", + "listWorkerPoolsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-run/src/v2/index.ts b/owl-bot-staging/google-cloud-run/src/v2/index.ts new file mode 100644 index 00000000000..6cc79ce5e90 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/index.ts @@ -0,0 +1,26 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {BuildsClient} from './builds_client'; +export {ExecutionsClient} from './executions_client'; +export {InstancesClient} from './instances_client'; +export {JobsClient} from './jobs_client'; +export {RevisionsClient} from './revisions_client'; +export {ServicesClient} from './services_client'; +export {TasksClient} from './tasks_client'; +export {WorkerPoolsClient} from './worker_pools_client'; diff --git a/owl-bot-staging/google-cloud-run/src/v2/instances_client.ts b/owl-bot-staging/google-cloud-run/src/v2/instances_client.ts new file mode 100644 index 00000000000..8f9acb8e849 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/instances_client.ts @@ -0,0 +1,2090 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/instances_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './instances_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Cloud Run Instances API allows you to manage Cloud Run Instances. + * @class + * @memberof v2 + */ +export class InstancesClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('run'); + + 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; + instancesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InstancesClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new InstancesClient({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 InstancesClient; + 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 = 'run.' + 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 = { + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + 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}' + ), + revisionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' + ), + servicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // 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 = { + listInstances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Instance') as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Instance') as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Instance') as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Instance') as gax.protobuf.Type; + const stopInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Instance') as gax.protobuf.Type; + const stopInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Instance') as gax.protobuf.Type; + const startInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Instance') as gax.protobuf.Type; + const startInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Instance') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata)), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), + stopInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + stopInstanceResponse.decode.bind(stopInstanceResponse), + stopInstanceMetadata.decode.bind(stopInstanceMetadata)), + startInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + startInstanceResponse.decode.bind(startInstanceResponse), + startInstanceMetadata.decode.bind(startInstanceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.run.v2.Instances', 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.instancesStub) { + return this.instancesStub; + } + + // Put together the "service stub" for + // google.cloud.run.v2.Instances. + this.instancesStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Instances') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.run.v2.Instances, + 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 instancesStubMethods = + ['createInstance', 'deleteInstance', 'getInstance', 'listInstances', 'stopInstance', 'startInstance']; + for (const methodName of instancesStubMethods) { + const callPromise = this.instancesStub.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.instancesStub; + } + + /** + * 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 'run.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 'run.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 -- + // ------------------- +/** + * Gets a Instance + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.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.run.v2.Instance|Instance}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/instances.get_instance.js + * region_tag:run_v2_generated_Instances_GetInstance_async + */ + getInstance( + request?: protos.google.cloud.run.v2.IGetInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IInstance, + protos.google.cloud.run.v2.IGetInstanceRequest|undefined, {}|undefined + ]>; + getInstance( + request: protos.google.cloud.run.v2.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.run.v2.IInstance, + protos.google.cloud.run.v2.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request: protos.google.cloud.run.v2.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.run.v2.IInstance, + protos.google.cloud.run.v2.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request?: protos.google.cloud.run.v2.IGetInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.run.v2.IInstance, + protos.google.cloud.run.v2.IGetInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.run.v2.IInstance, + protos.google.cloud.run.v2.IGetInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.run.v2.IInstance, + protos.google.cloud.run.v2.IGetInstanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getInstance request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.run.v2.IInstance, + protos.google.cloud.run.v2.IGetInstanceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInstance(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.run.v2.IInstance, + protos.google.cloud.run.v2.IGetInstanceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates an Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * @param {google.cloud.run.v2.Instance} request.instance + * @param {string} request.instanceId + * Required. The unique identifier for the Instance. It must begin with + * letter, and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the instance becomes {parent}/instances/{instance_id}. + * @param {boolean} [request.validateOnly] + * Optional. Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/instances.create_instance.js + * region_tag:run_v2_generated_Instances_CreateInstance_async + */ + createInstance( + request?: protos.google.cloud.run.v2.ICreateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstance( + request: protos.google.cloud.run.v2.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request: protos.google.cloud.run.v2.ICreateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request?: protos.google.cloud.run.v2.ICreateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstance request %j', request); + return this.innerApiCalls.createInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInstance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/instances.create_instance.js + * region_tag:run_v2_generated_Instances_CreateInstance_async + */ + async checkCreateInstanceProgress(name: string): Promise>{ + this._log.info('createInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Instance + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * @param {boolean} [request.validateOnly] + * Optional. Indicates that the request should be validated without actually + * deleting any resources. + * @param {string} [request.etag] + * Optional. A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/instances.delete_instance.js + * region_tag:run_v2_generated_Instances_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.run.v2.IDeleteInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInstance( + request: protos.google.cloud.run.v2.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request: protos.google.cloud.run.v2.IDeleteInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request?: protos.google.cloud.run.v2.IDeleteInstanceRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInstance request %j', request); + return this.innerApiCalls.deleteInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteInstance()`. + * @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/v2/instances.delete_instance.js + * region_tag:run_v2_generated_Instances_DeleteInstance_async + */ + async checkDeleteInstanceProgress(name: string): Promise>{ + this._log.info('deleteInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Stops an Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Instance to stop. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}`, + * where `{project}` can be project id or number. + * @param {boolean} [request.validateOnly] + * Optional. Indicates that the request should be validated without actually + * stopping any resources. + * @param {string} [request.etag] + * Optional. A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/instances.stop_instance.js + * region_tag:run_v2_generated_Instances_StopInstance_async + */ + stopInstance( + request?: protos.google.cloud.run.v2.IStopInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + stopInstance( + request: protos.google.cloud.run.v2.IStopInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + stopInstance( + request: protos.google.cloud.run.v2.IStopInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + stopInstance( + request?: protos.google.cloud.run.v2.IStopInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('stopInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('stopInstance request %j', request); + return this.innerApiCalls.stopInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('stopInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `stopInstance()`. + * @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/v2/instances.stop_instance.js + * region_tag:run_v2_generated_Instances_StopInstance_async + */ + async checkStopInstanceProgress(name: string): Promise>{ + this._log.info('stopInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.stopInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Starts an Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Instance to stop. + * Format: + * `projects/{project}/locations/{location}/instances/{instance}`, + * where `{project}` can be project id or number. + * @param {boolean} [request.validateOnly] + * Optional. Indicates that the request should be validated without actually + * stopping any resources. + * @param {string} [request.etag] + * Optional. A system-generated fingerprint for this version of the resource. + * This may be used to detect modification conflict during updates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/instances.start_instance.js + * region_tag:run_v2_generated_Instances_StartInstance_async + */ + startInstance( + request?: protos.google.cloud.run.v2.IStartInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + startInstance( + request: protos.google.cloud.run.v2.IStartInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + startInstance( + request: protos.google.cloud.run.v2.IStartInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + startInstance( + request?: protos.google.cloud.run.v2.IStartInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('startInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('startInstance request %j', request); + return this.innerApiCalls.startInstance(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('startInstance response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `startInstance()`. + * @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/v2/instances.start_instance.js + * region_tag:run_v2_generated_Instances_StartInstance_async + */ + async checkStartInstanceProgress(name: string): Promise>{ + this._log.info('startInstance long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.startInstance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Instances. Results are sorted by creation time, descending. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @param {number} [request.pageSize] + * Optional. Maximum number of Instances to return in this call. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous call to ListInstances. + * All other parameters must match. + * @param {boolean} [request.showDeleted] + * Optional. If true, returns deleted (but unexpired) resources along with + * active ones. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.run.v2.Instance|Instance}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstances( + request?: protos.google.cloud.run.v2.IListInstancesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IInstance[], + protos.google.cloud.run.v2.IListInstancesRequest|null, + protos.google.cloud.run.v2.IListInstancesResponse + ]>; + listInstances( + request: protos.google.cloud.run.v2.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListInstancesRequest, + protos.google.cloud.run.v2.IListInstancesResponse|null|undefined, + protos.google.cloud.run.v2.IInstance>): void; + listInstances( + request: protos.google.cloud.run.v2.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListInstancesRequest, + protos.google.cloud.run.v2.IListInstancesResponse|null|undefined, + protos.google.cloud.run.v2.IInstance>): void; + listInstances( + request?: protos.google.cloud.run.v2.IListInstancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.run.v2.IListInstancesRequest, + protos.google.cloud.run.v2.IListInstancesResponse|null|undefined, + protos.google.cloud.run.v2.IInstance>, + callback?: PaginationCallback< + protos.google.cloud.run.v2.IListInstancesRequest, + protos.google.cloud.run.v2.IListInstancesResponse|null|undefined, + protos.google.cloud.run.v2.IInstance>): + Promise<[ + protos.google.cloud.run.v2.IInstance[], + protos.google.cloud.run.v2.IListInstancesRequest|null, + protos.google.cloud.run.v2.IListInstancesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.run.v2.IListInstancesRequest, + protos.google.cloud.run.v2.IListInstancesResponse|null|undefined, + protos.google.cloud.run.v2.IInstance>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.run.v2.IInstance[], + protos.google.cloud.run.v2.IListInstancesRequest|null, + protos.google.cloud.run.v2.IListInstancesResponse + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInstances`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @param {number} [request.pageSize] + * Optional. Maximum number of Instances to return in this call. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous call to ListInstances. + * All other parameters must match. + * @param {boolean} [request.showDeleted] + * Optional. If true, returns deleted (but unexpired) resources along with + * active ones. + * @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.run.v2.Instance|Instance} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancesStream( + request?: protos.google.cloud.run.v2.IListInstancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstances stream %j', request); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstances`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @param {number} [request.pageSize] + * Optional. Maximum number of Instances to return in this call. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous call to ListInstances. + * All other parameters must match. + * @param {boolean} [request.showDeleted] + * Optional. If true, returns deleted (but unexpired) resources along with + * active ones. + * @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.run.v2.Instance|Instance}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/instances.list_instances.js + * region_tag:run_v2_generated_Instances_ListInstances_async + */ + listInstancesAsync( + request?: protos.google.cloud.run.v2.IListInstancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInstances iterate %j', request); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * 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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,job:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the job from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the job. + */ + matchJobFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).job; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified 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 revision resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @param {string} revision + * @returns {string} Resource name string. + */ + revisionPath(project:string,location:string,service:string,revision:string) { + return this.pathTemplates.revisionPathTemplate.render({ + project: project, + location: location, + service: service, + revision: revision, + }); + } + + /** + * Parse the project from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).project; + } + + /** + * Parse the location from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).location; + } + + /** + * Parse the service from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the service. + */ + matchServiceFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).service; + } + + /** + * Parse the revision from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the revision. + */ + matchRevisionFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; + } + + /** + * Return a fully-qualified service resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @returns {string} Resource name string. + */ + servicePath(project:string,location:string,service:string) { + return this.pathTemplates.servicePathTemplate.render({ + project: project, + location: location, + service: service, + }); + } + + /** + * Parse the project from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).project; + } + + /** + * Parse the location from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).location; + } + + /** + * Parse the service from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).service; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,execution:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + 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 execution from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).execution; + } + + /** + * 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 workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project:string,location:string,workerPool:string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; + } + + /** + * 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.instancesStub && !this._terminated) { + return this.instancesStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/instances_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/instances_client_config.json new file mode 100644 index 00000000000..12dcd7909a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/instances_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.run.v2.Instances": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StopInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-run/src/v2/instances_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/instances_proto_list.json new file mode 100644 index 00000000000..0d5d6ea6137 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/instances_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/run/v2/build.proto", + "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", + "../../protos/google/cloud/run/v2/execution.proto", + "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", + "../../protos/google/cloud/run/v2/instance_split.proto", + "../../protos/google/cloud/run/v2/job.proto", + "../../protos/google/cloud/run/v2/k8s.min.proto", + "../../protos/google/cloud/run/v2/revision.proto", + "../../protos/google/cloud/run/v2/revision_template.proto", + "../../protos/google/cloud/run/v2/service.proto", + "../../protos/google/cloud/run/v2/status.proto", + "../../protos/google/cloud/run/v2/task.proto", + "../../protos/google/cloud/run/v2/task_template.proto", + "../../protos/google/cloud/run/v2/traffic_target.proto", + "../../protos/google/cloud/run/v2/vendor_settings.proto", + "../../protos/google/cloud/run/v2/worker_pool.proto", + "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" +] diff --git a/owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts b/owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts new file mode 100644 index 00000000000..dff326d9416 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts @@ -0,0 +1,2361 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/jobs_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './jobs_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Run Job Control Plane API. + * @class + * @memberof v2 + */ +export class JobsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('run'); + + 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; + jobsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of JobsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new JobsClient({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 JobsClient; + 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 = 'run.' + 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 = { + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + 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}' + ), + revisionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' + ), + servicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // 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') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createJobResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Job') as gax.protobuf.Type; + const createJobMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Job') as gax.protobuf.Type; + const updateJobResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Job') as gax.protobuf.Type; + const updateJobMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Job') as gax.protobuf.Type; + const deleteJobResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Job') as gax.protobuf.Type; + const deleteJobMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Job') as gax.protobuf.Type; + const runJobResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Execution') as gax.protobuf.Type; + const runJobMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Execution') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createJobResponse.decode.bind(createJobResponse), + createJobMetadata.decode.bind(createJobMetadata)), + updateJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateJobResponse.decode.bind(updateJobResponse), + updateJobMetadata.decode.bind(updateJobMetadata)), + deleteJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteJobResponse.decode.bind(deleteJobResponse), + deleteJobMetadata.decode.bind(deleteJobMetadata)), + runJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runJobResponse.decode.bind(runJobResponse), + runJobMetadata.decode.bind(runJobMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.run.v2.Jobs', 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.jobsStub) { + return this.jobsStub; + } + + // Put together the "service stub" for + // google.cloud.run.v2.Jobs. + this.jobsStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Jobs') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.run.v2.Jobs, + 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 jobsStubMethods = + ['createJob', 'getJob', 'listJobs', 'updateJob', 'deleteJob', 'runJob', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; + for (const methodName of jobsStubMethods) { + const callPromise = this.jobsStub.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.jobsStub; + } + + /** + * 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 'run.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 'run.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 -- + // ------------------- +/** + * Gets information about a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.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/v2/jobs.get_job.js + * region_tag:run_v2_generated_Jobs_GetJob_async + */ + getJob( + request?: protos.google.cloud.run.v2.IGetJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IJob, + protos.google.cloud.run.v2.IGetJobRequest|undefined, {}|undefined + ]>; + getJob( + request: protos.google.cloud.run.v2.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.run.v2.IJob, + protos.google.cloud.run.v2.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request: protos.google.cloud.run.v2.IGetJobRequest, + callback: Callback< + protos.google.cloud.run.v2.IJob, + protos.google.cloud.run.v2.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request?: protos.google.cloud.run.v2.IGetJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.run.v2.IJob, + protos.google.cloud.run.v2.IGetJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.run.v2.IJob, + protos.google.cloud.run.v2.IGetJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.run.v2.IJob, + protos.google.cloud.run.v2.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 || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getJob request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.run.v2.IJob, + protos.google.cloud.run.v2.IGetJobRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getJob(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.run.v2.IJob, + protos.google.cloud.run.v2.IGetJobRequest|undefined, + {}|undefined + ]) => { + this._log.info('getJob response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets the IAM Access Control policy currently in effect for the given Job. + * This result does not include any inherited policies. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/jobs.get_iam_policy.js + * region_tag:run_v2_generated_Jobs_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Sets the IAM Access control policy for the specified Job. Overwrites + * any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/jobs.set_iam_policy.js + * region_tag:run_v2_generated_Jobs_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/jobs.test_iam_permissions.js + * region_tag:run_v2_generated_Jobs_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project in which this Job should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @param {google.cloud.run.v2.Job} request.job + * Required. The Job instance to create. + * @param {string} request.jobId + * Required. The unique identifier for the Job. The name of the job becomes + * {parent}/jobs/{job_id}. + * @param {boolean} request.validateOnly + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.create_job.js + * region_tag:run_v2_generated_Jobs_CreateJob_async + */ + createJob( + request?: protos.google.cloud.run.v2.ICreateJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createJob( + request: protos.google.cloud.run.v2.ICreateJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createJob( + request: protos.google.cloud.run.v2.ICreateJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createJob( + request?: protos.google.cloud.run.v2.ICreateJobRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createJob request %j', request); + return this.innerApiCalls.createJob(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createJob response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createJob()`. + * @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/v2/jobs.create_job.js + * region_tag:run_v2_generated_Jobs_CreateJob_async + */ + async checkCreateJobProgress(name: string): Promise>{ + this._log.info('createJob long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.run.v2.Job} request.job + * Required. The Job to be updated. + * @param {boolean} request.validateOnly + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * @param {boolean} [request.allowMissing] + * Optional. If set to true, and if the Job does not exist, it will create a + * new one. Caller must have both create and update permissions for this call + * if this is set to true. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.update_job.js + * region_tag:run_v2_generated_Jobs_UpdateJob_async + */ + updateJob( + request?: protos.google.cloud.run.v2.IUpdateJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateJob( + request: protos.google.cloud.run.v2.IUpdateJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateJob( + request: protos.google.cloud.run.v2.IUpdateJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateJob( + request?: protos.google.cloud.run.v2.IUpdateJobRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.job?.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateJob request %j', request); + return this.innerApiCalls.updateJob(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateJob response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateJob()`. + * @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/v2/jobs.update_job.js + * region_tag:run_v2_generated_Jobs_UpdateJob_async + */ + async checkUpdateJobProgress(name: string): Promise>{ + this._log.info('updateJob long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * @param {boolean} request.validateOnly + * Indicates that the request should be validated without actually + * deleting any resources. + * @param {string} request.etag + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.delete_job.js + * region_tag:run_v2_generated_Jobs_DeleteJob_async + */ + deleteJob( + request?: protos.google.cloud.run.v2.IDeleteJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteJob( + request: protos.google.cloud.run.v2.IDeleteJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteJob( + request: protos.google.cloud.run.v2.IDeleteJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteJob( + request?: protos.google.cloud.run.v2.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 || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteJob request %j', request); + return this.innerApiCalls.deleteJob(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteJob response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * 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/v2/jobs.delete_job.js + * region_tag:run_v2_generated_Jobs_DeleteJob_async + */ + async checkDeleteJobProgress(name: string): Promise>{ + this._log.info('deleteJob long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Triggers creation of a new Execution of this Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the Job. + * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} + * can be project id or number. + * @param {boolean} request.validateOnly + * Indicates that the request should be validated without actually + * deleting any resources. + * @param {string} request.etag + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * @param {google.cloud.run.v2.RunJobRequest.Overrides} request.overrides + * Overrides specification for a given execution of a job. If provided, + * overrides will be applied to update the execution or task spec. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.run_job.js + * region_tag:run_v2_generated_Jobs_RunJob_async + */ + runJob( + request?: protos.google.cloud.run.v2.IRunJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + runJob( + request: protos.google.cloud.run.v2.IRunJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runJob( + request: protos.google.cloud.run.v2.IRunJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runJob( + request?: protos.google.cloud.run.v2.IRunJobRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runJob request %j', request); + return this.innerApiCalls.runJob(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('runJob response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `runJob()`. + * @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/v2/jobs.run_job.js + * region_tag:run_v2_generated_Jobs_RunJob_async + */ + async checkRunJobProgress(name: string): Promise>{ + this._log.info('runJob long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Jobs. Results are sorted by creation time, descending. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @param {number} request.pageSize + * Maximum number of Jobs to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.run.v2.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.run.v2.IListJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IJob[], + protos.google.cloud.run.v2.IListJobsRequest|null, + protos.google.cloud.run.v2.IListJobsResponse + ]>; + listJobs( + request: protos.google.cloud.run.v2.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListJobsRequest, + protos.google.cloud.run.v2.IListJobsResponse|null|undefined, + protos.google.cloud.run.v2.IJob>): void; + listJobs( + request: protos.google.cloud.run.v2.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListJobsRequest, + protos.google.cloud.run.v2.IListJobsResponse|null|undefined, + protos.google.cloud.run.v2.IJob>): void; + listJobs( + request?: protos.google.cloud.run.v2.IListJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.run.v2.IListJobsRequest, + protos.google.cloud.run.v2.IListJobsResponse|null|undefined, + protos.google.cloud.run.v2.IJob>, + callback?: PaginationCallback< + protos.google.cloud.run.v2.IListJobsRequest, + protos.google.cloud.run.v2.IListJobsResponse|null|undefined, + protos.google.cloud.run.v2.IJob>): + Promise<[ + protos.google.cloud.run.v2.IJob[], + protos.google.cloud.run.v2.IListJobsRequest|null, + protos.google.cloud.run.v2.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 || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.run.v2.IListJobsRequest, + protos.google.cloud.run.v2.IListJobsResponse|null|undefined, + protos.google.cloud.run.v2.IJob>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listJobs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listJobs request %j', request); + return this.innerApiCalls + .listJobs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.run.v2.IJob[], + protos.google.cloud.run.v2.IListJobsRequest|null, + protos.google.cloud.run.v2.IListJobsResponse + ]) => { + this._log.info('listJobs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listJobs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @param {number} request.pageSize + * Maximum number of Jobs to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.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.run.v2.IListJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listJobs stream %j', request); + 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 + * Required. The location and project to list resources on. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. + * @param {number} request.pageSize + * Maximum number of Jobs to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListJobs. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.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/v2/jobs.list_jobs.js + * region_tag:run_v2_generated_Jobs_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.run.v2.IListJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listJobs iterate %j', request); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] 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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,job:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the job from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the job. + */ + matchJobFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).job; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified 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 revision resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @param {string} revision + * @returns {string} Resource name string. + */ + revisionPath(project:string,location:string,service:string,revision:string) { + return this.pathTemplates.revisionPathTemplate.render({ + project: project, + location: location, + service: service, + revision: revision, + }); + } + + /** + * Parse the project from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).project; + } + + /** + * Parse the location from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).location; + } + + /** + * Parse the service from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the service. + */ + matchServiceFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).service; + } + + /** + * Parse the revision from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the revision. + */ + matchRevisionFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; + } + + /** + * Return a fully-qualified service resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @returns {string} Resource name string. + */ + servicePath(project:string,location:string,service:string) { + return this.pathTemplates.servicePathTemplate.render({ + project: project, + location: location, + service: service, + }); + } + + /** + * Parse the project from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).project; + } + + /** + * Parse the location from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).location; + } + + /** + * Parse the service from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).service; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,execution:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + 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 execution from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).execution; + } + + /** + * 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 workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project:string,location:string,workerPool:string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; + } + + /** + * 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.jobsStub && !this._terminated) { + return this.jobsStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json new file mode 100644 index 00000000000..0751746db74 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json @@ -0,0 +1,62 @@ +{ + "interfaces": { + "google.cloud.run.v2.Jobs": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RunJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json new file mode 100644 index 00000000000..0d5d6ea6137 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/run/v2/build.proto", + "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", + "../../protos/google/cloud/run/v2/execution.proto", + "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", + "../../protos/google/cloud/run/v2/instance_split.proto", + "../../protos/google/cloud/run/v2/job.proto", + "../../protos/google/cloud/run/v2/k8s.min.proto", + "../../protos/google/cloud/run/v2/revision.proto", + "../../protos/google/cloud/run/v2/revision_template.proto", + "../../protos/google/cloud/run/v2/service.proto", + "../../protos/google/cloud/run/v2/status.proto", + "../../protos/google/cloud/run/v2/task.proto", + "../../protos/google/cloud/run/v2/task_template.proto", + "../../protos/google/cloud/run/v2/traffic_target.proto", + "../../protos/google/cloud/run/v2/vendor_settings.proto", + "../../protos/google/cloud/run/v2/worker_pool.proto", + "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" +] diff --git a/owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts b/owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts new file mode 100644 index 00000000000..c2d97a21619 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts @@ -0,0 +1,1716 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/revisions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './revisions_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Run Revision Control Plane API. + * @class + * @memberof v2 + */ +export class RevisionsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('run'); + + 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; + revisionsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RevisionsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new RevisionsClient({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 RevisionsClient; + 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 = 'run.' + 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 = { + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + 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}' + ), + revisionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' + ), + servicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // 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 = { + listRevisions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'revisions') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const deleteRevisionResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Revision') as gax.protobuf.Type; + const deleteRevisionMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Revision') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteRevision: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteRevisionResponse.decode.bind(deleteRevisionResponse), + deleteRevisionMetadata.decode.bind(deleteRevisionMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.run.v2.Revisions', 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.revisionsStub) { + return this.revisionsStub; + } + + // Put together the "service stub" for + // google.cloud.run.v2.Revisions. + this.revisionsStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Revisions') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.run.v2.Revisions, + 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 revisionsStubMethods = + ['getRevision', 'listRevisions', 'deleteRevision']; + for (const methodName of revisionsStubMethods) { + const callPromise = this.revisionsStub.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.revisionsStub; + } + + /** + * 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 'run.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 'run.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 -- + // ------------------- +/** + * Gets information about a Revision. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the Revision. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.Revision|Revision}. + * 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/v2/revisions.get_revision.js + * region_tag:run_v2_generated_Revisions_GetRevision_async + */ + getRevision( + request?: protos.google.cloud.run.v2.IGetRevisionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IRevision, + protos.google.cloud.run.v2.IGetRevisionRequest|undefined, {}|undefined + ]>; + getRevision( + request: protos.google.cloud.run.v2.IGetRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.run.v2.IRevision, + protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, + {}|null|undefined>): void; + getRevision( + request: protos.google.cloud.run.v2.IGetRevisionRequest, + callback: Callback< + protos.google.cloud.run.v2.IRevision, + protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, + {}|null|undefined>): void; + getRevision( + request?: protos.google.cloud.run.v2.IGetRevisionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.run.v2.IRevision, + protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.run.v2.IRevision, + protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.run.v2.IRevision, + protos.google.cloud.run.v2.IGetRevisionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getRevision request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.run.v2.IRevision, + protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRevision response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getRevision(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.run.v2.IRevision, + protos.google.cloud.run.v2.IGetRevisionRequest|undefined, + {}|undefined + ]) => { + this._log.info('getRevision response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Deletes a Revision. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Revision to delete. + * Format: + * projects/{project}/locations/{location}/services/{service}/revisions/{revision} + * @param {boolean} request.validateOnly + * Indicates that the request should be validated without actually + * deleting any resources. + * @param {string} request.etag + * A system-generated fingerprint for this version of the + * resource. This may be used to detect modification conflict during updates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/revisions.delete_revision.js + * region_tag:run_v2_generated_Revisions_DeleteRevision_async + */ + deleteRevision( + request?: protos.google.cloud.run.v2.IDeleteRevisionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteRevision( + request: protos.google.cloud.run.v2.IDeleteRevisionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteRevision( + request: protos.google.cloud.run.v2.IDeleteRevisionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteRevision( + request?: protos.google.cloud.run.v2.IDeleteRevisionRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteRevision response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteRevision request %j', request); + return this.innerApiCalls.deleteRevision(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteRevision response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteRevision()`. + * @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/v2/revisions.delete_revision.js + * region_tag:run_v2_generated_Revisions_DeleteRevision_async + */ + async checkDeleteRevisionProgress(name: string): Promise>{ + this._log.info('deleteRevision long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteRevision, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Revisions from a given Service, or from a given location. Results + * are sorted by creation time, descending. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * @param {number} request.pageSize + * Maximum number of revisions to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.run.v2.Revision|Revision}. + * 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 `listRevisionsAsync()` + * 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. + */ + listRevisions( + request?: protos.google.cloud.run.v2.IListRevisionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IRevision[], + protos.google.cloud.run.v2.IListRevisionsRequest|null, + protos.google.cloud.run.v2.IListRevisionsResponse + ]>; + listRevisions( + request: protos.google.cloud.run.v2.IListRevisionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListRevisionsRequest, + protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, + protos.google.cloud.run.v2.IRevision>): void; + listRevisions( + request: protos.google.cloud.run.v2.IListRevisionsRequest, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListRevisionsRequest, + protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, + protos.google.cloud.run.v2.IRevision>): void; + listRevisions( + request?: protos.google.cloud.run.v2.IListRevisionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.run.v2.IListRevisionsRequest, + protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, + protos.google.cloud.run.v2.IRevision>, + callback?: PaginationCallback< + protos.google.cloud.run.v2.IListRevisionsRequest, + protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, + protos.google.cloud.run.v2.IRevision>): + Promise<[ + protos.google.cloud.run.v2.IRevision[], + protos.google.cloud.run.v2.IListRevisionsRequest|null, + protos.google.cloud.run.v2.IListRevisionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.run.v2.IListRevisionsRequest, + protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, + protos.google.cloud.run.v2.IRevision>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRevisions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRevisions request %j', request); + return this.innerApiCalls + .listRevisions(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.run.v2.IRevision[], + protos.google.cloud.run.v2.IListRevisionsRequest|null, + protos.google.cloud.run.v2.IListRevisionsResponse + ]) => { + this._log.info('listRevisions values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listRevisions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * @param {number} request.pageSize + * Maximum number of revisions to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.Revision|Revision} 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 `listRevisionsAsync()` + * 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. + */ + listRevisionsStream( + request?: protos.google.cloud.run.v2.IListRevisionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listRevisions stream %j', request); + return this.descriptors.page.listRevisions.createStream( + this.innerApiCalls.listRevisions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listRevisions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Service from which the Revisions should be listed. + * To list all Revisions across Services, use "-" instead of Service name. + * Format: + * projects/{project}/locations/{location}/services/{service} + * @param {number} request.pageSize + * Maximum number of revisions to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListRevisions. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.Revision|Revision}. 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/v2/revisions.list_revisions.js + * region_tag:run_v2_generated_Revisions_ListRevisions_async + */ + listRevisionsAsync( + request?: protos.google.cloud.run.v2.IListRevisionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listRevisions iterate %j', request); + return this.descriptors.page.listRevisions.asyncIterate( + this.innerApiCalls['listRevisions'] 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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,job:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the job from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the job. + */ + matchJobFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).job; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified 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 revision resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @param {string} revision + * @returns {string} Resource name string. + */ + revisionPath(project:string,location:string,service:string,revision:string) { + return this.pathTemplates.revisionPathTemplate.render({ + project: project, + location: location, + service: service, + revision: revision, + }); + } + + /** + * Parse the project from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).project; + } + + /** + * Parse the location from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).location; + } + + /** + * Parse the service from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the service. + */ + matchServiceFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).service; + } + + /** + * Parse the revision from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the revision. + */ + matchRevisionFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; + } + + /** + * Return a fully-qualified service resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @returns {string} Resource name string. + */ + servicePath(project:string,location:string,service:string) { + return this.pathTemplates.servicePathTemplate.render({ + project: project, + location: location, + service: service, + }); + } + + /** + * Parse the project from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).project; + } + + /** + * Parse the location from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).location; + } + + /** + * Parse the service from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).service; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,execution:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + 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 execution from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).execution; + } + + /** + * 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 workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project:string,location:string,workerPool:string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; + } + + /** + * 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.revisionsStub && !this._terminated) { + return this.revisionsStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json new file mode 100644 index 00000000000..f5a18a2ed2b --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.run.v2.Revisions": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetRevision": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRevisions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRevision": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json new file mode 100644 index 00000000000..0d5d6ea6137 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/run/v2/build.proto", + "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", + "../../protos/google/cloud/run/v2/execution.proto", + "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", + "../../protos/google/cloud/run/v2/instance_split.proto", + "../../protos/google/cloud/run/v2/job.proto", + "../../protos/google/cloud/run/v2/k8s.min.proto", + "../../protos/google/cloud/run/v2/revision.proto", + "../../protos/google/cloud/run/v2/revision_template.proto", + "../../protos/google/cloud/run/v2/service.proto", + "../../protos/google/cloud/run/v2/status.proto", + "../../protos/google/cloud/run/v2/task.proto", + "../../protos/google/cloud/run/v2/task_template.proto", + "../../protos/google/cloud/run/v2/traffic_target.proto", + "../../protos/google/cloud/run/v2/vendor_settings.proto", + "../../protos/google/cloud/run/v2/worker_pool.proto", + "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" +] diff --git a/owl-bot-staging/google-cloud-run/src/v2/services_client.ts b/owl-bot-staging/google-cloud-run/src/v2/services_client.ts new file mode 100644 index 00000000000..3fabf84fd3c --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/services_client.ts @@ -0,0 +1,2232 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/services_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './services_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Run Service Control Plane API + * @class + * @memberof v2 + */ +export class ServicesClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('run'); + + 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; + servicesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ServicesClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ServicesClient({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 ServicesClient; + 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 = 'run.' + 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 = { + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + 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}' + ), + revisionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' + ), + servicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // 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 = { + listServices: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'services') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createServiceResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Service') as gax.protobuf.Type; + const createServiceMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Service') as gax.protobuf.Type; + const updateServiceResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Service') as gax.protobuf.Type; + const updateServiceMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Service') as gax.protobuf.Type; + const deleteServiceResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.Service') as gax.protobuf.Type; + const deleteServiceMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.Service') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createServiceResponse.decode.bind(createServiceResponse), + createServiceMetadata.decode.bind(createServiceMetadata)), + updateService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateServiceResponse.decode.bind(updateServiceResponse), + updateServiceMetadata.decode.bind(updateServiceMetadata)), + deleteService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteServiceResponse.decode.bind(deleteServiceResponse), + deleteServiceMetadata.decode.bind(deleteServiceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.run.v2.Services', 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.servicesStub) { + return this.servicesStub; + } + + // Put together the "service stub" for + // google.cloud.run.v2.Services. + this.servicesStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Services') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.run.v2.Services, + 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 servicesStubMethods = + ['createService', 'getService', 'listServices', 'updateService', 'deleteService', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; + for (const methodName of servicesStubMethods) { + const callPromise = this.servicesStub.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.servicesStub; + } + + /** + * 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 'run.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 'run.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 -- + // ------------------- +/** + * Gets information about a Service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.Service|Service}. + * 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/v2/services.get_service.js + * region_tag:run_v2_generated_Services_GetService_async + */ + getService( + request?: protos.google.cloud.run.v2.IGetServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IService, + protos.google.cloud.run.v2.IGetServiceRequest|undefined, {}|undefined + ]>; + getService( + request: protos.google.cloud.run.v2.IGetServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.run.v2.IService, + protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, + {}|null|undefined>): void; + getService( + request: protos.google.cloud.run.v2.IGetServiceRequest, + callback: Callback< + protos.google.cloud.run.v2.IService, + protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, + {}|null|undefined>): void; + getService( + request?: protos.google.cloud.run.v2.IGetServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.run.v2.IService, + protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.run.v2.IService, + protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.run.v2.IService, + protos.google.cloud.run.v2.IGetServiceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getService request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.run.v2.IService, + protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getService response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getService(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.run.v2.IService, + protos.google.cloud.run.v2.IGetServiceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getService response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets the IAM Access Control policy currently in effect for the given + * Cloud Run Service. This result does not include any inherited policies. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/services.get_iam_policy.js + * region_tag:run_v2_generated_Services_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Sets the IAM Access control policy for the specified Service. Overwrites + * any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/services.set_iam_policy.js + * region_tag:run_v2_generated_Services_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/services.test_iam_permissions.js + * region_tag:run_v2_generated_Services_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new Service in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project in which this service should be created. + * Format: projects/{project}/locations/{location}, where {project} can be + * project id or number. Only lowercase characters, digits, and hyphens. + * @param {google.cloud.run.v2.Service} request.service + * Required. The Service instance to create. + * @param {string} request.serviceId + * Required. The unique identifier for the Service. It must begin with letter, + * and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the service becomes {parent}/services/{service_id}. + * @param {boolean} request.validateOnly + * Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/services.create_service.js + * region_tag:run_v2_generated_Services_CreateService_async + */ + createService( + request?: protos.google.cloud.run.v2.ICreateServiceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createService( + request: protos.google.cloud.run.v2.ICreateServiceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createService( + request: protos.google.cloud.run.v2.ICreateServiceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createService( + request?: protos.google.cloud.run.v2.ICreateServiceRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createService request %j', request); + return this.innerApiCalls.createService(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createService response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createService()`. + * @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/v2/services.create_service.js + * region_tag:run_v2_generated_Services_CreateService_async + */ + async checkCreateServiceProgress(name: string): Promise>{ + this._log.info('createService long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createService, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a Service. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to be updated. + * @param {google.cloud.run.v2.Service} request.service + * Required. The Service to be updated. + * @param {boolean} request.validateOnly + * Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * @param {boolean} [request.allowMissing] + * Optional. If set to true, and if the Service does not exist, it will create + * a new one. The caller must have 'run.services.create' permissions if this + * is set to true and the Service does not exist. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/services.update_service.js + * region_tag:run_v2_generated_Services_UpdateService_async + */ + updateService( + request?: protos.google.cloud.run.v2.IUpdateServiceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateService( + request: protos.google.cloud.run.v2.IUpdateServiceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateService( + request: protos.google.cloud.run.v2.IUpdateServiceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateService( + request?: protos.google.cloud.run.v2.IUpdateServiceRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.service?.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateService request %j', request); + return this.innerApiCalls.updateService(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateService response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateService()`. + * @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/v2/services.update_service.js + * region_tag:run_v2_generated_Services_UpdateService_async + */ + async checkUpdateServiceProgress(name: string): Promise>{ + this._log.info('updateService long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateService, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Service. + * This will cause the Service to stop serving traffic and will delete all + * revisions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the Service. + * Format: projects/{project}/locations/{location}/services/{service}, where + * {project} can be project id or number. + * @param {boolean} request.validateOnly + * Indicates that the request should be validated without actually + * deleting any resources. + * @param {string} request.etag + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/services.delete_service.js + * region_tag:run_v2_generated_Services_DeleteService_async + */ + deleteService( + request?: protos.google.cloud.run.v2.IDeleteServiceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteService( + request: protos.google.cloud.run.v2.IDeleteServiceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteService( + request: protos.google.cloud.run.v2.IDeleteServiceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteService( + request?: protos.google.cloud.run.v2.IDeleteServiceRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteService request %j', request); + return this.innerApiCalls.deleteService(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteService response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteService()`. + * @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/v2/services.delete_service.js + * region_tag:run_v2_generated_Services_DeleteService_async + */ + async checkDeleteServiceProgress(name: string): Promise>{ + this._log.info('deleteService long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteService, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists Services. Results are sorted by creation time, descending. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * @param {number} request.pageSize + * Maximum number of Services to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListServices. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.run.v2.Service|Service}. + * 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 `listServicesAsync()` + * 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. + */ + listServices( + request?: protos.google.cloud.run.v2.IListServicesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IService[], + protos.google.cloud.run.v2.IListServicesRequest|null, + protos.google.cloud.run.v2.IListServicesResponse + ]>; + listServices( + request: protos.google.cloud.run.v2.IListServicesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListServicesRequest, + protos.google.cloud.run.v2.IListServicesResponse|null|undefined, + protos.google.cloud.run.v2.IService>): void; + listServices( + request: protos.google.cloud.run.v2.IListServicesRequest, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListServicesRequest, + protos.google.cloud.run.v2.IListServicesResponse|null|undefined, + protos.google.cloud.run.v2.IService>): void; + listServices( + request?: protos.google.cloud.run.v2.IListServicesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.run.v2.IListServicesRequest, + protos.google.cloud.run.v2.IListServicesResponse|null|undefined, + protos.google.cloud.run.v2.IService>, + callback?: PaginationCallback< + protos.google.cloud.run.v2.IListServicesRequest, + protos.google.cloud.run.v2.IListServicesResponse|null|undefined, + protos.google.cloud.run.v2.IService>): + Promise<[ + protos.google.cloud.run.v2.IService[], + protos.google.cloud.run.v2.IListServicesRequest|null, + protos.google.cloud.run.v2.IListServicesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.run.v2.IListServicesRequest, + protos.google.cloud.run.v2.IListServicesResponse|null|undefined, + protos.google.cloud.run.v2.IService>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServices values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServices request %j', request); + return this.innerApiCalls + .listServices(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.run.v2.IService[], + protos.google.cloud.run.v2.IListServicesRequest|null, + protos.google.cloud.run.v2.IListServicesResponse + ]) => { + this._log.info('listServices values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listServices`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * @param {number} request.pageSize + * Maximum number of Services to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListServices. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.Service|Service} 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 `listServicesAsync()` + * 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. + */ + listServicesStream( + request?: protos.google.cloud.run.v2.IListServicesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listServices']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listServices stream %j', request); + return this.descriptors.page.listServices.createStream( + this.innerApiCalls.listServices as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listServices`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: projects/{project}/locations/{location}, where {project} + * can be project id or number. + * @param {number} request.pageSize + * Maximum number of Services to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListServices. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.Service|Service}. 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/v2/services.list_services.js + * region_tag:run_v2_generated_Services_ListServices_async + */ + listServicesAsync( + request?: protos.google.cloud.run.v2.IListServicesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listServices']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listServices iterate %j', request); + return this.descriptors.page.listServices.asyncIterate( + this.innerApiCalls['listServices'] 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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,job:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the job from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the job. + */ + matchJobFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).job; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified 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 revision resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @param {string} revision + * @returns {string} Resource name string. + */ + revisionPath(project:string,location:string,service:string,revision:string) { + return this.pathTemplates.revisionPathTemplate.render({ + project: project, + location: location, + service: service, + revision: revision, + }); + } + + /** + * Parse the project from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).project; + } + + /** + * Parse the location from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).location; + } + + /** + * Parse the service from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the service. + */ + matchServiceFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).service; + } + + /** + * Parse the revision from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the revision. + */ + matchRevisionFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; + } + + /** + * Return a fully-qualified service resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @returns {string} Resource name string. + */ + servicePath(project:string,location:string,service:string) { + return this.pathTemplates.servicePathTemplate.render({ + project: project, + location: location, + service: service, + }); + } + + /** + * Parse the project from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).project; + } + + /** + * Parse the location from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).location; + } + + /** + * Parse the service from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).service; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,execution:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + 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 execution from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).execution; + } + + /** + * 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 workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project:string,location:string,workerPool:string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; + } + + /** + * 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.servicesStub && !this._terminated) { + return this.servicesStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/services_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/services_client_config.json new file mode 100644 index 00000000000..d9a33646b69 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/services_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.run.v2.Services": { + "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": { + "CreateService": { + "timeout_millis": 15000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetService": { + "timeout_millis": 10000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListServices": { + "timeout_millis": 10000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateService": { + "timeout_millis": 15000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteService": { + "timeout_millis": 10000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json new file mode 100644 index 00000000000..0d5d6ea6137 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/run/v2/build.proto", + "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", + "../../protos/google/cloud/run/v2/execution.proto", + "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", + "../../protos/google/cloud/run/v2/instance_split.proto", + "../../protos/google/cloud/run/v2/job.proto", + "../../protos/google/cloud/run/v2/k8s.min.proto", + "../../protos/google/cloud/run/v2/revision.proto", + "../../protos/google/cloud/run/v2/revision_template.proto", + "../../protos/google/cloud/run/v2/service.proto", + "../../protos/google/cloud/run/v2/status.proto", + "../../protos/google/cloud/run/v2/task.proto", + "../../protos/google/cloud/run/v2/task_template.proto", + "../../protos/google/cloud/run/v2/traffic_target.proto", + "../../protos/google/cloud/run/v2/vendor_settings.proto", + "../../protos/google/cloud/run/v2/worker_pool.proto", + "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" +] diff --git a/owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts b/owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts new file mode 100644 index 00000000000..38b33a4e5dc --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts @@ -0,0 +1,1293 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/tasks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './tasks_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Run Task Control Plane API. + * @class + * @memberof v2 + */ +export class TasksClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('run'); + + 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}; + tasksStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TasksClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new TasksClient({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 TasksClient; + 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 = 'run.' + 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 = { + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + 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}' + ), + revisionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' + ), + servicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // 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 = { + listTasks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.run.v2.Tasks', 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.tasksStub) { + return this.tasksStub; + } + + // Put together the "service stub" for + // google.cloud.run.v2.Tasks. + this.tasksStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Tasks') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.run.v2.Tasks, + 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 tasksStubMethods = + ['getTask', 'listTasks']; + for (const methodName of tasksStubMethods) { + const callPromise = this.tasksStub.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] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.tasksStub; + } + + /** + * 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 'run.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 'run.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 -- + // ------------------- +/** + * Gets information about a Task. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the Task. + * Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.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/v2/tasks.get_task.js + * region_tag:run_v2_generated_Tasks_GetTask_async + */ + getTask( + request?: protos.google.cloud.run.v2.IGetTaskRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.ITask, + protos.google.cloud.run.v2.IGetTaskRequest|undefined, {}|undefined + ]>; + getTask( + request: protos.google.cloud.run.v2.IGetTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.run.v2.ITask, + protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, + {}|null|undefined>): void; + getTask( + request: protos.google.cloud.run.v2.IGetTaskRequest, + callback: Callback< + protos.google.cloud.run.v2.ITask, + protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, + {}|null|undefined>): void; + getTask( + request?: protos.google.cloud.run.v2.IGetTaskRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.run.v2.ITask, + protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.run.v2.ITask, + protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.run.v2.ITask, + protos.google.cloud.run.v2.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().catch(err => {throw err}); + this._log.info('getTask request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.run.v2.ITask, + protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTask response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getTask(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.run.v2.ITask, + protos.google.cloud.run.v2.IGetTaskRequest|undefined, + {}|undefined + ]) => { + this._log.info('getTask response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Lists Tasks from an Execution of a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * @param {number} request.pageSize + * Maximum number of Tasks to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.run.v2.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.run.v2.IListTasksRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.ITask[], + protos.google.cloud.run.v2.IListTasksRequest|null, + protos.google.cloud.run.v2.IListTasksResponse + ]>; + listTasks( + request: protos.google.cloud.run.v2.IListTasksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListTasksRequest, + protos.google.cloud.run.v2.IListTasksResponse|null|undefined, + protos.google.cloud.run.v2.ITask>): void; + listTasks( + request: protos.google.cloud.run.v2.IListTasksRequest, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListTasksRequest, + protos.google.cloud.run.v2.IListTasksResponse|null|undefined, + protos.google.cloud.run.v2.ITask>): void; + listTasks( + request?: protos.google.cloud.run.v2.IListTasksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.run.v2.IListTasksRequest, + protos.google.cloud.run.v2.IListTasksResponse|null|undefined, + protos.google.cloud.run.v2.ITask>, + callback?: PaginationCallback< + protos.google.cloud.run.v2.IListTasksRequest, + protos.google.cloud.run.v2.IListTasksResponse|null|undefined, + protos.google.cloud.run.v2.ITask>): + Promise<[ + protos.google.cloud.run.v2.ITask[], + protos.google.cloud.run.v2.IListTasksRequest|null, + protos.google.cloud.run.v2.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().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.run.v2.IListTasksRequest, + protos.google.cloud.run.v2.IListTasksResponse|null|undefined, + protos.google.cloud.run.v2.ITask>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTasks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTasks request %j', request); + return this.innerApiCalls + .listTasks(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.run.v2.ITask[], + protos.google.cloud.run.v2.IListTasksRequest|null, + protos.google.cloud.run.v2.IListTasksResponse + ]) => { + this._log.info('listTasks values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listTasks`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * @param {number} request.pageSize + * Maximum number of Tasks to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.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.run.v2.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().catch(err => {throw err}); + this._log.info('listTasks stream %j', request); + 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. The Execution from which the Tasks should be listed. + * To list all Tasks across Executions of a Job, use "-" instead of Execution + * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} + * @param {number} request.pageSize + * Maximum number of Tasks to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListTasks. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.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/v2/tasks.list_tasks.js + * region_tag:run_v2_generated_Tasks_ListTasks_async + */ + listTasksAsync( + request?: protos.google.cloud.run.v2.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().catch(err => {throw err}); + this._log.info('listTasks iterate %j', request); + 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,job:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the job from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the job. + */ + matchJobFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).job; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified 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 revision resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @param {string} revision + * @returns {string} Resource name string. + */ + revisionPath(project:string,location:string,service:string,revision:string) { + return this.pathTemplates.revisionPathTemplate.render({ + project: project, + location: location, + service: service, + revision: revision, + }); + } + + /** + * Parse the project from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).project; + } + + /** + * Parse the location from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).location; + } + + /** + * Parse the service from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the service. + */ + matchServiceFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).service; + } + + /** + * Parse the revision from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the revision. + */ + matchRevisionFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; + } + + /** + * Return a fully-qualified service resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @returns {string} Resource name string. + */ + servicePath(project:string,location:string,service:string) { + return this.pathTemplates.servicePathTemplate.render({ + project: project, + location: location, + service: service, + }); + } + + /** + * Parse the project from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).project; + } + + /** + * Parse the location from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).location; + } + + /** + * Parse the service from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).service; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,execution:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + 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 execution from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).execution; + } + + /** + * 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 workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project:string,location:string,workerPool:string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; + } + + /** + * 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.tasksStub && !this._terminated) { + return this.tasksStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json new file mode 100644 index 00000000000..c9fe28e061c --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.run.v2.Tasks": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetTask": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTasks": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json new file mode 100644 index 00000000000..0d5d6ea6137 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/run/v2/build.proto", + "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", + "../../protos/google/cloud/run/v2/execution.proto", + "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", + "../../protos/google/cloud/run/v2/instance_split.proto", + "../../protos/google/cloud/run/v2/job.proto", + "../../protos/google/cloud/run/v2/k8s.min.proto", + "../../protos/google/cloud/run/v2/revision.proto", + "../../protos/google/cloud/run/v2/revision_template.proto", + "../../protos/google/cloud/run/v2/service.proto", + "../../protos/google/cloud/run/v2/status.proto", + "../../protos/google/cloud/run/v2/task.proto", + "../../protos/google/cloud/run/v2/task_template.proto", + "../../protos/google/cloud/run/v2/traffic_target.proto", + "../../protos/google/cloud/run/v2/vendor_settings.proto", + "../../protos/google/cloud/run/v2/worker_pool.proto", + "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" +] diff --git a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts new file mode 100644 index 00000000000..842874cf75c --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts @@ -0,0 +1,2243 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/worker_pools_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './worker_pools_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Run WorkerPool Control Plane API. + * @class + * @memberof v2 + */ +export class WorkerPoolsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('run'); + + 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; + workerPoolsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of WorkerPoolsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new WorkerPoolsClient({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 WorkerPoolsClient; + 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 = 'run.' + 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 = { + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + 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}' + ), + revisionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' + ), + servicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // 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 = { + listWorkerPools: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workerPools') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createWorkerPoolResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; + const createWorkerPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; + const updateWorkerPoolResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; + const updateWorkerPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; + const deleteWorkerPoolResponse = protoFilesRoot.lookup( + '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; + const deleteWorkerPoolMetadata = protoFilesRoot.lookup( + '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createWorkerPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createWorkerPoolResponse.decode.bind(createWorkerPoolResponse), + createWorkerPoolMetadata.decode.bind(createWorkerPoolMetadata)), + updateWorkerPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateWorkerPoolResponse.decode.bind(updateWorkerPoolResponse), + updateWorkerPoolMetadata.decode.bind(updateWorkerPoolMetadata)), + deleteWorkerPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteWorkerPoolResponse.decode.bind(deleteWorkerPoolResponse), + deleteWorkerPoolMetadata.decode.bind(deleteWorkerPoolMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.run.v2.WorkerPools', 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.workerPoolsStub) { + return this.workerPoolsStub; + } + + // Put together the "service stub" for + // google.cloud.run.v2.WorkerPools. + this.workerPoolsStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.WorkerPools') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.run.v2.WorkerPools, + 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 workerPoolsStubMethods = + ['createWorkerPool', 'getWorkerPool', 'listWorkerPools', 'updateWorkerPool', 'deleteWorkerPool', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; + for (const methodName of workerPoolsStubMethods) { + const callPromise = this.workerPoolsStub.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.workerPoolsStub; + } + + /** + * 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 'run.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 'run.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 -- + // ------------------- +/** + * Gets information about a WorkerPool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the WorkerPool. + * Format: + * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where + * `{project}` can be project id or number. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.WorkerPool|WorkerPool}. + * 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/v2/worker_pools.get_worker_pool.js + * region_tag:run_v2_generated_WorkerPools_GetWorkerPool_async + */ + getWorkerPool( + request?: protos.google.cloud.run.v2.IGetWorkerPoolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IWorkerPool, + protos.google.cloud.run.v2.IGetWorkerPoolRequest|undefined, {}|undefined + ]>; + getWorkerPool( + request: protos.google.cloud.run.v2.IGetWorkerPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.run.v2.IWorkerPool, + protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, + {}|null|undefined>): void; + getWorkerPool( + request: protos.google.cloud.run.v2.IGetWorkerPoolRequest, + callback: Callback< + protos.google.cloud.run.v2.IWorkerPool, + protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, + {}|null|undefined>): void; + getWorkerPool( + request?: protos.google.cloud.run.v2.IGetWorkerPoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.run.v2.IWorkerPool, + protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.run.v2.IWorkerPool, + protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.run.v2.IWorkerPool, + protos.google.cloud.run.v2.IGetWorkerPoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + this._log.info('getWorkerPool request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.run.v2.IWorkerPool, + protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getWorkerPool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getWorkerPool(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.run.v2.IWorkerPool, + protos.google.cloud.run.v2.IGetWorkerPoolRequest|undefined, + {}|undefined + ]) => { + this._log.info('getWorkerPool response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets the IAM Access Control policy currently in effect for the given + * Cloud Run WorkerPool. This result does not include any inherited policies. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.GetPolicyOptions} request.options + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/worker_pools.get_iam_policy.js + * region_tag:run_v2_generated_WorkerPools_GetIamPolicy_async + */ + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request: protos.google.iam.v1.IGetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + getIamPolicy( + request?: protos.google.iam.v1.IGetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Sets the IAM Access control policy for the specified WorkerPool. Overwrites + * any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * @param {google.iam.v1.Policy} request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * @param {google.protobuf.FieldMask} request.updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/worker_pools.set_iam_policy.js + * region_tag:run_v2_generated_WorkerPools_SetIamPolicy_async + */ + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request: protos.google.iam.v1.ISetIamPolicyRequest, + callback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + setIamPolicy( + request?: protos.google.iam.v1.ISetIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/worker_pools.test_iam_permissions.js + * region_tag:run_v2_generated_WorkerPools_TestIamPermissions_async + */ + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + options?: CallOptions): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + options: CallOptions, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request: protos.google.iam.v1.ITestIamPermissionsRequest, + callback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): void; + testIamPermissions( + request?: protos.google.iam.v1.ITestIamPermissionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest|undefined, + {}|undefined + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new WorkerPool in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project in which this worker pool should be + * created. Format: `projects/{project}/locations/{location}`, where + * `{project}` can be project id or number. Only lowercase characters, digits, + * and hyphens. + * @param {google.cloud.run.v2.WorkerPool} request.workerPool + * Required. The WorkerPool instance to create. + * @param {string} request.workerPoolId + * Required. The unique identifier for the WorkerPool. It must begin with + * letter, and cannot end with hyphen; must contain fewer than 50 characters. + * The name of the worker pool becomes + * `{parent}/workerPools/{worker_pool_id}`. + * @param {boolean} [request.validateOnly] + * Optional. Indicates that the request should be validated and default values + * populated, without persisting the request or creating any resources. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/worker_pools.create_worker_pool.js + * region_tag:run_v2_generated_WorkerPools_CreateWorkerPool_async + */ + createWorkerPool( + request?: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createWorkerPool( + request: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createWorkerPool( + request: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createWorkerPool( + request?: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createWorkerPool response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createWorkerPool request %j', request); + return this.innerApiCalls.createWorkerPool(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createWorkerPool response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createWorkerPool()`. + * @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/v2/worker_pools.create_worker_pool.js + * region_tag:run_v2_generated_WorkerPools_CreateWorkerPool_async + */ + async checkCreateWorkerPoolProgress(name: string): Promise>{ + this._log.info('createWorkerPool long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createWorkerPool, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a WorkerPool. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to be updated. + * @param {google.cloud.run.v2.WorkerPool} request.workerPool + * Required. The WorkerPool to be updated. + * @param {boolean} [request.validateOnly] + * Optional. Indicates that the request should be validated and default values + * populated, without persisting the request or updating any resources. + * @param {boolean} [request.allowMissing] + * Optional. If set to true, and if the WorkerPool does not exist, it will + * create a new one. The caller must have 'run.workerpools.create' permissions + * if this is set to true and the WorkerPool does not exist. + * @param {boolean} [request.forceNewRevision] + * Optional. If set to true, a new revision will be created from the template + * even if the system doesn't detect any changes from the previously deployed + * revision. + * + * This may be useful for cases where the underlying resources need to be + * recreated or reinitialized. For example if the image is specified by label, + * but the underlying image digest has changed) or if the container performs + * deployment initialization work that needs to be performed again. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/worker_pools.update_worker_pool.js + * region_tag:run_v2_generated_WorkerPools_UpdateWorkerPool_async + */ + updateWorkerPool( + request?: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateWorkerPool( + request: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateWorkerPool( + request: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateWorkerPool( + request?: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.workerPool?.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateWorkerPool response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateWorkerPool request %j', request); + return this.innerApiCalls.updateWorkerPool(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateWorkerPool response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateWorkerPool()`. + * @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/v2/worker_pools.update_worker_pool.js + * region_tag:run_v2_generated_WorkerPools_UpdateWorkerPool_async + */ + async checkUpdateWorkerPoolProgress(name: string): Promise>{ + this._log.info('updateWorkerPool long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateWorkerPool, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a WorkerPool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full name of the WorkerPool. + * Format: + * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where + * `{project}` can be project id or number. + * @param {boolean} [request.validateOnly] + * Optional. Indicates that the request should be validated without actually + * deleting any resources. + * @param {string} request.etag + * A system-generated fingerprint for this version of the + * resource. May be used to detect modification conflict during updates. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/worker_pools.delete_worker_pool.js + * region_tag:run_v2_generated_WorkerPools_DeleteWorkerPool_async + */ + deleteWorkerPool( + request?: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteWorkerPool( + request: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteWorkerPool( + request: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteWorkerPool( + request?: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, + 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 || {}; + let routingParameter = {}; + { + const fieldValue = request.name; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteWorkerPool response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteWorkerPool request %j', request); + return this.innerApiCalls.deleteWorkerPool(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteWorkerPool response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteWorkerPool()`. + * @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/v2/worker_pools.delete_worker_pool.js + * region_tag:run_v2_generated_WorkerPools_DeleteWorkerPool_async + */ + async checkDeleteWorkerPoolProgress(name: string): Promise>{ + this._log.info('deleteWorkerPool long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteWorkerPool, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists WorkerPools. Results are sorted by creation time, descending. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: `projects/{project}/locations/{location}`, where + * `{project}` can be project id or number. + * @param {number} request.pageSize + * Maximum number of WorkerPools to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListWorkerPools. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.run.v2.WorkerPool|WorkerPool}. + * 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 `listWorkerPoolsAsync()` + * 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. + */ + listWorkerPools( + request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.run.v2.IWorkerPool[], + protos.google.cloud.run.v2.IListWorkerPoolsRequest|null, + protos.google.cloud.run.v2.IListWorkerPoolsResponse + ]>; + listWorkerPools( + request: protos.google.cloud.run.v2.IListWorkerPoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListWorkerPoolsRequest, + protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, + protos.google.cloud.run.v2.IWorkerPool>): void; + listWorkerPools( + request: protos.google.cloud.run.v2.IListWorkerPoolsRequest, + callback: PaginationCallback< + protos.google.cloud.run.v2.IListWorkerPoolsRequest, + protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, + protos.google.cloud.run.v2.IWorkerPool>): void; + listWorkerPools( + request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.run.v2.IListWorkerPoolsRequest, + protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, + protos.google.cloud.run.v2.IWorkerPool>, + callback?: PaginationCallback< + protos.google.cloud.run.v2.IListWorkerPoolsRequest, + protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, + protos.google.cloud.run.v2.IWorkerPool>): + Promise<[ + protos.google.cloud.run.v2.IWorkerPool[], + protos.google.cloud.run.v2.IListWorkerPoolsRequest|null, + protos.google.cloud.run.v2.IListWorkerPoolsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.run.v2.IListWorkerPoolsRequest, + protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, + protos.google.cloud.run.v2.IWorkerPool>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listWorkerPools values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listWorkerPools request %j', request); + return this.innerApiCalls + .listWorkerPools(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.run.v2.IWorkerPool[], + protos.google.cloud.run.v2.IListWorkerPoolsRequest|null, + protos.google.cloud.run.v2.IListWorkerPoolsResponse + ]) => { + this._log.info('listWorkerPools values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listWorkerPools`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: `projects/{project}/locations/{location}`, where + * `{project}` can be project id or number. + * @param {number} request.pageSize + * Maximum number of WorkerPools to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListWorkerPools. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.WorkerPool|WorkerPool} 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 `listWorkerPoolsAsync()` + * 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. + */ + listWorkerPoolsStream( + request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listWorkerPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listWorkerPools stream %j', request); + return this.descriptors.page.listWorkerPools.createStream( + this.innerApiCalls.listWorkerPools as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listWorkerPools`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location and project to list resources on. + * Location must be a valid Google Cloud region, and cannot be the "-" + * wildcard. Format: `projects/{project}/locations/{location}`, where + * `{project}` can be project id or number. + * @param {number} request.pageSize + * Maximum number of WorkerPools to return in this call. + * @param {string} request.pageToken + * A page token received from a previous call to ListWorkerPools. + * All other parameters must match. + * @param {boolean} request.showDeleted + * If true, returns deleted (but unexpired) resources along with active ones. + * @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.run.v2.WorkerPool|WorkerPool}. 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/v2/worker_pools.list_worker_pools.js + * region_tag:run_v2_generated_WorkerPools_ListWorkerPools_async + */ + listWorkerPoolsAsync( + request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + let routingParameter = {}; + { + const fieldValue = request.parent; + if (fieldValue !== undefined && fieldValue !== null) { + const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); + if (match) { + const parameterValue = match.groups?.['location'] ?? fieldValue; + Object.assign(routingParameter, { location: parameterValue }); + } + } + } + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams( + routingParameter + ); + const defaultCallSettings = this._defaults['listWorkerPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listWorkerPools iterate %j', request); + return this.descriptors.page.listWorkerPools.asyncIterate( + this.innerApiCalls['listWorkerPools'] 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, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath(project:string,location:string,job:string,execution:string) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).location; + } + + /** + * Parse the job from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the job. + */ + matchJobFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).job; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName).execution; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified 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 revision resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @param {string} revision + * @returns {string} Resource name string. + */ + revisionPath(project:string,location:string,service:string,revision:string) { + return this.pathTemplates.revisionPathTemplate.render({ + project: project, + location: location, + service: service, + revision: revision, + }); + } + + /** + * Parse the project from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).project; + } + + /** + * Parse the location from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).location; + } + + /** + * Parse the service from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the service. + */ + matchServiceFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).service; + } + + /** + * Parse the revision from Revision resource. + * + * @param {string} revisionName + * A fully-qualified path representing Revision resource. + * @returns {string} A string representing the revision. + */ + matchRevisionFromRevisionName(revisionName: string) { + return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; + } + + /** + * Return a fully-qualified service resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @returns {string} Resource name string. + */ + servicePath(project:string,location:string,service:string) { + return this.pathTemplates.servicePathTemplate.render({ + project: project, + location: location, + service: service, + }); + } + + /** + * Parse the project from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).project; + } + + /** + * Parse the location from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).location; + } + + /** + * Parse the service from Service resource. + * + * @param {string} serviceName + * A fully-qualified path representing Service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromServiceName(serviceName: string) { + return this.pathTemplates.servicePathTemplate.match(serviceName).service; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} execution + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,execution:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + execution: execution, + 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 execution from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).execution; + } + + /** + * 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 workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project:string,location:string,workerPool:string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; + } + + /** + * 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.workerPoolsStub && !this._terminated) { + return this.workerPoolsStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json new file mode 100644 index 00000000000..ac049ec5316 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.run.v2.WorkerPools": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateWorkerPool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetWorkerPool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListWorkerPools": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateWorkerPool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkerPool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json new file mode 100644 index 00000000000..0d5d6ea6137 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/run/v2/build.proto", + "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", + "../../protos/google/cloud/run/v2/execution.proto", + "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", + "../../protos/google/cloud/run/v2/instance_split.proto", + "../../protos/google/cloud/run/v2/job.proto", + "../../protos/google/cloud/run/v2/k8s.min.proto", + "../../protos/google/cloud/run/v2/revision.proto", + "../../protos/google/cloud/run/v2/revision_template.proto", + "../../protos/google/cloud/run/v2/service.proto", + "../../protos/google/cloud/run/v2/status.proto", + "../../protos/google/cloud/run/v2/task.proto", + "../../protos/google/cloud/run/v2/task_template.proto", + "../../protos/google/cloud/run/v2/traffic_target.proto", + "../../protos/google/cloud/run/v2/vendor_settings.proto", + "../../protos/google/cloud/run/v2/worker_pool.proto", + "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" +] diff --git a/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..b75bcd5378f --- /dev/null +++ b/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js @@ -0,0 +1,34 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const run = require('@google-cloud/run'); + +function main() { + const buildsClient = new run.BuildsClient(); + const executionsClient = new run.ExecutionsClient(); + const instancesClient = new run.InstancesClient(); + const jobsClient = new run.JobsClient(); + const revisionsClient = new run.RevisionsClient(); + const servicesClient = new run.ServicesClient(); + const tasksClient = new run.TasksClient(); + const workerPoolsClient = new run.WorkerPoolsClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..bdf1cc11f53 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient} from '@google-cloud/run'; + +// check that the client class type name can be used +function doStuffWithBuildsClient(client: BuildsClient) { + client.close(); +} +function doStuffWithExecutionsClient(client: ExecutionsClient) { + client.close(); +} +function doStuffWithInstancesClient(client: InstancesClient) { + client.close(); +} +function doStuffWithJobsClient(client: JobsClient) { + client.close(); +} +function doStuffWithRevisionsClient(client: RevisionsClient) { + client.close(); +} +function doStuffWithServicesClient(client: ServicesClient) { + client.close(); +} +function doStuffWithTasksClient(client: TasksClient) { + client.close(); +} +function doStuffWithWorkerPoolsClient(client: WorkerPoolsClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const buildsClient = new BuildsClient(); + doStuffWithBuildsClient(buildsClient); + // check that the client instance can be created + const executionsClient = new ExecutionsClient(); + doStuffWithExecutionsClient(executionsClient); + // check that the client instance can be created + const instancesClient = new InstancesClient(); + doStuffWithInstancesClient(instancesClient); + // check that the client instance can be created + const jobsClient = new JobsClient(); + doStuffWithJobsClient(jobsClient); + // check that the client instance can be created + const revisionsClient = new RevisionsClient(); + doStuffWithRevisionsClient(revisionsClient); + // check that the client instance can be created + const servicesClient = new ServicesClient(); + doStuffWithServicesClient(servicesClient); + // check that the client instance can be created + const tasksClient = new TasksClient(); + doStuffWithTasksClient(tasksClient); + // check that the client instance can be created + const workerPoolsClient = new WorkerPoolsClient(); + doStuffWithWorkerPoolsClient(workerPoolsClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-run/system-test/install.ts b/owl-bot-staging/google-cloud-run/system-test/install.ts new file mode 100644 index 00000000000..394f3362d20 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {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-run/test/gapic_builds_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_builds_v2.ts new file mode 100644 index 00000000000..a0a18108510 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/test/gapic_builds_v2.ts @@ -0,0 +1,865 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as buildsModule from '../src'; + +import {protobuf, 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 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('v2.BuildsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new buildsModule.v2.BuildsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new buildsModule.v2.BuildsClient(); + 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 = buildsModule.v2.BuildsClient.servicePath; + assert.strictEqual(servicePath, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = buildsModule.v2.BuildsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new buildsModule.v2.BuildsClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new buildsModule.v2.BuildsClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 buildsModule.v2.BuildsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 buildsModule.v2.BuildsClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 buildsModule.v2.BuildsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = buildsModule.v2.BuildsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new buildsModule.v2.BuildsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new buildsModule.v2.BuildsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.buildsStub, undefined); + await client.initialize(); + assert(client.buildsStub); + }); + + it('has close method for the initialized client', done => { + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.buildsStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.buildsStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new buildsModule.v2.BuildsClient({ + 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 buildsModule.v2.BuildsClient({ + 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('submitBuild', () => { + it('invokes submitBuild without error', async () => { + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.SubmitBuildRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.SubmitBuildResponse() + ); + client.innerApiCalls.submitBuild = stubSimpleCall(expectedResponse); + const [response] = await client.submitBuild(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.submitBuild as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.submitBuild as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitBuild without error using callback', async () => { + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.SubmitBuildRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.SubmitBuildResponse() + ); + client.innerApiCalls.submitBuild = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.submitBuild( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.ISubmitBuildResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.submitBuild as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.submitBuild as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitBuild with error', async () => { + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.SubmitBuildRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.submitBuild = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.submitBuild(request), expectedError); + const actualRequest = (client.innerApiCalls.submitBuild as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.submitBuild as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitBuild with closed client', async () => { + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.SubmitBuildRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.submitBuild(request), expectedError); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('Path templates', () => { + + describe('execution', async () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + }; + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromExecutionName', () => { + const result = client.matchJobFromExecutionName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('job', async () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('revision', async () => { + const fakePath = "/rendered/path/revision"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + revision: "revisionValue", + }; + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.revisionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.revisionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('revisionPath', () => { + const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRevisionName', () => { + const result = client.matchProjectFromRevisionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRevisionName', () => { + const result = client.matchLocationFromRevisionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromRevisionName', () => { + const result = client.matchServiceFromRevisionName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRevisionFromRevisionName', () => { + const result = client.matchRevisionFromRevisionName(fakePath); + assert.strictEqual(result, "revisionValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('service', async () => { + const fakePath = "/rendered/path/service"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + }; + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.servicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePath', () => { + const result = client.servicePath("projectValue", "locationValue", "serviceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServiceName', () => { + const result = client.matchProjectFromServiceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServiceName', () => { + const result = client.matchLocationFromServiceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromServiceName', () => { + const result = client.matchServiceFromServiceName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', async () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + task: "taskValue", + }; + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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", "executionValue", "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('matchExecutionFromTaskName', () => { + const result = client.matchExecutionFromTaskName(fakePath); + assert.strictEqual(result, "executionValue"); + 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('workerPool', async () => { + const fakePath = "/rendered/path/workerPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + worker_pool: "workerPoolValue", + }; + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, "workerPoolValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts new file mode 100644 index 00000000000..69f44a4308b --- /dev/null +++ b/owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts @@ -0,0 +1,1784 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as executionsModule 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('v2.ExecutionsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new executionsModule.v2.ExecutionsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new executionsModule.v2.ExecutionsClient(); + 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 = executionsModule.v2.ExecutionsClient.servicePath; + assert.strictEqual(servicePath, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = executionsModule.v2.ExecutionsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new executionsModule.v2.ExecutionsClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new executionsModule.v2.ExecutionsClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 executionsModule.v2.ExecutionsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 executionsModule.v2.ExecutionsClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 executionsModule.v2.ExecutionsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = executionsModule.v2.ExecutionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new executionsModule.v2.ExecutionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new executionsModule.v2.ExecutionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.executionsStub, undefined); + await client.initialize(); + assert(client.executionsStub); + }); + + it('has close method for the initialized client', done => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.executionsStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.executionsStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new executionsModule.v2.ExecutionsClient({ + 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 executionsModule.v2.ExecutionsClient({ + 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('getExecution', () => { + it('invokes getExecution without error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.Execution() + ); + client.innerApiCalls.getExecution = stubSimpleCall(expectedResponse); + const [response] = await client.getExecution(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExecution without error using callback', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.Execution() + ); + client.innerApiCalls.getExecution = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExecution( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.IExecution|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExecution with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExecution with closed client', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getExecution(request), expectedError); + }); + }); + + describe('deleteExecution', () => { + it('invokes deleteExecution without error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteExecution = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteExecution(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExecution without error using callback', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteExecution = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExecution( + 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.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExecution with call error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExecution with LRO error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteExecution(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteExecutionProgress without error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteExecutionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteExecutionProgress with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteExecutionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('cancelExecution', () => { + it('invokes cancelExecution without error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CancelExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelExecution = stubLongRunningCall(expectedResponse); + const [operation] = await client.cancelExecution(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelExecution without error using callback', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CancelExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelExecution = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelExecution( + 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.cancelExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelExecution with call error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CancelExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelExecution = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.cancelExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelExecution with LRO error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CancelExecutionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelExecution = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.cancelExecution(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.cancelExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCancelExecutionProgress without error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCancelExecutionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCancelExecutionProgress with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCancelExecutionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listExecutions', () => { + it('invokes listExecutions without error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListExecutionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + ]; + client.innerApiCalls.listExecutions = stubSimpleCall(expectedResponse); + const [response] = await client.listExecutions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExecutions without error using callback', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListExecutionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + ]; + client.innerApiCalls.listExecutions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExecutions( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.IExecution[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExecutions with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListExecutionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listExecutions(request), expectedError); + const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExecutionsStream without error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListExecutionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + ]; + client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listExecutionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.Execution[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.Execution) => { + 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.listExecutions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); + assert( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listExecutionsStream with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListExecutionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listExecutionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.Execution[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.Execution) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); + assert( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExecutions without error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListExecutionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + generateSampleMessage(new protos.google.cloud.run.v2.Execution()), + ]; + client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.run.v2.IExecution[] = []; + const iterable = client.listExecutionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listExecutions with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListExecutionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExecutionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.run.v2.IExecution[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listExecutions.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 executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + 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 executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + 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 executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + 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 executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('execution', async () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromExecutionName', () => { + const result = client.matchJobFromExecutionName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('job', async () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('revision', async () => { + const fakePath = "/rendered/path/revision"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + revision: "revisionValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.revisionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.revisionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('revisionPath', () => { + const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRevisionName', () => { + const result = client.matchProjectFromRevisionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRevisionName', () => { + const result = client.matchLocationFromRevisionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromRevisionName', () => { + const result = client.matchServiceFromRevisionName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRevisionFromRevisionName', () => { + const result = client.matchRevisionFromRevisionName(fakePath); + assert.strictEqual(result, "revisionValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('service', async () => { + const fakePath = "/rendered/path/service"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.servicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePath', () => { + const result = client.servicePath("projectValue", "locationValue", "serviceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServiceName', () => { + const result = client.matchProjectFromServiceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServiceName', () => { + const result = client.matchLocationFromServiceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromServiceName', () => { + const result = client.matchServiceFromServiceName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', async () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + task: "taskValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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", "executionValue", "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('matchExecutionFromTaskName', () => { + const result = client.matchExecutionFromTaskName(fakePath); + assert.strictEqual(result, "executionValue"); + 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('workerPool', async () => { + const fakePath = "/rendered/path/workerPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + worker_pool: "workerPoolValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, "workerPoolValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_instances_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_instances_v2.ts new file mode 100644 index 00000000000..44f19d237e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/test/gapic_instances_v2.ts @@ -0,0 +1,2127 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as instancesModule 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('v2.InstancesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new instancesModule.v2.InstancesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new instancesModule.v2.InstancesClient(); + 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 = instancesModule.v2.InstancesClient.servicePath; + assert.strictEqual(servicePath, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = instancesModule.v2.InstancesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new instancesModule.v2.InstancesClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new instancesModule.v2.InstancesClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 instancesModule.v2.InstancesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 instancesModule.v2.InstancesClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 instancesModule.v2.InstancesClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = instancesModule.v2.InstancesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new instancesModule.v2.InstancesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new instancesModule.v2.InstancesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.instancesStub, undefined); + await client.initialize(); + assert(client.instancesStub); + }); + + it('has close method for the initialized client', done => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.instancesStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.instancesStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new instancesModule.v2.InstancesClient({ + 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 instancesModule.v2.InstancesClient({ + 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('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetInstanceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetInstanceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.IInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetInstanceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetInstanceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateInstanceRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateInstanceRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with call error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateInstanceRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateInstanceRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteInstanceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteInstanceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + 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.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteInstanceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteInstanceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('stopInstance', () => { + it('invokes stopInstance without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.StopInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.StopInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.stopInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.stopInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopInstance without error using callback', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.StopInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.StopInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopInstance( + 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.stopInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopInstance with call error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.StopInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.StopInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.stopInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.stopInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopInstance with LRO error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.StopInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.StopInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.stopInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.stopInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStopInstanceProgress without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkStopInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStopInstanceProgress with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkStopInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('startInstance', () => { + it('invokes startInstance without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.StartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.StartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.startInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startInstance without error using callback', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.StartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.StartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startInstance( + 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.startInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startInstance with call error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.StartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.StartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.startInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.startInstance(request), expectedError); + const actualRequest = (client.innerApiCalls.startInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startInstance with LRO error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.StartInstanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.StartInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.startInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.startInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.startInstance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startInstance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStartInstanceProgress without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkStartInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStartInstanceProgress with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkStartInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListInstancesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListInstancesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.IInstance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListInstancesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInstances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListInstancesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.Instance[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListInstancesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.Instance[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListInstancesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + generateSampleMessage(new protos.google.cloud.run.v2.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.run.v2.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListInstancesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.run.v2.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + 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 instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + 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 instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + 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 instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('cryptoKey', async () => { + const fakePath = "/rendered/path/cryptoKey"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + key_ring: "keyRingValue", + crypto_key: "cryptoKeyValue", + }; + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchKeyRingFromCryptoKeyName', () => { + const result = client.matchKeyRingFromCryptoKeyName(fakePath); + assert.strictEqual(result, "keyRingValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCryptoKeyFromCryptoKeyName', () => { + const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, "cryptoKeyValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', async () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + }; + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromExecutionName', () => { + const result = client.matchJobFromExecutionName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('job', async () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('revision', async () => { + const fakePath = "/rendered/path/revision"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + revision: "revisionValue", + }; + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.revisionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.revisionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('revisionPath', () => { + const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRevisionName', () => { + const result = client.matchProjectFromRevisionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRevisionName', () => { + const result = client.matchLocationFromRevisionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromRevisionName', () => { + const result = client.matchServiceFromRevisionName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRevisionFromRevisionName', () => { + const result = client.matchRevisionFromRevisionName(fakePath); + assert.strictEqual(result, "revisionValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('service', async () => { + const fakePath = "/rendered/path/service"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + }; + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.servicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePath', () => { + const result = client.servicePath("projectValue", "locationValue", "serviceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServiceName', () => { + const result = client.matchProjectFromServiceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServiceName', () => { + const result = client.matchLocationFromServiceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromServiceName', () => { + const result = client.matchServiceFromServiceName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', async () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + task: "taskValue", + }; + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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", "executionValue", "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('matchExecutionFromTaskName', () => { + const result = client.matchExecutionFromTaskName(fakePath); + assert.strictEqual(result, "executionValue"); + 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('workerPool', async () => { + const fakePath = "/rendered/path/workerPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + worker_pool: "workerPoolValue", + }; + const client = new instancesModule.v2.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, "workerPoolValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts new file mode 100644 index 00000000000..014c64087bf --- /dev/null +++ b/owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts @@ -0,0 +1,2393 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as jobsModule 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('v2.JobsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new jobsModule.v2.JobsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new jobsModule.v2.JobsClient(); + 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 = jobsModule.v2.JobsClient.servicePath; + assert.strictEqual(servicePath, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = jobsModule.v2.JobsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new jobsModule.v2.JobsClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new jobsModule.v2.JobsClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 jobsModule.v2.JobsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 jobsModule.v2.JobsClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 jobsModule.v2.JobsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = jobsModule.v2.JobsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new jobsModule.v2.JobsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new jobsModule.v2.JobsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobsStub, undefined); + await client.initialize(); + assert(client.jobsStub); + }); + + it('has close method for the initialized client', done => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.jobsStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobsStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobsModule.v2.JobsClient({ + 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 jobsModule.v2.JobsClient({ + 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('getJob', () => { + it('invokes getJob without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.Job() + ); + client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('createJob', () => { + it('invokes createJob without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateJobRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.createJob(request); + const [response] = await operation.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 without error using callback', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateJobRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJob( + 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.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 call error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateJobRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createJob = stubLongRunningCall(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 LRO error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateJobRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createJob(request); + await assert.rejects(operation.promise(), 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 checkCreateJobProgress without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateJobProgress with error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateJob', () => { + it('invokes updateJob without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateJobRequest() + ); + request.job = {}; + // path template: projects/*/locations/{location=*}/** + request.job.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateJob(request); + const [response] = await operation.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 without error using callback', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateJobRequest() + ); + request.job = {}; + // path template: projects/*/locations/{location=*}/** + request.job.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateJob( + 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.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 call error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateJobRequest() + ); + request.job = {}; + // path template: projects/*/locations/{location=*}/** + request.job.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.updateJob = stubLongRunningCall(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 LRO error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateJobRequest() + ); + request.job = {}; + // path template: projects/*/locations/{location=*}/** + request.job.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.updateJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateJob(request); + await assert.rejects(operation.promise(), 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 checkUpdateJobProgress without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateJobProgress with error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteJob', () => { + it('invokes deleteJob without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('runJob', () => { + it('invokes runJob without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.RunJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.runJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.runJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runJob without error using callback', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.RunJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runJob( + 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.runJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runJob with call error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.RunJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.runJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.runJob(request), expectedError); + const actualRequest = (client.innerApiCalls.runJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runJob with LRO error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.RunJobRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.runJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.runJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.runJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunJobProgress without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunJobProgress with error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkRunJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListJobsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + generateSampleMessage(new protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListJobsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListJobsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListJobsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + ]; + client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.Job[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListJobsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + 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.run.v2.Job[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListJobsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + generateSampleMessage(new protos.google.cloud.run.v2.Job()), + ]; + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListJobsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + 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.run.v2.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('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new jobsModule.v2.JobsClient({ + 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new jobsModule.v2.JobsClient({ + 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new jobsModule.v2.JobsClient({ + 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 jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('execution', async () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromExecutionName', () => { + const result = client.matchJobFromExecutionName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('job', async () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('revision', async () => { + const fakePath = "/rendered/path/revision"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + revision: "revisionValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.revisionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.revisionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('revisionPath', () => { + const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRevisionName', () => { + const result = client.matchProjectFromRevisionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRevisionName', () => { + const result = client.matchLocationFromRevisionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromRevisionName', () => { + const result = client.matchServiceFromRevisionName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRevisionFromRevisionName', () => { + const result = client.matchRevisionFromRevisionName(fakePath); + assert.strictEqual(result, "revisionValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('service', async () => { + const fakePath = "/rendered/path/service"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.servicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePath', () => { + const result = client.servicePath("projectValue", "locationValue", "serviceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServiceName', () => { + const result = client.matchProjectFromServiceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServiceName', () => { + const result = client.matchLocationFromServiceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromServiceName', () => { + const result = client.matchServiceFromServiceName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', async () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + task: "taskValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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", "executionValue", "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('matchExecutionFromTaskName', () => { + const result = client.matchExecutionFromTaskName(fakePath); + assert.strictEqual(result, "executionValue"); + 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('workerPool', async () => { + const fakePath = "/rendered/path/workerPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + worker_pool: "workerPoolValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, "workerPoolValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts new file mode 100644 index 00000000000..19e6f48c13f --- /dev/null +++ b/owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts @@ -0,0 +1,1669 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as revisionsModule 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('v2.RevisionsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new revisionsModule.v2.RevisionsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new revisionsModule.v2.RevisionsClient(); + 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 = revisionsModule.v2.RevisionsClient.servicePath; + assert.strictEqual(servicePath, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = revisionsModule.v2.RevisionsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new revisionsModule.v2.RevisionsClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new revisionsModule.v2.RevisionsClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 revisionsModule.v2.RevisionsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 revisionsModule.v2.RevisionsClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 revisionsModule.v2.RevisionsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = revisionsModule.v2.RevisionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new revisionsModule.v2.RevisionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new revisionsModule.v2.RevisionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.revisionsStub, undefined); + await client.initialize(); + assert(client.revisionsStub); + }); + + it('has close method for the initialized client', done => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.revisionsStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.revisionsStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new revisionsModule.v2.RevisionsClient({ + 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 revisionsModule.v2.RevisionsClient({ + 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('getRevision', () => { + it('invokes getRevision without error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetRevisionRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.Revision() + ); + client.innerApiCalls.getRevision = stubSimpleCall(expectedResponse); + const [response] = await client.getRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRevision without error using callback', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetRevisionRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.Revision() + ); + client.innerApiCalls.getRevision = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRevision( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.IRevision|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRevision with error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetRevisionRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.getRevision = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRevision(request), expectedError); + const actualRequest = (client.innerApiCalls.getRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRevision with closed client', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetRevisionRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getRevision(request), expectedError); + }); + }); + + describe('deleteRevision', () => { + it('invokes deleteRevision without error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteRevisionRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRevision = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteRevision(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRevision without error using callback', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteRevisionRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRevision = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRevision( + 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.deleteRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRevision with call error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteRevisionRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRevision = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteRevision(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRevision with LRO error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteRevisionRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRevision = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteRevision(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteRevisionProgress without error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteRevisionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteRevisionProgress with error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteRevisionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listRevisions', () => { + it('invokes listRevisions without error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListRevisionsRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.parent = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + ]; + client.innerApiCalls.listRevisions = stubSimpleCall(expectedResponse); + const [response] = await client.listRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRevisions without error using callback', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListRevisionsRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.parent = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + ]; + client.innerApiCalls.listRevisions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRevisions( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.IRevision[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRevisions with error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListRevisionsRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.parent = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.listRevisions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listRevisions(request), expectedError); + const actualRequest = (client.innerApiCalls.listRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRevisionsStream without error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListRevisionsRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.parent = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + ]; + client.descriptors.page.listRevisions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.Revision[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.Revision) => { + 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.listRevisions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRevisions, request)); + assert( + (client.descriptors.page.listRevisions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRevisionsStream with error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListRevisionsRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.parent = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listRevisions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.Revision[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.Revision) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listRevisions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRevisions, request)); + assert( + (client.descriptors.page.listRevisions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRevisions without error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListRevisionsRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.parent = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + generateSampleMessage(new protos.google.cloud.run.v2.Revision()), + ]; + client.descriptors.page.listRevisions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.run.v2.IRevision[] = []; + const iterable = client.listRevisionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRevisions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRevisions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRevisions with error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListRevisionsRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.parent = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRevisionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.run.v2.IRevision[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRevisions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRevisions.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 revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + 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 revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + 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 revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + 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 revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('cryptoKey', async () => { + const fakePath = "/rendered/path/cryptoKey"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + key_ring: "keyRingValue", + crypto_key: "cryptoKeyValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchKeyRingFromCryptoKeyName', () => { + const result = client.matchKeyRingFromCryptoKeyName(fakePath); + assert.strictEqual(result, "keyRingValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCryptoKeyFromCryptoKeyName', () => { + const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, "cryptoKeyValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', async () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromExecutionName', () => { + const result = client.matchJobFromExecutionName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('job', async () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('revision', async () => { + const fakePath = "/rendered/path/revision"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + revision: "revisionValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.revisionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.revisionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('revisionPath', () => { + const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRevisionName', () => { + const result = client.matchProjectFromRevisionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRevisionName', () => { + const result = client.matchLocationFromRevisionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromRevisionName', () => { + const result = client.matchServiceFromRevisionName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRevisionFromRevisionName', () => { + const result = client.matchRevisionFromRevisionName(fakePath); + assert.strictEqual(result, "revisionValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('service', async () => { + const fakePath = "/rendered/path/service"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.servicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePath', () => { + const result = client.servicePath("projectValue", "locationValue", "serviceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServiceName', () => { + const result = client.matchProjectFromServiceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServiceName', () => { + const result = client.matchLocationFromServiceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromServiceName', () => { + const result = client.matchServiceFromServiceName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', async () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + task: "taskValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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", "executionValue", "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('matchExecutionFromTaskName', () => { + const result = client.matchExecutionFromTaskName(fakePath); + assert.strictEqual(result, "executionValue"); + 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('workerPool', async () => { + const fakePath = "/rendered/path/workerPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + worker_pool: "workerPoolValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, "workerPoolValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts new file mode 100644 index 00000000000..5a5ff605ed7 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts @@ -0,0 +1,2243 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as servicesModule 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('v2.ServicesClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new servicesModule.v2.ServicesClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new servicesModule.v2.ServicesClient(); + 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 = servicesModule.v2.ServicesClient.servicePath; + assert.strictEqual(servicePath, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = servicesModule.v2.ServicesClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new servicesModule.v2.ServicesClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new servicesModule.v2.ServicesClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 servicesModule.v2.ServicesClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 servicesModule.v2.ServicesClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 servicesModule.v2.ServicesClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = servicesModule.v2.ServicesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new servicesModule.v2.ServicesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new servicesModule.v2.ServicesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.servicesStub, undefined); + await client.initialize(); + assert(client.servicesStub); + }); + + it('has close method for the initialized client', done => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.servicesStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.servicesStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new servicesModule.v2.ServicesClient({ + 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 servicesModule.v2.ServicesClient({ + 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('getService', () => { + it('invokes getService without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetServiceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.Service() + ); + client.innerApiCalls.getService = stubSimpleCall(expectedResponse); + const [response] = await client.getService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getService without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetServiceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.Service() + ); + client.innerApiCalls.getService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getService( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.IService|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getService with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetServiceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.getService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getService(request), expectedError); + const actualRequest = (client.innerApiCalls.getService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getService with closed client', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetServiceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getService(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('createService', () => { + it('invokes createService without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateServiceRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createService = stubLongRunningCall(expectedResponse); + const [operation] = await client.createService(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createService without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateServiceRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createService = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createService( + 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.createService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createService with call error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateServiceRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createService = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createService(request), expectedError); + const actualRequest = (client.innerApiCalls.createService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createService with LRO error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateServiceRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createService = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createService(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateServiceProgress without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateServiceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateServiceProgress with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateServiceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateService', () => { + it('invokes updateService without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateServiceRequest() + ); + request.service = {}; + // path template: projects/*/locations/{location=*}/** + request.service.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateService = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateService(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateService without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateServiceRequest() + ); + request.service = {}; + // path template: projects/*/locations/{location=*}/** + request.service.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateService = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateService( + 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.updateService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateService with call error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateServiceRequest() + ); + request.service = {}; + // path template: projects/*/locations/{location=*}/** + request.service.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.updateService = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateService(request), expectedError); + const actualRequest = (client.innerApiCalls.updateService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateService with LRO error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateServiceRequest() + ); + request.service = {}; + // path template: projects/*/locations/{location=*}/** + request.service.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.updateService = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateService(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateServiceProgress without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateServiceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateServiceProgress with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateServiceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteService', () => { + it('invokes deleteService without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteServiceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteService = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteService(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteService without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteServiceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteService = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteService( + 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.deleteService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteService with call error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteServiceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteService = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteService(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteService with LRO error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteServiceRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteService = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteService(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteServiceProgress without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteServiceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteServiceProgress with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteServiceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listServices', () => { + it('invokes listServices without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListServicesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + ]; + client.innerApiCalls.listServices = stubSimpleCall(expectedResponse); + const [response] = await client.listServices(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listServices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listServices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServices without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListServicesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + ]; + client.innerApiCalls.listServices = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listServices( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.IService[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listServices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listServices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServices with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListServicesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.listServices = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listServices(request), expectedError); + const actualRequest = (client.innerApiCalls.listServices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listServices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServicesStream without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListServicesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + ]; + client.descriptors.page.listServices.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listServicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.Service[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.Service) => { + 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.listServices.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listServices, request)); + assert( + (client.descriptors.page.listServices.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listServicesStream with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListServicesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listServices.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listServicesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.Service[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.Service) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listServices.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listServices, request)); + assert( + (client.descriptors.page.listServices.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServices without error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListServicesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + generateSampleMessage(new protos.google.cloud.run.v2.Service()), + ]; + client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.run.v2.IService[] = []; + const iterable = client.listServicesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listServices.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listServices.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServices with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListServicesRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listServicesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.run.v2.IService[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listServices.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listServices.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 servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + 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 servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + 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 servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + 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 servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('execution', async () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromExecutionName', () => { + const result = client.matchJobFromExecutionName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('job', async () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('revision', async () => { + const fakePath = "/rendered/path/revision"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + revision: "revisionValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.revisionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.revisionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('revisionPath', () => { + const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRevisionName', () => { + const result = client.matchProjectFromRevisionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRevisionName', () => { + const result = client.matchLocationFromRevisionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromRevisionName', () => { + const result = client.matchServiceFromRevisionName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRevisionFromRevisionName', () => { + const result = client.matchRevisionFromRevisionName(fakePath); + assert.strictEqual(result, "revisionValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('service', async () => { + const fakePath = "/rendered/path/service"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.servicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePath', () => { + const result = client.servicePath("projectValue", "locationValue", "serviceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServiceName', () => { + const result = client.matchProjectFromServiceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServiceName', () => { + const result = client.matchLocationFromServiceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromServiceName', () => { + const result = client.matchServiceFromServiceName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', async () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + task: "taskValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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", "executionValue", "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('matchExecutionFromTaskName', () => { + const result = client.matchExecutionFromTaskName(fakePath); + assert.strictEqual(result, "executionValue"); + 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('workerPool', async () => { + const fakePath = "/rendered/path/workerPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + worker_pool: "workerPoolValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, "workerPoolValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts new file mode 100644 index 00000000000..02f293fcb32 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts @@ -0,0 +1,1259 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as tasksModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, 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 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('v2.TasksClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new tasksModule.v2.TasksClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new tasksModule.v2.TasksClient(); + 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 = tasksModule.v2.TasksClient.servicePath; + assert.strictEqual(servicePath, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = tasksModule.v2.TasksClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new tasksModule.v2.TasksClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new tasksModule.v2.TasksClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 tasksModule.v2.TasksClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 tasksModule.v2.TasksClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 tasksModule.v2.TasksClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = tasksModule.v2.TasksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new tasksModule.v2.TasksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new tasksModule.v2.TasksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tasksStub, undefined); + await client.initialize(); + assert(client.tasksStub); + }); + + it('has close method for the initialized client', done => { + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.tasksStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.tasksStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new tasksModule.v2.TasksClient({ + 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 tasksModule.v2.TasksClient({ + 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('getTask', () => { + it('invokes getTask without error', async () => { + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.Task() + ); + client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTask( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getTask(request), expectedError); + }); + }); + + describe('listTasks', () => { + it('invokes listTasks without error', async () => { + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + generateSampleMessage(new protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + ]; + client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTasks( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + ]; + client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.Task[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.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.run.v2.Task[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + generateSampleMessage(new protos.google.cloud.run.v2.Task()), + ]; + client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.run.v2.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.run.v2.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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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('Path templates', () => { + + describe('cryptoKey', async () => { + const fakePath = "/rendered/path/cryptoKey"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + key_ring: "keyRingValue", + crypto_key: "cryptoKeyValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchKeyRingFromCryptoKeyName', () => { + const result = client.matchKeyRingFromCryptoKeyName(fakePath); + assert.strictEqual(result, "keyRingValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCryptoKeyFromCryptoKeyName', () => { + const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, "cryptoKeyValue"); + assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('execution', async () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromExecutionName', () => { + const result = client.matchJobFromExecutionName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('job', async () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('revision', async () => { + const fakePath = "/rendered/path/revision"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + revision: "revisionValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.revisionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.revisionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('revisionPath', () => { + const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRevisionName', () => { + const result = client.matchProjectFromRevisionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRevisionName', () => { + const result = client.matchLocationFromRevisionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromRevisionName', () => { + const result = client.matchServiceFromRevisionName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRevisionFromRevisionName', () => { + const result = client.matchRevisionFromRevisionName(fakePath); + assert.strictEqual(result, "revisionValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('service', async () => { + const fakePath = "/rendered/path/service"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.servicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePath', () => { + const result = client.servicePath("projectValue", "locationValue", "serviceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServiceName', () => { + const result = client.matchProjectFromServiceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServiceName', () => { + const result = client.matchLocationFromServiceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromServiceName', () => { + const result = client.matchServiceFromServiceName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', async () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + task: "taskValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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", "executionValue", "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('matchExecutionFromTaskName', () => { + const result = client.matchExecutionFromTaskName(fakePath); + assert.strictEqual(result, "executionValue"); + 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('workerPool', async () => { + const fakePath = "/rendered/path/workerPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + worker_pool: "workerPoolValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, "workerPoolValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts new file mode 100644 index 00000000000..f74aef7c940 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts @@ -0,0 +1,2243 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as workerpoolsModule 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('v2.WorkerPoolsClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient(); + 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 = workerpoolsModule.v2.WorkerPoolsClient.servicePath; + assert.strictEqual(servicePath, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = workerpoolsModule.v2.WorkerPoolsClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'run.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 workerpoolsModule.v2.WorkerPoolsClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 workerpoolsModule.v2.WorkerPoolsClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'run.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 workerpoolsModule.v2.WorkerPoolsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = workerpoolsModule.v2.WorkerPoolsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.workerPoolsStub, undefined); + await client.initialize(); + assert(client.workerPoolsStub); + }); + + it('has close method for the initialized client', done => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.workerPoolsStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.workerPoolsStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + 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 workerpoolsModule.v2.WorkerPoolsClient({ + 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('getWorkerPool', () => { + it('invokes getWorkerPool without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.WorkerPool() + ); + client.innerApiCalls.getWorkerPool = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkerPool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkerPool without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.run.v2.WorkerPool() + ); + client.innerApiCalls.getWorkerPool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkerPool( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.IWorkerPool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkerPool with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkerPool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getWorkerPool(request), expectedError); + const actualRequest = (client.innerApiCalls.getWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkerPool with closed client', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.GetWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getWorkerPool(request), expectedError); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIamPolicy with closed client', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.GetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getIamPolicy(request), expectedError); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setIamPolicy with closed client', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.SetIamPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.setIamPolicy(request), expectedError); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request), expectedError); + const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes testIamPermissions with closed client', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.iam.v1.TestIamPermissionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.testIamPermissions(request), expectedError); + }); + }); + + describe('createWorkerPool', () => { + it('invokes createWorkerPool without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkerPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.createWorkerPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkerPool without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkerPool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkerPool( + 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.createWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkerPool with call error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkerPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createWorkerPool(request), expectedError); + const actualRequest = (client.innerApiCalls.createWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkerPool with LRO error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.CreateWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkerPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createWorkerPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateWorkerPoolProgress without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateWorkerPoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateWorkerPoolProgress with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateWorkerPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateWorkerPool', () => { + it('invokes updateWorkerPool without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() + ); + request.workerPool = {}; + // path template: projects/*/locations/{location=*}/** + request.workerPool.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkerPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateWorkerPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkerPool without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() + ); + request.workerPool = {}; + // path template: projects/*/locations/{location=*}/** + request.workerPool.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkerPool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWorkerPool( + 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.updateWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkerPool with call error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() + ); + request.workerPool = {}; + // path template: projects/*/locations/{location=*}/** + request.workerPool.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkerPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateWorkerPool(request), expectedError); + const actualRequest = (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkerPool with LRO error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() + ); + request.workerPool = {}; + // path template: projects/*/locations/{location=*}/** + request.workerPool.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkerPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateWorkerPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateWorkerPoolProgress without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateWorkerPoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateWorkerPoolProgress with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateWorkerPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteWorkerPool', () => { + it('invokes deleteWorkerPool without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkerPool = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteWorkerPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkerPool without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkerPool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkerPool( + 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.deleteWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkerPool with call error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkerPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteWorkerPool(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkerPool with LRO error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() + ); + // path template: projects/*/locations/{location=*}/** + request.name = 'projects/value/locations/value/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkerPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteWorkerPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteWorkerPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteWorkerPoolProgress without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteWorkerPoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteWorkerPoolProgress with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteWorkerPoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listWorkerPools', () => { + it('invokes listWorkerPools without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListWorkerPoolsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + ]; + client.innerApiCalls.listWorkerPools = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkerPools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listWorkerPools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listWorkerPools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkerPools without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListWorkerPoolsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + ]; + client.innerApiCalls.listWorkerPools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkerPools( + request, + (err?: Error|null, result?: protos.google.cloud.run.v2.IWorkerPool[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listWorkerPools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listWorkerPools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkerPools with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListWorkerPoolsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkerPools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listWorkerPools(request), expectedError); + const actualRequest = (client.innerApiCalls.listWorkerPools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listWorkerPools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkerPoolsStream without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListWorkerPoolsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + ]; + client.descriptors.page.listWorkerPools.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listWorkerPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.WorkerPool[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.WorkerPool) => { + 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.listWorkerPools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkerPools, request)); + assert( + (client.descriptors.page.listWorkerPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listWorkerPoolsStream with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListWorkerPoolsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkerPools.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkerPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.run.v2.WorkerPool[] = []; + stream.on('data', (response: protos.google.cloud.run.v2.WorkerPool) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listWorkerPools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkerPools, request)); + assert( + (client.descriptors.page.listWorkerPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkerPools without error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListWorkerPoolsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), + ]; + client.descriptors.page.listWorkerPools.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.run.v2.IWorkerPool[] = []; + const iterable = client.listWorkerPoolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkerPools with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.run.v2.ListWorkerPoolsRequest() + ); + // path template: projects/*/locations/{location=*} + request.parent = 'projects/value/locations/value'; + const expectedHeaderRequestParams = 'location=value'; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkerPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkerPoolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.run.v2.IWorkerPool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listWorkerPools.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 workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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 workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + 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 workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + 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 workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + 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 workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('execution', async () => { + const fakePath = "/rendered/path/execution"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.executionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.executionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromExecutionName', () => { + const result = client.matchJobFromExecutionName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, "executionValue"); + assert((client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('job', async () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('revision', async () => { + const fakePath = "/rendered/path/revision"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + revision: "revisionValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.revisionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.revisionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('revisionPath', () => { + const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRevisionName', () => { + const result = client.matchProjectFromRevisionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRevisionName', () => { + const result = client.matchLocationFromRevisionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromRevisionName', () => { + const result = client.matchServiceFromRevisionName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRevisionFromRevisionName', () => { + const result = client.matchRevisionFromRevisionName(fakePath); + assert.strictEqual(result, "revisionValue"); + assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('service', async () => { + const fakePath = "/rendered/path/service"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + service: "serviceValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.servicePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePath', () => { + const result = client.servicePath("projectValue", "locationValue", "serviceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServiceName', () => { + const result = client.matchProjectFromServiceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServiceName', () => { + const result = client.matchLocationFromServiceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServiceFromServiceName', () => { + const result = client.matchServiceFromServiceName(fakePath); + assert.strictEqual(result, "serviceValue"); + assert((client.pathTemplates.servicePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', async () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + execution: "executionValue", + task: "taskValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await 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", "executionValue", "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('matchExecutionFromTaskName', () => { + const result = client.matchExecutionFromTaskName(fakePath); + assert.strictEqual(result, "executionValue"); + 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('workerPool', async () => { + const fakePath = "/rendered/path/workerPool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + worker_pool: "workerPoolValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, "workerPoolValue"); + assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-run/tsconfig.json b/owl-bot-staging/google-cloud-run/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/owl-bot-staging/google-cloud-run/webpack.config.js b/owl-bot-staging/google-cloud-run/webpack.config.js new file mode 100644 index 00000000000..20bb2f2a589 --- /dev/null +++ b/owl-bot-staging/google-cloud-run/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: 'Builds', + filename: './builds.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 54837815a69df8ca80d04fa421b0b30659086798 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 21 Jan 2026 20:34:48 +0000 Subject: [PATCH 2/3] =?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-run/.eslintignore | 7 - .../google-cloud-run/.eslintrc.json | 3 - .../google-cloud-run/.gitattributes | 4 - owl-bot-staging/google-cloud-run/.gitignore | 14 - owl-bot-staging/google-cloud-run/.jsdoc.js | 55 - owl-bot-staging/google-cloud-run/.mocharc.js | 33 - owl-bot-staging/google-cloud-run/.nycrc | 24 - .../google-cloud-run/.prettierignore | 6 - .../google-cloud-run/.prettierrc.js | 22 - .../google-cloud-run/CODE_OF_CONDUCT.md | 94 - .../google-cloud-run/CONTRIBUTING.md | 76 - owl-bot-staging/google-cloud-run/LICENSE | 202 - owl-bot-staging/google-cloud-run/README.md | 155 - .../protos/google/cloud/run/v2/build.proto | 175 - .../google/cloud/run/v2/condition.proto | 221 - .../google/cloud/run/v2/execution.proto | 316 - .../cloud/run/v2/execution_template.proto | 73 - .../google/cloud/run/v2/instance_split.proto | 67 - .../protos/google/cloud/run/v2/job.proto | 540 - .../protos/google/cloud/run/v2/k8s.min.proto | 483 - .../protos/google/cloud/run/v2/revision.proto | 331 - .../cloud/run/v2/revision_template.proto | 131 - .../protos/google/cloud/run/v2/service.proto | 520 - .../protos/google/cloud/run/v2/status.proto | 28 - .../protos/google/cloud/run/v2/task.proto | 291 - .../google/cloud/run/v2/task_template.proto | 80 - .../google/cloud/run/v2/traffic_target.proto | 77 - .../google/cloud/run/v2/vendor_settings.proto | 285 - .../google/cloud/run/v2/worker_pool.proto | 492 - .../v2/worker_pool_revision_template.proto | 109 - .../google-cloud-run/protos/protos.d.ts | 22927 ------ .../google-cloud-run/protos/protos.js | 61975 ---------------- .../google-cloud-run/protos/protos.json | 7802 -- .../generated/v2/builds.submit_build.js | 114 - .../v2/executions.cancel_execution.js | 75 - .../v2/executions.delete_execution.js | 75 - .../generated/v2/executions.get_execution.js | 64 - .../v2/executions.list_executions.js | 79 - .../samples/generated/v2/jobs.create_job.js | 80 - .../samples/generated/v2/jobs.delete_job.js | 74 - .../generated/v2/jobs.get_iam_policy.js | 67 - .../samples/generated/v2/jobs.get_job.js | 63 - .../samples/generated/v2/jobs.list_jobs.js | 78 - .../samples/generated/v2/jobs.run_job.js | 79 - .../generated/v2/jobs.set_iam_policy.js | 77 - .../generated/v2/jobs.test_iam_permissions.js | 70 - .../samples/generated/v2/jobs.update_job.js | 73 - .../generated/v2/revisions.delete_revision.js | 74 - .../generated/v2/revisions.get_revision.js | 63 - .../generated/v2/revisions.list_revisions.js | 79 - .../generated/v2/services.create_service.js | 81 - .../generated/v2/services.delete_service.js | 74 - .../generated/v2/services.get_iam_policy.js | 67 - .../generated/v2/services.get_service.js | 63 - .../generated/v2/services.list_services.js | 79 - .../generated/v2/services.set_iam_policy.js | 77 - .../v2/services.test_iam_permissions.js | 70 - .../generated/v2/services.update_service.js | 77 - .../snippet_metadata_google.cloud.run.v2.json | 1995 - .../samples/generated/v2/tasks.get_task.js | 63 - .../samples/generated/v2/tasks.list_tasks.js | 79 - .../v2/worker_pools.create_worker_pool.js | 83 - .../v2/worker_pools.delete_worker_pool.js | 75 - .../v2/worker_pools.get_iam_policy.js | 67 - .../v2/worker_pools.get_worker_pool.js | 64 - .../v2/worker_pools.list_worker_pools.js | 79 - .../v2/worker_pools.set_iam_policy.js | 77 - .../v2/worker_pools.test_iam_permissions.js | 70 - .../v2/worker_pools.update_worker_pool.js | 87 - owl-bot-staging/google-cloud-run/src/index.ts | 41 - .../google-cloud-run/src/v2/builds_client.ts | 974 - .../src/v2/builds_client_config.json | 30 - .../src/v2/builds_proto_list.json | 21 - .../src/v2/executions_client.ts | 1722 - .../src/v2/executions_client_config.json | 42 - .../src/v2/executions_proto_list.json | 21 - .../src/v2/gapic_metadata.json | 559 - .../google-cloud-run/src/v2/index.ts | 26 - .../google-cloud-run/src/v2/jobs_client.ts | 2361 - .../src/v2/jobs_client_config.json | 62 - .../src/v2/jobs_proto_list.json | 21 - .../src/v2/revisions_client.ts | 1716 - .../src/v2/revisions_client_config.json | 38 - .../src/v2/revisions_proto_list.json | 21 - .../src/v2/services_client.ts | 2232 - .../src/v2/services_client_config.json | 75 - .../src/v2/services_proto_list.json | 21 - .../google-cloud-run/src/v2/tasks_client.ts | 1293 - .../src/v2/tasks_client_config.json | 34 - .../src/v2/tasks_proto_list.json | 21 - .../src/v2/worker_pools_client.ts | 2243 - .../src/v2/worker_pools_client_config.json | 58 - .../src/v2/worker_pools_proto_list.json | 21 - .../system-test/fixtures/sample/src/index.js | 34 - .../system-test/fixtures/sample/src/index.ts | 74 - .../google-cloud-run/system-test/install.ts | 49 - .../google-cloud-run/test/gapic_builds_v2.ts | 865 - .../test/gapic_executions_v2.ts | 1784 - .../google-cloud-run/test/gapic_jobs_v2.ts | 2393 - .../test/gapic_revisions_v2.ts | 1669 - .../test/gapic_services_v2.ts | 2243 - .../google-cloud-run/test/gapic_tasks_v2.ts | 1259 - .../test/gapic_worker_pools_v2.ts | 2243 - .../google-cloud-run/tsconfig.json | 22 - .../google-cloud-run/webpack.config.js | 64 - packages/google-cloud-run/README.md | 6 + .../cloud/run/v2/container_status.proto | 0 .../protos/google/cloud/run/v2/instance.proto | 0 .../protos/google/cloud/run/v2/k8s.min.proto | 3 + packages/google-cloud-run/protos/protos.d.ts | 1329 + packages/google-cloud-run/protos/protos.js | 3657 + packages/google-cloud-run/protos/protos.json | 627 + .../generated/v2/instances.create_instance.js | 0 .../generated/v2/instances.delete_instance.js | 0 .../generated/v2/instances.get_instance.js | 0 .../generated/v2/instances.list_instances.js | 0 .../generated/v2/instances.start_instance.js | 0 .../generated/v2/instances.stop_instance.js | 0 .../snippet_metadata_google.cloud.run.v2.json | 288 + packages/google-cloud-run/src/index.ts | 6 +- .../google-cloud-run/src/v2/builds_client.ts | 52 + .../src/v2/builds_proto_list.json | 2 + .../src/v2/executions_client.ts | 52 + .../src/v2/executions_proto_list.json | 2 + .../src/v2/gapic_metadata.json | 78 + packages/google-cloud-run/src/v2/index.ts | 1 + .../src/v2/instances_client.ts | 0 .../src/v2/instances_client_config.json | 0 .../src/v2/instances_proto_list.json | 0 .../google-cloud-run/src/v2/jobs_client.ts | 52 + .../src/v2/jobs_proto_list.json | 2 + .../src/v2/revisions_client.ts | 52 + .../src/v2/revisions_proto_list.json | 2 + .../src/v2/services_client.ts | 52 + .../src/v2/services_proto_list.json | 2 + .../google-cloud-run/src/v2/tasks_client.ts | 52 + .../src/v2/tasks_proto_list.json | 2 + .../src/v2/worker_pools_client.ts | 52 + .../src/v2/worker_pools_proto_list.json | 2 + .../system-test/fixtures/sample/src/index.js | 1 + .../system-test/fixtures/sample/src/index.ts | 8 +- .../google-cloud-run/test/gapic_builds_v2.ts | 46 + .../test/gapic_executions_v2.ts | 46 + .../test/gapic_instances_v2.ts | 0 .../google-cloud-run/test/gapic_jobs_v2.ts | 46 + .../test/gapic_revisions_v2.ts | 46 + .../test/gapic_services_v2.ts | 46 + .../google-cloud-run/test/gapic_tasks_v2.ts | 46 + .../test/gapic_worker_pools_v2.ts | 46 + 149 files changed, 6701 insertions(+), 128584 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-run/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-run/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-run/.gitattributes delete mode 100644 owl-bot-staging/google-cloud-run/.gitignore delete mode 100644 owl-bot-staging/google-cloud-run/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-run/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-run/.nycrc delete mode 100644 owl-bot-staging/google-cloud-run/.prettierignore delete mode 100644 owl-bot-staging/google-cloud-run/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/google-cloud-run/CONTRIBUTING.md delete mode 100644 owl-bot-staging/google-cloud-run/LICENSE delete mode 100644 owl-bot-staging/google-cloud-run/README.md delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-run/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-run/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.cancel_execution.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.delete_execution.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.get_execution.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.list_executions.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.create_job.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.delete_job.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_job.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.list_jobs.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.run_job.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.update_job.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.delete_revision.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.get_revision.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.list_revisions.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.create_service.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.delete_service.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_service.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.list_services.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.set_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.update_service.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.list_tasks.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js delete mode 100644 owl-bot-staging/google-cloud-run/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/builds_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/executions_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/index.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/services_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/services_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-run/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_builds_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-run/webpack.config.js rename {owl-bot-staging => packages}/google-cloud-run/protos/google/cloud/run/v2/container_status.proto (100%) rename {owl-bot-staging => packages}/google-cloud-run/protos/google/cloud/run/v2/instance.proto (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.create_instance.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.delete_instance.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.get_instance.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.list_instances.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.start_instance.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.stop_instance.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/src/v2/instances_client.ts (100%) rename {owl-bot-staging => packages}/google-cloud-run/src/v2/instances_client_config.json (100%) rename {owl-bot-staging => packages}/google-cloud-run/src/v2/instances_proto_list.json (100%) rename {owl-bot-staging => packages}/google-cloud-run/test/gapic_instances_v2.ts (100%) diff --git a/owl-bot-staging/google-cloud-run/.eslintignore b/owl-bot-staging/google-cloud-run/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-run/.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-run/.eslintrc.json b/owl-bot-staging/google-cloud-run/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-run/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-run/.gitattributes b/owl-bot-staging/google-cloud-run/.gitattributes deleted file mode 100644 index 33739cb74e4..00000000000 --- a/owl-bot-staging/google-cloud-run/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-run/.gitignore b/owl-bot-staging/google-cloud-run/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-run/.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-run/.jsdoc.js b/owl-bot-staging/google-cloud-run/.jsdoc.js deleted file mode 100644 index d1458969c83..00000000000 --- a/owl-bot-staging/google-cloud-run/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/run', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-run/.mocharc.js b/owl-bot-staging/google-cloud-run/.mocharc.js deleted file mode 100644 index 5eb34e86c87..00000000000 --- a/owl-bot-staging/google-cloud-run/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-run/.nycrc b/owl-bot-staging/google-cloud-run/.nycrc deleted file mode 100644 index 81a95fc94b0..00000000000 --- a/owl-bot-staging/google-cloud-run/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/.prettierignore b/owl-bot-staging/google-cloud-run/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/owl-bot-staging/google-cloud-run/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/google-cloud-run/.prettierrc.js b/owl-bot-staging/google-cloud-run/.prettierrc.js deleted file mode 100644 index 7649ee3c254..00000000000 --- a/owl-bot-staging/google-cloud-run/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a81..00000000000 --- a/owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/CONTRIBUTING.md b/owl-bot-staging/google-cloud-run/CONTRIBUTING.md deleted file mode 100644 index 5368c76a957..00000000000 --- a/owl-bot-staging/google-cloud-run/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Run API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - - -## Running the tests - -1. [Prepare your environment for Node.js setup][setup]. - -1. Install dependencies: - - npm install - -1. Run the tests: - - # Run unit tests. - npm test - - # Run sample integration tests. - npm run samples-test - - # Run all system tests. - npm run system-test - -1. Lint (and maybe fix) any changes: - - npm run fix - -[setup]: https://cloud.google.com/nodejs/docs/setup -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=run.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/LICENSE b/owl-bot-staging/google-cloud-run/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/owl-bot-staging/google-cloud-run/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-run/README.md b/owl-bot-staging/google-cloud-run/README.md deleted file mode 100644 index 5e764dd1d71..00000000000 --- a/owl-bot-staging/google-cloud-run/README.md +++ /dev/null @@ -1,155 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Cloud Run Admin API: Nodejs Client][homepage] - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority - -[![npm version](https://img.shields.io/npm/v/@google-cloud/run.svg)](https://www.npmjs.org/package/@google-cloud/run) - -Cloud Run Admin API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Cloud Run Admin API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/run/latest) - - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Cloud Run Admin API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/run -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | -| --------------------------- | --------------------------------- | -| submit build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/builds.submit_build.js) | -| cancel execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js) | -| delete execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js) | -| get execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js) | -| list executions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js) | -| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.create_instance.js) | -| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.delete_instance.js) | -| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.get_instance.js) | -| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.list_instances.js) | -| start instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.start_instance.js) | -| stop instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.stop_instance.js) | -| create job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.create_job.js) | -| delete job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.delete_job.js) | -| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js) | -| get job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.get_job.js) | -| list jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.list_jobs.js) | -| run job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.run_job.js) | -| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js) | -| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js) | -| update job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.update_job.js) | -| delete revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/revisions.delete_revision.js) | -| get revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/revisions.get_revision.js) | -| list revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/revisions.list_revisions.js) | -| create service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.create_service.js) | -| delete service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.delete_service.js) | -| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.get_iam_policy.js) | -| get service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.get_service.js) | -| list services | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.list_services.js) | -| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.set_iam_policy.js) | -| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js) | -| update service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.update_service.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json) | -| get task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/tasks.get_task.js) | -| list tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/tasks.list_tasks.js) | -| create worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js) | -| delete worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js) | -| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js) | -| get worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js) | -| list worker pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js) | -| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js) | -| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js) | -| update worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js) | - - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/run@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/LICENSE) - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=run.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto deleted file mode 100644 index d2eb5f6566e..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "BuildProto"; -option java_package = "com.google.cloud.run.v2"; -option (google.api.resource_definition) = { - type: "cloudbuild.googleapis.com/BuildWorkerPool" - pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" -}; - -// Cloud Run Build Control Plane API -service Builds { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Submits a build in a given project. - rpc SubmitBuild(SubmitBuildRequest) returns (SubmitBuildResponse) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/locations/*}/builds:submit" - body: "*" - }; - } -} - -// Request message for submitting a Build. -message SubmitBuildRequest { - // Build the source using Docker. This means the source has a Dockerfile. - message DockerBuild {} - - // Build the source using Buildpacks. - message BuildpacksBuild { - // The runtime name, e.g. 'go113'. Leave blank for generic builds. - string runtime = 1 [deprecated = true]; - - // Optional. Name of the function target if the source is a function source. - // Required for function builds. - string function_target = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. cache_image_uri is the GCR/AR URL where the cache image will be - // stored. cache_image_uri is optional and omitting it will disable caching. - // This URL must be stable across builds. It is used to derive a - // build-specific temporary URL by substituting the tag with the build ID. - // The build will clean up the temporary image on a best-effort basis. - string cache_image_uri = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The base image to use for the build. - string base_image = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. User-provided build-time environment variables. - map environment_variables = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether or not the application container will be enrolled in - // automatic base image updates. When true, the application will be built on - // a scratch base image, so the base layers can be appended at run time. - bool enable_automatic_updates = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. project_descriptor stores the path to the project descriptor - // file. When empty, it means that there is no project descriptor file in - // the source. - string project_descriptor = 7 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The project and location to build in. Location must be a region, - // e.g., 'us-central1' or 'global' if the global builder is to be used. - // Format: - // `projects/{project}/locations/{location}` - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // Location of source. - oneof source { - // Required. Source for the build. - StorageSource storage_source = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Artifact Registry URI to store the built image. - string image_uri = 3 [(google.api.field_behavior) = REQUIRED]; - - // Build type must be one of the following. - oneof build_type { - // Build the source using Buildpacks. - BuildpacksBuild buildpack_build = 4; - - // Build the source using Docker. This means the source has a Dockerfile. - DockerBuild docker_build = 5; - } - - // Optional. The service account to use for the build. If not set, the default - // Cloud Build service account for the project will be used. - string service_account = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Name of the Cloud Build Custom Worker Pool that should be used to - // build the function. The format of this field is - // `projects/{project}/locations/{region}/workerPools/{workerPool}` where - // `{project}` and `{region}` are the project id and region respectively where - // the worker pool is defined and `{workerPool}` is the short name of the - // worker pool. - string worker_pool = 7 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudbuild.googleapis.com/BuildWorkerPool" - } - ]; - - // Optional. Additional tags to annotate the build. - repeated string tags = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The machine type from default pool to use for the build. If left - // blank, cloudbuild will use a sensible default. Currently only E2_HIGHCPU_8 - // is supported. If worker_pool is set, this field will be ignored. - string machine_type = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The release track of the client that initiated the build request. - google.api.LaunchStage release_track = 10 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The client that initiated the build request. - string client = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for submitting a Build. -message SubmitBuildResponse { - // Cloud Build operation to be polled via CloudBuild API. - google.longrunning.Operation build_operation = 1; - - // URI of the base builder image in Artifact Registry being used in the build. - // Used to opt into automatic base image updates. - string base_image_uri = 2; - - // Warning message for the base image. - string base_image_warning = 3; -} - -// Location of the source in an archive file in Google Cloud Storage. -message StorageSource { - // Required. Google Cloud Storage bucket containing the source (see - // [Bucket Name - // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - string bucket = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Google Cloud Storage object containing the source. - // - // This object must be a gzipped archive file (`.tar.gz`) containing source to - // build. - string object = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Google Cloud Storage generation for the object. If the generation - // is omitted, the latest generation will be used. - int64 generation = 3 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto deleted file mode 100644 index b7b5b10d15e..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "ConditionProto"; -option java_package = "com.google.cloud.run.v2"; - -// Defines a status condition for a resource. -message Condition { - // Represents the possible Condition states. - enum State { - // The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0; - - // Transient state: Reconciliation has not started yet. - CONDITION_PENDING = 1; - - // Transient state: reconciliation is still in progress. - CONDITION_RECONCILING = 2; - - // Terminal state: Reconciliation did not succeed. - CONDITION_FAILED = 3; - - // Terminal state: Reconciliation completed successfully. - CONDITION_SUCCEEDED = 4; - } - - // Represents the severity of the condition failures. - enum Severity { - // Unspecified severity - SEVERITY_UNSPECIFIED = 0; - - // Error severity. - ERROR = 1; - - // Warning severity. - WARNING = 2; - - // Info severity. - INFO = 3; - } - - // Reasons common to all types of conditions. - enum CommonReason { - // Default value. - COMMON_REASON_UNDEFINED = 0; - - // Reason unknown. Further details will be in message. - UNKNOWN = 1; - - // Revision creation process failed. - REVISION_FAILED = 3; - - // Timed out waiting for completion. - PROGRESS_DEADLINE_EXCEEDED = 4; - - // The container image path is incorrect. - CONTAINER_MISSING = 6; - - // Insufficient permissions on the container image. - CONTAINER_PERMISSION_DENIED = 7; - - // Container image is not authorized by policy. - CONTAINER_IMAGE_UNAUTHORIZED = 8; - - // Container image policy authorization check failed. - CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9; - - // Insufficient permissions on encryption key. - ENCRYPTION_KEY_PERMISSION_DENIED = 10; - - // Permission check on encryption key failed. - ENCRYPTION_KEY_CHECK_FAILED = 11; - - // At least one Access check on secrets failed. - SECRETS_ACCESS_CHECK_FAILED = 12; - - // Waiting for operation to complete. - WAITING_FOR_OPERATION = 13; - - // System will retry immediately. - IMMEDIATE_RETRY = 14; - - // System will retry later; current attempt failed. - POSTPONED_RETRY = 15; - - // An internal error occurred. Further information may be in the message. - INTERNAL = 16; - - // User-provided VPC network was not found. - VPC_NETWORK_NOT_FOUND = 17; - } - - // Reasons specific to Revision resource. - enum RevisionReason { - // Default value. - REVISION_REASON_UNDEFINED = 0; - - // Revision in Pending state. - PENDING = 1; - - // Revision is in Reserve state. - RESERVE = 2; - - // Revision is Retired. - RETIRED = 3; - - // Revision is being retired. - RETIRING = 4; - - // Revision is being recreated. - RECREATING = 5; - - // There was a health check error. - HEALTH_CHECK_CONTAINER_ERROR = 6; - - // Health check failed due to user error from customized path of the - // container. System will retry. - CUSTOMIZED_PATH_RESPONSE_PENDING = 7; - - // A revision with min_instance_count > 0 was created and is reserved, but - // it was not configured to serve traffic, so it's not live. This can also - // happen momentarily during traffic migration. - MIN_INSTANCES_NOT_PROVISIONED = 8; - - // The maximum allowed number of active revisions has been reached. - ACTIVE_REVISION_LIMIT_REACHED = 9; - - // There was no deployment defined. - // This value is no longer used, but Services created in older versions of - // the API might contain this value. - NO_DEPLOYMENT = 10; - - // A revision's container has no port specified since the revision is of a - // manually scaled service with 0 instance count - HEALTH_CHECK_SKIPPED = 11; - - // A revision with min_instance_count > 0 was created and is waiting for - // enough instances to begin a traffic migration. - MIN_INSTANCES_WARMING = 12; - } - - // Reasons specific to Execution resource. - enum ExecutionReason { - // Default value. - EXECUTION_REASON_UNDEFINED = 0; - - // Internal system error getting execution status. System will retry. - JOB_STATUS_SERVICE_POLLING_ERROR = 1; - - // A task reached its retry limit and the last attempt failed due to the - // user container exiting with a non-zero exit code. - NON_ZERO_EXIT_CODE = 2; - - // The execution was cancelled by users. - CANCELLED = 3; - - // The execution is in the process of being cancelled. - CANCELLING = 4; - - // The execution was deleted. - DELETED = 5; - - // A delayed execution is waiting for a start time. - DELAYED_START_PENDING = 6; - } - - // type is used to communicate the status of the reconciliation process. - // See also: - // https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting - // Types common to all resources include: - // * "Ready": True when the Resource is ready. - string type = 1; - - // State of the condition. - State state = 2; - - // Human readable message indicating details about the current status. - string message = 3; - - // Last time the condition transitioned from one status to another. - google.protobuf.Timestamp last_transition_time = 4; - - // How to interpret failures of this condition, one of Error, Warning, Info - Severity severity = 5; - - // The reason for this condition. Depending on the condition type, - // it will populate one of these fields. - // Successful conditions cannot have a reason. - oneof reasons { - // Output only. A common (service-level) reason for this condition. - CommonReason reason = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A reason for the revision condition. - RevisionReason revision_reason = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A reason for the execution condition. - ExecutionReason execution_reason = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto deleted file mode 100644 index a181fb1bd26..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/task_template.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "ExecutionProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run Execution Control Plane API. -service Executions { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Gets information about an Execution. - rpc GetExecution(GetExecutionRequest) returns (Execution) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Executions from a Job. Results are sorted by creation time, - // descending. - rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*/jobs/*}/executions" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes an Execution. - rpc DeleteExecution(DeleteExecutionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Execution" - metadata_type: "Execution" - }; - } - - // Cancels an Execution. - rpc CancelExecution(CancelExecutionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Execution" - metadata_type: "Execution" - }; - } -} - -// Request message for obtaining a Execution by its full name. -message GetExecutionRequest { - // Required. The full name of the Execution. - // Format: - // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - // where `{project}` can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } - ]; -} - -// Request message for retrieving a list of Executions. -message ListExecutionsRequest { - // Required. The Execution from which the Executions should be listed. - // To list all Executions across Jobs, use "-" instead of Job name. - // Format: `projects/{project}/locations/{location}/jobs/{job}`, where - // `{project}` can be project id or number. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/Execution" - } - ]; - - // Maximum number of Executions to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListExecutions. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of Executions. -message ListExecutionsResponse { - // The resulting list of Executions. - repeated Execution executions = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListExecutions request to continue. - string next_page_token = 2; -} - -// Request message for deleting an Execution. -message DeleteExecutionRequest { - // Required. The name of the Execution to delete. - // Format: - // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - // where `{project}` can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } - ]; - - // Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 2; - - // A system-generated fingerprint for this version of the resource. - // This may be used to detect modification conflict during updates. - string etag = 3; -} - -// Request message for deleting an Execution. -message CancelExecutionRequest { - // Required. The name of the Execution to cancel. - // Format: - // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - // where `{project}` can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } - ]; - - // Indicates that the request should be validated without actually - // cancelling any resources. - bool validate_only = 2; - - // A system-generated fingerprint for this version of the resource. - // This may be used to detect modification conflict during updates. - string etag = 3; -} - -// Execution represents the configuration of a single execution. A execution an -// immutable resource that references a container image which is run to -// completion. -message Execution { - option (google.api.resource) = { - type: "run.googleapis.com/Execution" - pattern: "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}" - style: DECLARATIVE_FRIENDLY - }; - - // Output only. The unique name of this Execution. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server assigned unique identifier for the Execution. The value - // is a UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the authenticated creator. - string creator = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels - map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that may - // be set by external tools to store and arbitrary metadata. - // They are not queryable and should be preserved - // when modifying objects. - map annotations = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the execution was acknowledged by the - // execution controller. It is not guaranteed to be set in happens-before - // order across separate operations. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the execution started to run. - // It is not guaranteed to be set in happens-before order across separate - // operations. - google.protobuf.Timestamp start_time = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the execution was completed. It is not - // guaranteed to be set in happens-before order across separate operations. - google.protobuf.Timestamp completion_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the deletion time. It is only - // populated as a response to a Delete request. - google.protobuf.Timestamp delete_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permamently deleted. It is only populated as a response to a Delete - // request. - google.protobuf.Timestamp expire_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The least stable launch stage needed to create this resource, as defined by - // [Google Cloud Platform Launch - // Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - // `ALPHA`, `BETA`, and `GA`. - // - // Note that this value might not be what was used - // as input. For example, if ALPHA was provided as input in the parent - // resource, but only BETA and GA-level features are were, this field will be - // BETA. - google.api.LaunchStage launch_stage = 11; - - // Output only. The name of the parent Job. - string job = 12 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Job" } - ]; - - // Output only. Specifies the maximum desired number of tasks the execution - // should run at any given time. Must be <= task_count. The actual number of - // tasks running in steady state will be less than this number when - // ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when - // the work left to do is less than max parallelism. - int32 parallelism = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Specifies the desired number of tasks the execution should - // run. Setting to 1 means that parallelism is limited to 1 and the success of - // that task signals the success of the execution. - int32 task_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The template used to create tasks for this execution. - TaskTemplate template = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Indicates whether the resource's reconciliation is still in - // progress. See comments in `Job.reconciling` for additional information on - // reconciliation process in Cloud Run. - bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this Execution, containing its readiness - // status, and detailed error information in case it did not reach the desired - // state. - repeated Condition conditions = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The generation of this Execution. See comments in - // `reconciling` for additional information on reconciliation process in Cloud - // Run. - int64 observed_generation = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of actively running tasks. - int32 running_count = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of tasks which reached phase Succeeded. - int32 succeeded_count = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of tasks which reached phase Failed. - int32 failed_count = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of tasks which reached phase Cancelled. - int32 cancelled_count = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of tasks which have retried at least once. - int32 retried_count = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. URI where logs for this execution can be found in Cloud - // Console. - string log_uri = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto deleted file mode 100644 index 5a57620efd7..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/cloud/run/v2/task_template.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "ExecutionTemplateProto"; -option java_package = "com.google.cloud.run.v2"; - -// ExecutionTemplate describes the data an execution should have when created -// from a template. -message ExecutionTemplate { - // Unstructured key value map that can be used to organize and categorize - // objects. - // User-provided labels are shared with Google's billing system, so they can - // be used to filter, or break down billing charges by team, component, - // environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - //

Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 ExecutionTemplate. - map labels = 1; - - // Unstructured key value map that may be set by external tools to store and - // arbitrary metadata. They are not queryable and should be preserved - // when modifying objects. - // - //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system annotations in v1 now - // have a corresponding field in v2 ExecutionTemplate. - // - //

This field follows Kubernetes annotations' namespacing, limits, and - // rules. - map annotations = 2; - - // Optional. Specifies the maximum desired number of tasks the execution - // should run at given time. When the job is run, if this field is 0 or unset, - // the maximum possible value will be used for that execution. The actual - // number of tasks running in steady state will be less than this number when - // there are fewer tasks waiting to be completed remaining, i.e. when the work - // left to do is less than max parallelism. - int32 parallelism = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Specifies the desired number of tasks the execution should run. - // Setting to 1 means that parallelism is limited to 1 and the success of - // that task signals the success of the execution. Defaults to 1. - int32 task_count = 4; - - // Required. Describes the task(s) that will be created when executing an - // execution. - TaskTemplate template = 5 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto deleted file mode 100644 index bfce369f857..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "InstanceSplitProto"; -option java_package = "com.google.cloud.run.v2"; - -// Holds a single instance split entry for the Worker. Allocations can be done -// to a specific Revision name, or pointing to the latest Ready Revision. -message InstanceSplit { - // The allocation type for this instance split. - InstanceSplitAllocationType type = 1; - - // Revision to which to assign this portion of instances, if split allocation - // is by revision. - string revision = 2 [ - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Specifies percent of the instance split to this Revision. - // This defaults to zero if unspecified. - int32 percent = 3; -} - -// Represents the observed state of a single `InstanceSplit` entry. -message InstanceSplitStatus { - // The allocation type for this instance split. - InstanceSplitAllocationType type = 1; - - // Revision to which this instance split is assigned. - string revision = 2 [ - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Specifies percent of the instance split to this Revision. - int32 percent = 3; -} - -// The type of instance split allocation. -enum InstanceSplitAllocationType { - // Unspecified instance allocation type. - INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED = 0; - - // Allocates instances to the Service's latest ready Revision. - INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST = 1; - - // Allocates instances to a Revision by name. - INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION = 2; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto deleted file mode 100644 index ad54a7268cb..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto +++ /dev/null @@ -1,540 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/api/routing.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/execution.proto"; -import "google/cloud/run/v2/execution_template.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "JobProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run Job Control Plane API. -service Jobs { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a Job. - rpc CreateJob(CreateJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/locations/*}/jobs" - body: "job" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent,job,job_id"; - option (google.longrunning.operation_info) = { - response_type: "Job" - metadata_type: "Job" - }; - } - - // Gets information about a Job. - rpc GetJob(GetJobRequest) returns (Job) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists Jobs. Results are sorted by creation time, descending. - rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*}/jobs" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a Job. - rpc UpdateJob(UpdateJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v2/{job.name=projects/*/locations/*/jobs/*}" - body: "job" - }; - option (google.api.routing) = { - routing_parameters { - field: "job.name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "job"; - option (google.longrunning.operation_info) = { - response_type: "Job" - metadata_type: "Job" - }; - } - - // Deletes a Job. - rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Job" - metadata_type: "Job" - }; - } - - // Triggers creation of a new Execution of this Job. - rpc RunJob(RunJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/jobs/*}:run" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Execution" - metadata_type: "Execution" - }; - } - - // Gets the IAM Access Control policy currently in effect for the given Job. - // This result does not include any inherited policies. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - get: "/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy" - }; - } - - // Sets the IAM Access control policy for the specified Job. Overwrites - // any existing policy. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy" - body: "*" - }; - } - - // Returns permissions that a caller has on the specified Project. - // - // There are no permissions required for making this API call. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions" - body: "*" - }; - } -} - -// Request message for creating a Job. -message CreateJobRequest { - // Required. The location and project in which this Job should be created. - // Format: projects/{project}/locations/{location}, where {project} can be - // project id or number. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "run.googleapis.com/Job" } - ]; - - // Required. The Job instance to create. - Job job = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The unique identifier for the Job. The name of the job becomes - // {parent}/jobs/{job_id}. - string job_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Indicates that the request should be validated and default values - // populated, without persisting the request or creating any resources. - bool validate_only = 4; -} - -// Request message for obtaining a Job by its full name. -message GetJobRequest { - // Required. The full name of the Job. - // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - // can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Job" } - ]; -} - -// Request message for updating a Job. -message UpdateJobRequest { - // Required. The Job to be updated. - Job job = 1 [(google.api.field_behavior) = REQUIRED]; - - // Indicates that the request should be validated and default values - // populated, without persisting the request or updating any resources. - bool validate_only = 3; - - // Optional. If set to true, and if the Job does not exist, it will create a - // new one. Caller must have both create and update permissions for this call - // if this is set to true. - bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for retrieving a list of Jobs. -message ListJobsRequest { - // Required. The location and project to list resources on. - // Format: projects/{project}/locations/{location}, where {project} can be - // project id or number. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "run.googleapis.com/Job" } - ]; - - // Maximum number of Jobs to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListJobs. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of Jobs. -message ListJobsResponse { - // The resulting list of Jobs. - repeated Job jobs = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListJobs request to continue. - string next_page_token = 2; -} - -// Request message to delete a Job by its full name. -message DeleteJobRequest { - // Required. The full name of the Job. - // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - // can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Job" } - ]; - - // Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 3; - - // A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 4; -} - -// Request message to create a new Execution of a Job. -message RunJobRequest { - // RunJob Overrides that contains Execution fields to be overridden. - message Overrides { - // Per-container override specification. - message ContainerOverride { - // The name of the container specified as a DNS_LABEL. - string name = 1; - - // Optional. Arguments to the entrypoint. Will replace existing args for - // override. - repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; - - // List of environment variables to set in the container. Will be merged - // with existing env for override. - repeated EnvVar env = 3; - - // Optional. True if the intention is to clear out existing args list. - bool clear_args = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Per container override specification. - repeated ContainerOverride container_overrides = 1; - - // Optional. The desired number of tasks the execution should run. Will - // replace existing task_count value. - int32 task_count = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Duration in seconds the task may be active before the system will - // actively try to mark it failed and kill associated containers. Will - // replace existing timeout_seconds value. - google.protobuf.Duration timeout = 4; - } - - // Required. The full name of the Job. - // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - // can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Job" } - ]; - - // Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 2; - - // A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 3; - - // Overrides specification for a given execution of a job. If provided, - // overrides will be applied to update the execution or task spec. - Overrides overrides = 4; -} - -// Job represents the configuration of a single job, which references a -// container image that is run to completion. -message Job { - option (google.api.resource) = { - type: "run.googleapis.com/Job" - pattern: "projects/{project}/locations/{location}/jobs/{job}" - style: DECLARATIVE_FRIENDLY - }; - - // The fully qualified name of this Job. - // - // Format: - // projects/{project}/locations/{location}/jobs/{job} - string name = 1; - - // Output only. Server assigned unique identifier for the Execution. The value - // is a UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Unstructured key value map that can be used to organize and categorize - // objects. - // User-provided labels are shared with Google's billing system, so they can - // be used to filter, or break down billing charges by team, component, - // environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - //

Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 Job. - map labels = 4; - - // Unstructured key value map that may - // be set by external tools to store and arbitrary metadata. - // They are not queryable and should be preserved - // when modifying objects. - // - //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected on new resources. All system - // annotations in v1 now have a corresponding field in v2 Job. - // - //

This field follows Kubernetes annotations' namespacing, limits, and - // rules. - map annotations = 5; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The deletion time. It is only populated as a response to a - // Delete request. - google.protobuf.Timestamp delete_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permamently deleted. - google.protobuf.Timestamp expire_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the authenticated creator. - string creator = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the last authenticated modifier. - string last_modifier = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Arbitrary identifier for the API client. - string client = 12; - - // Arbitrary version identifier for the API client. - string client_version = 13; - - // The launch stage as defined by [Google Cloud Platform - // Launch Stages](https://cloud.google.com/terms/launch-stages). - // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - // is assumed. - // Set the launch stage to a preview stage on input to allow use of preview - // features in that stage. On read (or output), describes whether the resource - // uses preview features. - // - // For example, if ALPHA is provided as input, but only BETA and GA-level - // features are used, this field will be BETA on output. - google.api.LaunchStage launch_stage = 14; - - // Settings for the Binary Authorization feature. - BinaryAuthorization binary_authorization = 15; - - // Required. The template used to create executions for this Job. - ExecutionTemplate template = 16 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The generation of this Job. See comments in `reconciling` for - // additional information on reconciliation process in Cloud Run. - int64 observed_generation = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this Job, containing its readiness status, - // and detailed error information in case it did not reach the desired state. - Condition terminal_condition = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Conditions of all other associated sub-resources. They - // contain additional diagnostics information in case the Job does not reach - // its desired state. See comments in `reconciling` for additional information - // on reconciliation process in Cloud Run. - repeated Condition conditions = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Number of executions created for this job. - int32 execution_count = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the last created execution. - ExecutionReference latest_created_execution = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Returns true if the Job is currently being acted upon by the - // system to bring it into the desired state. - // - // When a new Job is created, or an existing one is updated, Cloud Run - // will asynchronously perform all necessary steps to bring the Job to the - // desired state. This process is called reconciliation. - // While reconciliation is in process, `observed_generation` and - // `latest_succeeded_execution`, will have transient values that might - // mismatch the intended state: Once reconciliation is over (and this field is - // false), there are two possible outcomes: reconciliation succeeded and the - // state matches the Job, or there was an error, and reconciliation failed. - // This state can be found in `terminal_condition.state`. - // - // If reconciliation succeeded, the following fields will match: - // `observed_generation` and `generation`, `latest_succeeded_execution` and - // `latest_created_execution`. - // - // If reconciliation failed, `observed_generation` and - // `latest_succeeded_execution` will have the state of the last succeeded - // execution or empty for newly created Job. Additional information on the - // failure can be found in `terminal_condition` and `conditions`. - bool reconciling = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; - - oneof create_execution { - // A unique string used as a suffix creating a new execution. The Job will - // become ready when the execution is successfully started. - // The sum of job name and token length must be fewer than 63 characters. - string start_execution_token = 26; - - // A unique string used as a suffix for creating a new execution. The Job - // will become ready when the execution is successfully completed. - // The sum of job name and token length must be fewer than 63 characters. - string run_execution_token = 27; - } - - // Optional. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OPTIONAL]; -} - -// Reference to an Execution. Use /Executions.GetExecution with the given name -// to get full execution including the latest status. -message ExecutionReference { - // Possible execution completion status. - enum CompletionStatus { - // The default value. This value is used if the state is omitted. - COMPLETION_STATUS_UNSPECIFIED = 0; - - // Job execution has succeeded. - EXECUTION_SUCCEEDED = 1; - - // Job execution has failed. - EXECUTION_FAILED = 2; - - // Job execution is running normally. - EXECUTION_RUNNING = 3; - - // Waiting for backing resources to be provisioned. - EXECUTION_PENDING = 4; - - // Job execution has been cancelled by the user. - EXECUTION_CANCELLED = 5; - } - - // Name of the execution. - string name = 1 [ - (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } - ]; - - // Creation timestamp of the execution. - google.protobuf.Timestamp create_time = 2; - - // Creation timestamp of the execution. - google.protobuf.Timestamp completion_time = 3; - - // The deletion time of the execution. It is only - // populated as a response to a Delete request. - google.protobuf.Timestamp delete_time = 5; - - // Status for the execution completion. - CompletionStatus completion_status = 4; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto deleted file mode 100644 index 0fe03f27aac..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto +++ /dev/null @@ -1,483 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "K8sMinProto"; -option java_package = "com.google.cloud.run.v2"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" -}; -option (google.api.resource_definition) = { - type: "secretmanager.googleapis.com/Secret" - pattern: "projects/{project}/secrets/{secret}" -}; -option (google.api.resource_definition) = { - type: "secretmanager.googleapis.com/SecretVersion" - pattern: "projects/{project}/secrets/{secret}/versions/{version}" -}; -option (google.api.resource_definition) = { - type: "vpcaccess.googleapis.com/Connector" - pattern: "projects/{project}/locations/{location}/connectors/{connector}" -}; - -// A single application container. -// This specifies both the container to run, the command to run in the container -// and the arguments to supply to it. -// Note that additional arguments can be supplied by the system to the container -// at runtime. -message Container { - // Name of the container specified as a DNS_LABEL (RFC 1123). - string name = 1; - - // Required. Name of the container image in Dockerhub, Google Artifact - // Registry, or Google Container Registry. If the host is not provided, - // Dockerhub is assumed. - string image = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Location of the source. - SourceCode source_code = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Entrypoint array. Not executed within a shell. - // The docker image's ENTRYPOINT is used if this is not provided. - repeated string command = 3; - - // Arguments to the entrypoint. - // The docker image's CMD is used if this is not provided. - repeated string args = 4; - - // List of environment variables to set in the container. - repeated EnvVar env = 5; - - // Compute Resource requirements by this container. - ResourceRequirements resources = 6; - - // List of ports to expose from the container. Only a single port can be - // specified. The specified ports must be listening on all interfaces - // (0.0.0.0) within the container to be accessible. - // - // If omitted, a port number will be chosen and passed to the container - // through the PORT environment variable for the container to listen on. - repeated ContainerPort ports = 7; - - // Volume to mount into the container's filesystem. - repeated VolumeMount volume_mounts = 8; - - // Container's working directory. - // If not specified, the container runtime's default will be used, which - // might be configured in the container image. - string working_dir = 9; - - // Periodic probe of container liveness. - // Container will be restarted if the probe fails. - Probe liveness_probe = 10; - - // Startup probe of application within the container. - // All other probes are disabled if a startup probe is provided, until it - // succeeds. Container will not be added to service endpoints if the probe - // fails. - Probe startup_probe = 11; - - // Readiness probe to be used for health checks. - Probe readiness_probe = 14; - - // Names of the containers that must start before this container. - repeated string depends_on = 12; - - // Base image for this container. Only supported for services. If set, it - // indicates that the service is enrolled into automatic base image update. - string base_image_uri = 13; - - // Output only. The build info of the container image. - BuildInfo build_info = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// ResourceRequirements describes the compute resource requirements. -message ResourceRequirements { - // Only `memory`, `cpu` and `nvidia.com/gpu` keys in the map are supported. - // - //

Notes: - // * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 - // CPU requires at least 2Gi of memory. For more information, go to - // https://cloud.google.com/run/docs/configuring/cpu. - // * For supported 'memory' values and syntax, go to - // https://cloud.google.com/run/docs/configuring/memory-limits - // * The only supported 'nvidia.com/gpu' value is '1'. - map limits = 1; - - // Determines whether CPU is only allocated during requests (true by default). - // However, if ResourceRequirements is set, the caller must explicitly - // set this field to true to preserve the default behavior. - bool cpu_idle = 2; - - // Determines whether CPU should be boosted on startup of a new container - // instance above the requested CPU threshold, this can help reduce cold-start - // latency. - bool startup_cpu_boost = 3; -} - -// EnvVar represents an environment variable present in a Container. -message EnvVar { - // Required. Name of the environment variable. Must not exceed 32768 - // characters. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - oneof values { - // Literal value of the environment variable. - // Defaults to "", and the maximum length is 32768 bytes. - // Variable references are not supported in Cloud Run. - string value = 2; - - // Source for the environment variable's value. - EnvVarSource value_source = 3; - } -} - -// EnvVarSource represents a source for the value of an EnvVar. -message EnvVarSource { - // Selects a secret and a specific version from Cloud Secret Manager. - SecretKeySelector secret_key_ref = 1; -} - -// SecretEnvVarSource represents a source for the value of an EnvVar. -message SecretKeySelector { - // Required. The name of the secret in Cloud Secret Manager. - // Format: {secret_name} if the secret is in the same project. - // projects/{project}/secrets/{secret_name} if the secret is - // in a different project. - string secret = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "secretmanager.googleapis.com/Secret" - } - ]; - - // The Cloud Secret Manager secret version. - // Can be 'latest' for the latest version, an integer for a specific version, - // or a version alias. - string version = 2 [(google.api.resource_reference) = { - type: "secretmanager.googleapis.com/SecretVersion" - }]; -} - -// ContainerPort represents a network port in a single container. -message ContainerPort { - // If specified, used to specify which protocol to use. - // Allowed values are "http1" and "h2c". - string name = 1; - - // Port number the container listens on. - // This must be a valid TCP port number, 0 < container_port < 65536. - int32 container_port = 3; -} - -// VolumeMount describes a mounting of a Volume within a container. -message VolumeMount { - // Required. This must match the Name of a Volume. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Path within the container at which the volume should be mounted. - // Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must - // otherwise be `/cloudsql`. All instances defined in the Volume will be - // available as `/cloudsql/[instance]`. For more information on Cloud SQL - // volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run - string mount_path = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Path within the volume from which the container's volume should - // be mounted. Defaults to "" (volume's root). - string sub_path = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Volume represents a named volume in a container. -message Volume { - // Required. Volume's name. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - oneof volume_type { - // Secret represents a secret that should populate this volume. - SecretVolumeSource secret = 2; - - // For Cloud SQL volumes, contains the specific instances that should be - // mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for - // more information on how to connect Cloud SQL and Cloud Run. - CloudSqlInstance cloud_sql_instance = 3; - - // Ephemeral storage used as a shared volume. - EmptyDirVolumeSource empty_dir = 4; - - // For NFS Voumes, contains the path to the nfs Volume - NFSVolumeSource nfs = 5; - - // Persistent storage backed by a Google Cloud Storage bucket. - GCSVolumeSource gcs = 6; - } -} - -// The secret's value will be presented as the content of a file whose -// name is defined in the item path. If no items are defined, the name of -// the file is the secret. -message SecretVolumeSource { - // Required. The name of the secret in Cloud Secret Manager. - // Format: {secret} if the secret is in the same project. - // projects/{project}/secrets/{secret} if the secret is - // in a different project. - string secret = 1 [(google.api.field_behavior) = REQUIRED]; - - // If unspecified, the volume will expose a file whose name is the - // secret, relative to VolumeMount.mount_path + VolumeMount.sub_path. - // If specified, the key will be used as the version to fetch from Cloud - // Secret Manager and the path will be the name of the file exposed in the - // volume. When items are defined, they must specify a path and a version. - repeated VersionToPath items = 2; - - // Integer representation of mode bits to use on created files by default. - // Must be a value between 0000 and 0777 (octal), defaulting to 0444. - // Directories within the path are not affected by this setting. - // - // Notes - // - // * Internally, a umask of 0222 will be applied to any non-zero value. - // * This is an integer representation of the mode bits. So, the octal - // integer value should look exactly as the chmod numeric notation with a - // leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - // or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - // 493 (base-10). - // * This might be in conflict with other options that affect the - // file mode, like fsGroup, and the result can be other mode bits set. - // - // This might be in conflict with other options that affect the - // file mode, like fsGroup, and as a result, other mode bits could be set. - int32 default_mode = 3; -} - -// VersionToPath maps a specific version of a secret to a relative file to mount -// to, relative to VolumeMount's mount_path. -message VersionToPath { - // Required. The relative path of the secret in the container. - string path = 1 [(google.api.field_behavior) = REQUIRED]; - - // The Cloud Secret Manager secret version. - // Can be 'latest' for the latest value, or an integer or a secret alias for a - // specific version. - string version = 2; - - // Integer octal mode bits to use on this file, must be a value between - // 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be - // used. - // - // Notes - // - // * Internally, a umask of 0222 will be applied to any non-zero value. - // * This is an integer representation of the mode bits. So, the octal - // integer value should look exactly as the chmod numeric notation with a - // leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - // or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - // 493 (base-10). - // * This might be in conflict with other options that affect the - // file mode, like fsGroup, and the result can be other mode bits set. - int32 mode = 3; -} - -// Represents a set of Cloud SQL instances. Each one will be available under -// /cloudsql/[instance]. Visit -// https://cloud.google.com/sql/docs/mysql/connect-run for more information on -// how to connect Cloud SQL and Cloud Run. -message CloudSqlInstance { - // The Cloud SQL instance connection names, as can be found in - // https://console.cloud.google.com/sql/instances. Visit - // https://cloud.google.com/sql/docs/mysql/connect-run for more information on - // how to connect Cloud SQL and Cloud Run. Format: - // {project}:{location}:{instance} - repeated string instances = 1; -} - -// In memory (tmpfs) ephemeral storage. -// It is ephemeral in the sense that when the sandbox is taken down, the data is -// destroyed with it (it does not persist across sandbox runs). -message EmptyDirVolumeSource { - // The different types of medium supported for EmptyDir. - enum Medium { - // When not specified, falls back to the default implementation which - // is currently in memory (this may change over time). - MEDIUM_UNSPECIFIED = 0; - - // Explicitly set the EmptyDir to be in memory. Uses tmpfs. - MEMORY = 1; - } - - // The medium on which the data is stored. Acceptable values today is only - // MEMORY or none. When none, the default will currently be backed by memory - // but could change over time. +optional - Medium medium = 1; - - // Limit on the storage usable by this EmptyDir volume. - // The size limit is also applicable for memory medium. - // The maximum usage on memory medium EmptyDir would be the minimum value - // between the SizeLimit specified here and the sum of memory limits of all - // containers. The default is nil which means that the limit is undefined. - // More info: - // https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. - // Info in Kubernetes: - // https://kubernetes.io/docs/concepts/storage/volumes/#emptydir - string size_limit = 2; -} - -// Represents an NFS mount. -message NFSVolumeSource { - // Hostname or IP address of the NFS server - string server = 1; - - // Path that is exported by the NFS server. - string path = 2; - - // If true, the volume will be mounted as read only for all mounts. - bool read_only = 3; -} - -// Represents a volume backed by a Cloud Storage bucket using Cloud Storage -// FUSE. -message GCSVolumeSource { - // Cloud Storage Bucket name. - string bucket = 1; - - // If true, the volume will be mounted as read only for all mounts. - bool read_only = 2; - - // A list of additional flags to pass to the gcsfuse CLI. - // Options should be specified without the leading "--". - repeated string mount_options = 3; -} - -// Probe describes a health check to be performed against a container to -// determine whether it is alive or ready to receive traffic. -message Probe { - // Optional. Number of seconds after the container has started before the - // probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum - // value for liveness probe is 3600. Maximum value for startup probe is 240. - int32 initial_delay_seconds = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Number of seconds after which the probe times out. - // Defaults to 1 second. Minimum value is 1. Maximum value is 3600. - // Must be smaller than period_seconds. - int32 timeout_seconds = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. How often (in seconds) to perform the probe. - // Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe - // is 3600. Maximum value for startup probe is 240. - // Must be greater or equal than timeout_seconds. - int32 period_seconds = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Minimum consecutive failures for the probe to be considered - // failed after having succeeded. Defaults to 3. Minimum value is 1. - int32 failure_threshold = 4 [(google.api.field_behavior) = OPTIONAL]; - - oneof probe_type { - // Optional. HTTPGet specifies the http request to perform. - // Exactly one of httpGet, tcpSocket, or grpc must be specified. - HTTPGetAction http_get = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. TCPSocket specifies an action involving a TCP port. - // Exactly one of httpGet, tcpSocket, or grpc must be specified. - TCPSocketAction tcp_socket = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. GRPC specifies an action involving a gRPC port. - // Exactly one of httpGet, tcpSocket, or grpc must be specified. - GRPCAction grpc = 7 [(google.api.field_behavior) = OPTIONAL]; - } -} - -// HTTPGetAction describes an action based on HTTP Get requests. -message HTTPGetAction { - // Optional. Path to access on the HTTP server. Defaults to '/'. - string path = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Custom headers to set in the request. HTTP allows repeated - // headers. - repeated HTTPHeader http_headers = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Port number to access on the container. Must be in the range 1 to - // 65535. If not specified, defaults to the exposed port of the container, - // which is the value of container.ports[0].containerPort. - int32 port = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// HTTPHeader describes a custom header to be used in HTTP probes -message HTTPHeader { - // Required. The header field name - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The header field value - string value = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// TCPSocketAction describes an action based on opening a socket -message TCPSocketAction { - // Optional. Port number to access on the container. Must be in the range 1 to - // 65535. If not specified, defaults to the exposed port of the container, - // which is the value of container.ports[0].containerPort. - int32 port = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// GRPCAction describes an action involving a GRPC port. -message GRPCAction { - // Optional. Port number of the gRPC service. Number must be in the range 1 to - // 65535. If not specified, defaults to the exposed port of the container, - // which is the value of container.ports[0].containerPort. - int32 port = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Service is the name of the service to place in the gRPC - // HealthCheckRequest (see - // https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this - // is not specified, the default behavior is defined by gRPC. - string service = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Build information of the image. -message BuildInfo { - // Output only. Entry point of the function when the image is a Cloud Run - // function. - string function_target = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Source code location of the image. - string source_location = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Source type for the container. -message SourceCode { - // Cloud Storage source. - message CloudStorageSource { - // Required. The Cloud Storage bucket name. - string bucket = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Cloud Storage object name. - string object = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The Cloud Storage object generation. - int64 generation = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // The source type. - oneof source_type { - // The source is a Cloud Storage bucket. - CloudStorageSource cloud_storage_source = 1; - } -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto deleted file mode 100644 index 8b75df33929..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/api/routing.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/status.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "RevisionProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run Revision Control Plane API. -service Revisions { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Gets information about a Revision. - rpc GetRevision(GetRevisionRequest) returns (Revision) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/services/*/revisions/*}" - additional_bindings { - get: "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists Revisions from a given Service, or from a given location. Results - // are sorted by creation time, descending. - rpc ListRevisions(ListRevisionsRequest) returns (ListRevisionsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*/services/*}/revisions" - additional_bindings { - get: "/v2/{parent=projects/*/locations/*/workerPools/*}/revisions" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a Revision. - rpc DeleteRevision(DeleteRevisionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/services/*/revisions/*}" - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Revision" - metadata_type: "Revision" - }; - } -} - -// Request message for obtaining a Revision by its full name. -message GetRevisionRequest { - // Required. The full name of the Revision. - // Format: - // projects/{project}/locations/{location}/services/{service}/revisions/{revision} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; -} - -// Request message for retrieving a list of Revisions. -message ListRevisionsRequest { - // Required. The Service from which the Revisions should be listed. - // To list all Revisions across Services, use "-" instead of Service name. - // Format: - // projects/{project}/locations/{location}/services/{service} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/Revision" - } - ]; - - // Maximum number of revisions to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListRevisions. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of Revisions. -message ListRevisionsResponse { - // The resulting list of Revisions. - repeated Revision revisions = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListRevisions request to continue. - string next_page_token = 2; -} - -// Request message for deleting a retired Revision. -// Revision lifecycle is usually managed by making changes to the parent -// Service. Only retired revisions can be deleted with this API. -message DeleteRevisionRequest { - // Required. The name of the Revision to delete. - // Format: - // projects/{project}/locations/{location}/services/{service}/revisions/{revision} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 2; - - // A system-generated fingerprint for this version of the - // resource. This may be used to detect modification conflict during updates. - string etag = 3; -} - -// A Revision is an immutable snapshot of code and configuration. A Revision -// references a container image. Revisions are only created by updates to its -// parent Service. -message Revision { - option (google.api.resource) = { - type: "run.googleapis.com/Revision" - pattern: "projects/{project}/locations/{location}/services/{service}/revisions/{revision}" - style: DECLARATIVE_FRIENDLY - }; - - // Output only. The unique name of this Revision. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server assigned unique identifier for the Revision. The value - // is a UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that may - // be set by external tools to store and arbitrary metadata. - // They are not queryable and should be preserved - // when modifying objects. - map annotations = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the deletion time. It is only - // populated as a response to a Delete request. - google.protobuf.Timestamp delete_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permamently deleted. It is only populated as a response to a Delete - // request. - google.protobuf.Timestamp expire_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The least stable launch stage needed to create this resource, as defined by - // [Google Cloud Platform Launch - // Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - // `ALPHA`, `BETA`, and `GA`. - // - // Note that this value might not be what was used - // as input. For example, if ALPHA was provided as input in the parent - // resource, but only BETA and GA-level features are were, this field will be - // BETA. - google.api.LaunchStage launch_stage = 10; - - // Output only. The name of the parent service. - string service = 11 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Service" } - ]; - - // Scaling settings for this revision. - RevisionScaling scaling = 12; - - // VPC Access configuration for this Revision. For more information, visit - // https://cloud.google.com/run/docs/configuring/connecting-vpc. - VpcAccess vpc_access = 13; - - // Sets the maximum number of requests that each serving instance can receive. - int32 max_instance_request_concurrency = 34; - - // Max allowed time for an instance to respond to a request. - google.protobuf.Duration timeout = 15; - - // Email address of the IAM service account associated with the revision of - // the service. The service account represents the identity of the running - // revision, and determines what permissions the revision has. - string service_account = 16; - - // Holds the single container that defines the unit of execution for this - // Revision. - repeated Container containers = 17; - - // A list of Volumes to make available to containers. - repeated Volume volumes = 18; - - // The execution environment being used to host this Revision. - ExecutionEnvironment execution_environment = 20; - - // A reference to a customer managed encryption key (CMEK) to use to encrypt - // this container image. For more information, go to - // https://cloud.google.com/run/docs/securing/using-cmek - string encryption_key = 21 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Enables service mesh connectivity. - ServiceMesh service_mesh = 22; - - // The action to take if the encryption key is revoked. - EncryptionKeyRevocationAction encryption_key_revocation_action = 23; - - // If encryption_key_revocation_action is SHUTDOWN, the duration before - // shutting down all instances. The minimum increment is 1 hour. - google.protobuf.Duration encryption_key_shutdown_duration = 24; - - // Output only. Indicates whether the resource's reconciliation is still in - // progress. See comments in `Service.reconciling` for additional information - // on reconciliation process in Cloud Run. - bool reconciling = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this Revision, containing its readiness - // status, and detailed error information in case it did not reach a serving - // state. - repeated Condition conditions = 31 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The generation of this Revision currently serving traffic. See - // comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. - int64 observed_generation = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Google Console URI to obtain logs for the Revision. - string log_uri = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 37 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Enable session affinity. - bool session_affinity = 38; - - // Output only. The current effective scaling settings for the revision. - RevisionScalingStatus scaling_status = 39 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The node selector for the revision. - NodeSelector node_selector = 40; - - // Optional. Output only. True if GPU zonal redundancy is disabled on this - // revision. - optional bool gpu_zonal_redundancy_disabled = 48 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. Email address of the authenticated creator. - string creator = 49 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto deleted file mode 100644 index b29c95c4892..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "RevisionTemplateProto"; -option java_package = "com.google.cloud.run.v2"; - -// RevisionTemplate describes the data a revision should have when created from -// a template. -message RevisionTemplate { - // Optional. The unique name for the revision. If this field is omitted, it - // will be automatically generated based on the Service name. - string revision = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Optional. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - //

Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 RevisionTemplate. - map labels = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Unstructured key value map that may be set by external tools to - // store and arbitrary metadata. They are not queryable and should be - // preserved when modifying objects. - // - //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system annotations in v1 now - // have a corresponding field in v2 RevisionTemplate. - // - //

This field follows Kubernetes annotations' namespacing, limits, and - // rules. - map annotations = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Scaling settings for this Revision. - RevisionScaling scaling = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. VPC Access configuration to use for this Revision. For more - // information, visit - // https://cloud.google.com/run/docs/configuring/connecting-vpc. - VpcAccess vpc_access = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Max allowed time for an instance to respond to a request. - google.protobuf.Duration timeout = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Email address of the IAM service account associated with the - // revision of the service. The service account represents the identity of the - // running revision, and determines what permissions the revision has. If not - // provided, the revision will use the project's default service account. - string service_account = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Holds the single container that defines the unit of execution for this - // Revision. - repeated Container containers = 10; - - // Optional. A list of Volumes to make available to containers. - repeated Volume volumes = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The sandbox environment to host this Revision. - ExecutionEnvironment execution_environment = 13 - [(google.api.field_behavior) = OPTIONAL]; - - // A reference to a customer managed encryption key (CMEK) to use to encrypt - // this container image. For more information, go to - // https://cloud.google.com/run/docs/securing/using-cmek - string encryption_key = 14 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Optional. Sets the maximum number of requests that each serving instance - // can receive. If not specified or 0, concurrency defaults to 80 when - // requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. - int32 max_instance_request_concurrency = 15 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enables service mesh connectivity. - ServiceMesh service_mesh = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The action to take if the encryption key is revoked. - EncryptionKeyRevocationAction encryption_key_revocation_action = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If encryption_key_revocation_action is SHUTDOWN, the duration - // before shutting down all instances. The minimum increment is 1 hour. - google.protobuf.Duration encryption_key_shutdown_duration = 18 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enable session affinity. - bool session_affinity = 19 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Disables health checking containers during deployment. - bool health_check_disabled = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The node selector for the revision template. - NodeSelector node_selector = 21 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. True if GPU zonal redundancy is disabled on this revision. - optional bool gpu_zonal_redundancy_disabled = 24 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto deleted file mode 100644 index 506638a1a07..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto +++ /dev/null @@ -1,520 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/api/routing.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/revision_template.proto"; -import "google/cloud/run/v2/traffic_target.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "ServiceProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run Service Control Plane API -service Services { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a new Service in a given project and location. - rpc CreateService(CreateServiceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/locations/*}/services" - body: "service" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent,service,service_id"; - option (google.longrunning.operation_info) = { - response_type: "Service" - metadata_type: "Service" - }; - } - - // Gets information about a Service. - rpc GetService(GetServiceRequest) returns (Service) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/services/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists Services. Results are sorted by creation time, descending. - rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*}/services" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a Service. - rpc UpdateService(UpdateServiceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v2/{service.name=projects/*/locations/*/services/*}" - body: "service" - }; - option (google.api.routing) = { - routing_parameters { - field: "service.name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "service"; - option (google.api.method_signature) = "service,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Service" - metadata_type: "Service" - }; - } - - // Deletes a Service. - // This will cause the Service to stop serving traffic and will delete all - // revisions. - rpc DeleteService(DeleteServiceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/services/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Service" - metadata_type: "Service" - }; - } - - // Gets the IAM Access Control policy currently in effect for the given - // Cloud Run Service. This result does not include any inherited policies. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - get: "/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy" - }; - } - - // Sets the IAM Access control policy for the specified Service. Overwrites - // any existing policy. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy" - body: "*" - }; - } - - // Returns permissions that a caller has on the specified Project. - // - // There are no permissions required for making this API call. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions" - body: "*" - }; - } -} - -// Request message for creating a Service. -message CreateServiceRequest { - // Required. The location and project in which this service should be created. - // Format: projects/{project}/locations/{location}, where {project} can be - // project id or number. Only lowercase characters, digits, and hyphens. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/Service" - } - ]; - - // Required. The Service instance to create. - Service service = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The unique identifier for the Service. It must begin with letter, - // and cannot end with hyphen; must contain fewer than 50 characters. - // The name of the service becomes {parent}/services/{service_id}. - string service_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Indicates that the request should be validated and default values - // populated, without persisting the request or creating any resources. - bool validate_only = 4; -} - -// Request message for updating a service. -message UpdateServiceRequest { - // Optional. The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The Service to be updated. - Service service = 1 [(google.api.field_behavior) = REQUIRED]; - - // Indicates that the request should be validated and default values - // populated, without persisting the request or updating any resources. - bool validate_only = 3; - - // Optional. If set to true, and if the Service does not exist, it will create - // a new one. The caller must have 'run.services.create' permissions if this - // is set to true and the Service does not exist. - bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for retrieving a list of Services. -message ListServicesRequest { - // Required. The location and project to list resources on. - // Location must be a valid Google Cloud region, and cannot be the "-" - // wildcard. Format: projects/{project}/locations/{location}, where {project} - // can be project id or number. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/Service" - } - ]; - - // Maximum number of Services to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListServices. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of Services. -message ListServicesResponse { - // The resulting list of Services. - repeated Service services = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListServices request to continue. - string next_page_token = 2; - - // Output only. For global requests, returns the list of regions that could - // not be reached within the deadline. - repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for obtaining a Service by its full name. -message GetServiceRequest { - // Required. The full name of the Service. - // Format: projects/{project}/locations/{location}/services/{service}, where - // {project} can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Service" } - ]; -} - -// Request message to delete a Service by its full name. -message DeleteServiceRequest { - // Required. The full name of the Service. - // Format: projects/{project}/locations/{location}/services/{service}, where - // {project} can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Service" } - ]; - - // Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 2; - - // A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 3; -} - -// Service acts as a top-level container that manages a set of -// configurations and revision templates which implement a network service. -// Service exists to provide a singular abstraction which can be access -// controlled, reasoned about, and which encapsulates software lifecycle -// decisions such as rollout policy and team resource ownership. -message Service { - option (google.api.resource) = { - type: "run.googleapis.com/Service" - pattern: "projects/{project}/locations/{location}/services/{service}" - style: DECLARATIVE_FRIENDLY - }; - - // Settings for multi-region deployment. - message MultiRegionSettings { - // Required. List of regions to deploy to, including primary region. - repeated string regions = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. System-generated unique id for the multi-region Service. - string multi_region_id = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Identifier. The fully qualified name of this Service. In - // CreateServiceRequest, this field is ignored, and instead composed from - // CreateServiceRequest.parent and CreateServiceRequest.service_id. - // - // Format: - // projects/{project}/locations/{location}/services/{service_id} - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // User-provided description of the Service. This field currently has a - // 512-character limit. - string description = 2; - - // Output only. Server assigned unique identifier for the trigger. The value - // is a UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - // Please note that unlike v1, this is an int64 value. As with most Google - // APIs, its JSON representation will be a `string` instead of an `integer`. - int64 generation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - //

Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 Service. - map labels = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Unstructured key value map that may be set by external tools to - // store and arbitrary metadata. They are not queryable and should be - // preserved when modifying objects. - // - //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected in new resources. All system - // annotations in v1 now have a corresponding field in v2 Service. - // - //

This field follows Kubernetes - // annotations' namespacing, limits, and rules. - map annotations = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The deletion time. It is only populated as a response to a - // Delete request. - google.protobuf.Timestamp delete_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permanently deleted. - google.protobuf.Timestamp expire_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the authenticated creator. - string creator = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the last authenticated modifier. - string last_modifier = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Arbitrary identifier for the API client. - string client = 13; - - // Arbitrary version identifier for the API client. - string client_version = 14; - - // Optional. Provides the ingress settings for this Service. On output, - // returns the currently observed ingress settings, or - // INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. - IngressTraffic ingress = 15 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The launch stage as defined by [Google Cloud Platform - // Launch Stages](https://cloud.google.com/terms/launch-stages). - // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - // is assumed. - // Set the launch stage to a preview stage on input to allow use of preview - // features in that stage. On read (or output), describes whether the resource - // uses preview features. - // - // For example, if ALPHA is provided as input, but only BETA and GA-level - // features are used, this field will be BETA on output. - google.api.LaunchStage launch_stage = 16 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings for the Binary Authorization feature. - BinaryAuthorization binary_authorization = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The template used to create revisions for this Service. - RevisionTemplate template = 18 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifies how to distribute traffic over a collection of - // Revisions belonging to the Service. If traffic is empty or not provided, - // defaults to 100% traffic to the latest `Ready` Revision. - repeated TrafficTarget traffic = 19 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies service-level scaling settings - ServiceScaling scaling = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Disables IAM permission check for run.routes.invoke for callers - // of this service. For more information, visit - // https://cloud.google.com/run/docs/securing/managing-access#invoker_check. - bool invoker_iam_disabled = 21 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Disables public resolution of the default URI of this service. - bool default_uri_disabled = 22 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. All URLs serving traffic for this Service. - repeated string urls = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. IAP settings on the Service. - bool iap_enabled = 25 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings for multi-region deployment. - MultiRegionSettings multi_region_settings = 26 - [(google.api.field_behavior) = OPTIONAL]; - - // One or more custom audiences that you want this service to support. Specify - // each custom audience as the full URL in a string. The custom audiences are - // encoded in the token and used to authenticate requests. For more - // information, see - // https://cloud.google.com/run/docs/configuring/custom-audiences. - repeated string custom_audiences = 37; - - // Output only. The generation of this Service currently serving traffic. See - // comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. Please note that unlike v1, this is an int64 value. - // As with most Google APIs, its JSON representation will be a `string` - // instead of an `integer`. - int64 observed_generation = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this Service, containing its readiness - // status, and detailed error information in case it did not reach a serving - // state. See comments in `reconciling` for additional information on - // reconciliation process in Cloud Run. - Condition terminal_condition = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Conditions of all other associated sub-resources. They - // contain additional diagnostics information in case the Service does not - // reach its Serving state. See comments in `reconciling` for additional - // information on reconciliation process in Cloud Run. - repeated Condition conditions = 32 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the latest revision that is serving traffic. See - // comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. - string latest_ready_revision = 33 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Output only. Name of the last created revision. See comments in - // `reconciling` for additional information on reconciliation process in Cloud - // Run. - string latest_created_revision = 34 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Output only. Detailed status information for corresponding traffic targets. - // See comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. - repeated TrafficTargetStatus traffic_statuses = 35 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The main URI in which this Service is serving traffic. - string uri = 36 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. True if Cloud Run Threat Detection monitoring is enabled for - // the parent project of this Service. - bool threat_detection_enabled = 40 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Configuration for building a Cloud Run function. - BuildConfig build_config = 41 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Returns true if the Service is currently being acted upon by - // the system to bring it into the desired state. - // - // When a new Service is created, or an existing one is updated, Cloud Run - // will asynchronously perform all necessary steps to bring the Service to the - // desired serving state. This process is called reconciliation. - // While reconciliation is in process, `observed_generation`, - // `latest_ready_revision`, `traffic_statuses`, and `uri` will have transient - // values that might mismatch the intended state: Once reconciliation is over - // (and this field is false), there are two possible outcomes: reconciliation - // succeeded and the serving state matches the Service, or there was an error, - // and reconciliation failed. This state can be found in - // `terminal_condition.state`. - // - // If reconciliation succeeded, the following fields will match: `traffic` and - // `traffic_statuses`, `observed_generation` and `generation`, - // `latest_ready_revision` and `latest_created_revision`. - // - // If reconciliation failed, `traffic_statuses`, `observed_generation`, and - // `latest_ready_revision` will have the state of the last serving revision, - // or empty for newly created Services. Additional information on the failure - // can be found in `terminal_condition` and `conditions`. - bool reconciling = 98 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto deleted file mode 100644 index 68e98cfd839..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "StatusProto"; -option java_package = "com.google.cloud.run.v2"; - -// Effective settings for the current revision -message RevisionScalingStatus { - // The current number of min instances provisioned for this revision. - int32 desired_min_instance_count = 1; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto deleted file mode 100644 index a4bb905576e..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "TaskProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run Task Control Plane API. -service Tasks { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Gets information about a Task. - rpc GetTask(GetTaskRequest) returns (Task) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Tasks from an Execution of a Job. - rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for obtaining a Task by its full name. -message GetTaskRequest { - // Required. The full name of the Task. - // Format: - // projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Task" } - ]; -} - -// Request message for retrieving a list of Tasks. -message ListTasksRequest { - // Required. The Execution from which the Tasks should be listed. - // To list all Tasks across Executions of a Job, use "-" instead of Execution - // name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - // projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "run.googleapis.com/Task" } - ]; - - // Maximum number of Tasks to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListTasks. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of Tasks. -message ListTasksResponse { - // The resulting list of Tasks. - repeated Task tasks = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListTasks request to continue. - string next_page_token = 2; -} - -// Task represents a single run of a container to completion. -message Task { - option (google.api.resource) = { - type: "run.googleapis.com/Task" - pattern: "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}" - style: DECLARATIVE_FRIENDLY - }; - - // Output only. The unique name of this Task. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server assigned unique identifier for the Task. The value is a - // UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels - map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that may - // be set by external tools to store and arbitrary metadata. - // They are not queryable and should be preserved - // when modifying objects. - map annotations = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the task was created by the system. - // It is not guaranteed to be set in happens-before order across separate - // operations. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the task was scheduled to run by the - // system. It is not guaranteed to be set in happens-before order across - // separate operations. - google.protobuf.Timestamp scheduled_time = 34 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the task started to run. - // It is not guaranteed to be set in happens-before order across separate - // operations. - google.protobuf.Timestamp start_time = 27 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the Task was completed. It is not - // guaranteed to be set in happens-before order across separate operations. - google.protobuf.Timestamp completion_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the deletion time. It is only - // populated as a response to a Delete request. - google.protobuf.Timestamp delete_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permamently deleted. It is only populated as a response to a Delete - // request. - google.protobuf.Timestamp expire_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The name of the parent Job. - string job = 12 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Job" } - ]; - - // Output only. The name of the parent Execution. - string execution = 13 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } - ]; - - // Holds the single container that defines the unit of execution for this - // task. - repeated Container containers = 14; - - // A list of Volumes to make available to containers. - repeated Volume volumes = 15; - - // Number of retries allowed per Task, before marking this Task failed. - int32 max_retries = 16; - - // Max allowed time duration the Task may be active before the system will - // actively try to mark it failed and kill associated containers. This applies - // per attempt of a task, meaning each retry can run for the full timeout. - google.protobuf.Duration timeout = 17; - - // Email address of the IAM service account associated with the Task of a - // Job. The service account represents the identity of the - // running task, and determines what permissions the task has. If - // not provided, the task will use the project's default service account. - string service_account = 18; - - // The execution environment being used to host this Task. - ExecutionEnvironment execution_environment = 20; - - // Output only. Indicates whether the resource's reconciliation is still in - // progress. See comments in `Job.reconciling` for additional information on - // reconciliation process in Cloud Run. - bool reconciling = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this Task, containing its readiness status, - // and detailed error information in case it did not reach the desired state. - repeated Condition conditions = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The generation of this Task. See comments in `Job.reconciling` - // for additional information on reconciliation process in Cloud Run. - int64 observed_generation = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Index of the Task, unique per execution, and beginning at 0. - int32 index = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of times this Task was retried. - // Tasks are retried when they fail up to the maxRetries limit. - int32 retried = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Result of the last attempt of this Task. - TaskAttemptResult last_attempt_result = 26 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A reference to a customer managed encryption key (CMEK) to use - // to encrypt this container image. For more information, go to - // https://cloud.google.com/run/docs/securing/using-cmek - string encryption_key = 28 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; - - // Output only. VPC Access configuration to use for this Task. For more - // information, visit - // https://cloud.google.com/run/docs/configuring/connecting-vpc. - VpcAccess vpc_access = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. URI where logs for this execution can be found in Cloud - // Console. - string log_uri = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The node selector for the task. - NodeSelector node_selector = 36 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Output only. True if GPU zonal redundancy is disabled on this - // task. - optional bool gpu_zonal_redundancy_disabled = 37 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Result of a task attempt. -message TaskAttemptResult { - // Output only. The status of this attempt. - // If the status code is OK, then the attempt succeeded. - google.rpc.Status status = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The exit code of this attempt. - // This may be unset if the container was unable to exit cleanly with a code - // due to some other failure. - // See status field for possible failure details. - // - // At most one of exit_code or term_signal will be set. - int32 exit_code = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Termination signal of the container. This is set to non-zero - // if the container is terminated by the system. - // - // At most one of exit_code or term_signal will be set. - int32 term_signal = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto deleted file mode 100644 index fddfe2d394d..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "TaskTemplateProto"; -option java_package = "com.google.cloud.run.v2"; - -// TaskTemplate describes the data a task should have when created -// from a template. -message TaskTemplate { - // Holds the single container that defines the unit of execution for this - // task. - repeated Container containers = 1; - - // Optional. A list of Volumes to make available to containers. - repeated Volume volumes = 2 [(google.api.field_behavior) = OPTIONAL]; - - oneof retries { - // Number of retries allowed per Task, before marking this Task failed. - // Defaults to 3. - int32 max_retries = 3; - } - - // Optional. Max allowed time duration the Task may be active before the - // system will actively try to mark it failed and kill associated containers. - // This applies per attempt of a task, meaning each retry can run for the full - // timeout. Defaults to 600 seconds. - google.protobuf.Duration timeout = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Email address of the IAM service account associated with the Task - // of a Job. The service account represents the identity of the running task, - // and determines what permissions the task has. If not provided, the task - // will use the project's default service account. - string service_account = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The execution environment being used to host this Task. - ExecutionEnvironment execution_environment = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // A reference to a customer managed encryption key (CMEK) to use to encrypt - // this container image. For more information, go to - // https://cloud.google.com/run/docs/securing/using-cmek - string encryption_key = 7 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Optional. VPC Access configuration to use for this Task. For more - // information, visit - // https://cloud.google.com/run/docs/configuring/connecting-vpc. - VpcAccess vpc_access = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The node selector for the task template. - NodeSelector node_selector = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. True if GPU zonal redundancy is disabled on this task template. - optional bool gpu_zonal_redundancy_disabled = 12 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto deleted file mode 100644 index 7dfec861029..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "TrafficTargetProto"; -option java_package = "com.google.cloud.run.v2"; - -// Holds a single traffic routing entry for the Service. Allocations can be done -// to a specific Revision name, or pointing to the latest Ready Revision. -message TrafficTarget { - // The allocation type for this traffic target. - TrafficTargetAllocationType type = 1; - - // Revision to which to send this portion of traffic, if traffic allocation is - // by revision. - string revision = 2 [ - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Specifies percent of the traffic to this Revision. - // This defaults to zero if unspecified. - int32 percent = 3; - - // Indicates a string to be part of the URI to exclusively reference this - // target. - string tag = 4; -} - -// Represents the observed state of a single `TrafficTarget` entry. -message TrafficTargetStatus { - // The allocation type for this traffic target. - TrafficTargetAllocationType type = 1; - - // Revision to which this traffic is sent. - string revision = 2 [ - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Specifies percent of the traffic to this Revision. - int32 percent = 3; - - // Indicates the string used in the URI to exclusively reference this target. - string tag = 4; - - // Displays the target URI. - string uri = 5; -} - -// The type of instance allocation. -enum TrafficTargetAllocationType { - // Unspecified instance allocation type. - TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0; - - // Allocates instances to the Service's latest ready Revision. - TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1; - - // Allocates instances to a Revision by name. - TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto deleted file mode 100644 index 67074b4c875..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "VendorSettingsProto"; -option java_package = "com.google.cloud.run.v2"; -option (google.api.resource_definition) = { - type: "binaryauthorization.googleapis.com/Policy" - pattern: "projects/{project}/policy" - pattern: "locations/{location}/policy" -}; -option (google.api.resource_definition) = { - type: "networkservices.googleapis.com/Mesh" - pattern: "projects/{project}/locations/{location}/meshes/{mesh}" -}; -option (google.api.resource_definition) = { - type: "cloudbuild.googleapis.com/Build" - pattern: "projects/{project}/locations/{location}/builds/{build}" -}; - -// VPC Access settings. For more information on sending traffic to a VPC -// network, visit https://cloud.google.com/run/docs/configuring/connecting-vpc. -message VpcAccess { - // Egress options for VPC access. - enum VpcEgress { - // Unspecified - VPC_EGRESS_UNSPECIFIED = 0; - - // All outbound traffic is routed through the VPC connector. - ALL_TRAFFIC = 1; - - // Only private IP ranges are routed through the VPC connector. - PRIVATE_RANGES_ONLY = 2; - } - - // Direct VPC egress settings. - message NetworkInterface { - // Optional. The VPC network that the Cloud Run resource will be able to - // send traffic to. At least one of network or subnetwork must be specified. - // If both network and subnetwork are specified, the given VPC subnetwork - // must belong to the given VPC network. If network is not specified, it - // will be looked up from the subnetwork. - string network = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The VPC subnetwork that the Cloud Run resource will get IPs - // from. At least one of network or subnetwork must be specified. If both - // network and subnetwork are specified, the given VPC subnetwork must - // belong to the given VPC network. If subnetwork is not specified, the - // subnetwork with the same name with the network will be used. - string subnetwork = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Network tags applied to this Cloud Run resource. - repeated string tags = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // VPC Access connector name. - // Format: `projects/{project}/locations/{location}/connectors/{connector}`, - // where `{project}` can be project id or number. - // For more information on sending traffic to a VPC network via a connector, - // visit https://cloud.google.com/run/docs/configuring/vpc-connectors. - string connector = 1 [(google.api.resource_reference) = { - type: "vpcaccess.googleapis.com/Connector" - }]; - - // Optional. Traffic VPC egress settings. If not provided, it defaults to - // PRIVATE_RANGES_ONLY. - VpcEgress egress = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Direct VPC egress settings. Currently only single network - // interface is supported. - repeated NetworkInterface network_interfaces = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings for Binary Authorization feature. -message BinaryAuthorization { - oneof binauthz_method { - // Optional. If True, indicates to use the default project's binary - // authorization policy. If False, binary authorization will be disabled. - bool use_default = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The path to a binary authorization policy. - // Format: `projects/{project}/platforms/cloudRun/{policy-name}` - string policy = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "binaryauthorization.googleapis.com/Policy" - } - ]; - } - - // Optional. If present, indicates to use Breakglass using this justification. - // If use_default is False, then it must be empty. - // For more information on breakglass, see - // https://cloud.google.com/binary-authorization/docs/using-breakglass - string breakglass_justification = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings for revision-level scaling settings. -message RevisionScaling { - // Optional. Minimum number of serving instances that this resource should - // have. - int32 min_instance_count = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum number of serving instances that this resource should - // have. When unspecified, the field is set to the server default value of - // 100. For more information see - // https://cloud.google.com/run/docs/configuring/max-instances - int32 max_instance_count = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings for Cloud Service Mesh. For more information see -// https://cloud.google.com/service-mesh/docs/overview. -message ServiceMesh { - // The Mesh resource name. Format: - // `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can - // be project id or number. - string mesh = 1 [(google.api.resource_reference) = { - type: "networkservices.googleapis.com/Mesh" - }]; -} - -// Scaling settings applied at the service level rather than -// at the revision level. -message ServiceScaling { - // The scaling mode for the service. If not provided, it defaults to - // AUTOMATIC. - enum ScalingMode { - // Unspecified. - SCALING_MODE_UNSPECIFIED = 0; - - // Scale based on traffic between min and max instances. - AUTOMATIC = 1; - - // Scale to exactly min instances and ignore max instances. - MANUAL = 2; - } - - // Optional. total min instances for the service. This number of instances is - // divided among all revisions with specified traffic based on the percent - // of traffic they are receiving. - int32 min_instance_count = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The scaling mode for the service. - ScalingMode scaling_mode = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. total max instances for the service. This number of instances is - // divided among all revisions with specified traffic based on the percent - // of traffic they are receiving. - int32 max_instance_count = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. total instance count for the service in manual scaling mode. This - // number of instances is divided among all revisions with specified traffic - // based on the percent of traffic they are receiving. - optional int32 manual_instance_count = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Worker pool scaling settings. -message WorkerPoolScaling { - // Optional. The total number of instances in manual scaling mode. - optional int32 manual_instance_count = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Hardware constraints configuration. -message NodeSelector { - // Required. GPU accelerator type to attach to an instance. - string accelerator = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Describes the Build step of the function that builds a container from the -// given source. -message BuildConfig { - // Output only. The Cloud Build name of the latest successful deployment of - // the function. - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudbuild.googleapis.com/Build" - } - ]; - - // The Cloud Storage bucket URI where the function source code is located. - string source_location = 2; - - // Optional. The name of the function (as defined in source code) that will be - // executed. Defaults to the resource name suffix, if not specified. For - // backward compatibility, if function with given name is not found, then the - // system will try to use function named "function". - string function_target = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Artifact Registry URI to store the built image. - string image_uri = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The base image used to build the function. - string base_image = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Sets whether the function will receive automatic base image - // updates. - bool enable_automatic_updates = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Name of the Cloud Build Custom Worker Pool that should be used to - // build the Cloud Run function. The format of this field is - // `projects/{project}/locations/{region}/workerPools/{workerPool}` where - // `{project}` and `{region}` are the project id and region respectively where - // the worker pool is defined and `{workerPool}` is the short name of the - // worker pool. - string worker_pool = 7 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudbuild.googleapis.com/BuildWorkerPool" - } - ]; - - // Optional. User-provided build-time environment variables for the function - map environment_variables = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Service account to be used for building the container. The format - // of this field is - // `projects/{projectId}/serviceAccounts/{serviceAccountEmail}`. - string service_account = 9 [(google.api.field_behavior) = OPTIONAL]; -} - -// Allowed ingress traffic for the Container. -enum IngressTraffic { - // Unspecified - INGRESS_TRAFFIC_UNSPECIFIED = 0; - - // All inbound traffic is allowed. - INGRESS_TRAFFIC_ALL = 1; - - // Only internal traffic is allowed. - INGRESS_TRAFFIC_INTERNAL_ONLY = 2; - - // Both internal and Google Cloud Load Balancer traffic is allowed. - INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; - - // No ingress traffic is allowed. - INGRESS_TRAFFIC_NONE = 4; -} - -// Alternatives for execution environments. -enum ExecutionEnvironment { - // Unspecified - EXECUTION_ENVIRONMENT_UNSPECIFIED = 0; - - // Uses the First Generation environment. - EXECUTION_ENVIRONMENT_GEN1 = 1; - - // Uses Second Generation environment. - EXECUTION_ENVIRONMENT_GEN2 = 2; -} - -// Specifies behavior if an encryption key used by a resource is revoked. -enum EncryptionKeyRevocationAction { - // Unspecified - ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0; - - // Prevents the creation of new instances. - PREVENT_NEW = 1; - - // Shuts down existing instances, and prevents creation of new ones. - SHUTDOWN = 2; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto deleted file mode 100644 index 5a19ae2b1ef..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/api/routing.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/instance_split.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/cloud/run/v2/worker_pool_revision_template.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "WorkerPoolProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run WorkerPool Control Plane API. -service WorkerPools { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a new WorkerPool in a given project and location. - rpc CreateWorkerPool(CreateWorkerPoolRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/locations/*}/workerPools" - body: "worker_pool" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent,worker_pool,worker_pool_id"; - option (google.longrunning.operation_info) = { - response_type: "WorkerPool" - metadata_type: "WorkerPool" - }; - } - - // Gets information about a WorkerPool. - rpc GetWorkerPool(GetWorkerPoolRequest) returns (WorkerPool) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/workerPools/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists WorkerPools. Results are sorted by creation time, descending. - rpc ListWorkerPools(ListWorkerPoolsRequest) - returns (ListWorkerPoolsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*}/workerPools" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a WorkerPool. - rpc UpdateWorkerPool(UpdateWorkerPoolRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v2/{worker_pool.name=projects/*/locations/*/workerPools/*}" - body: "worker_pool" - }; - option (google.api.routing) = { - routing_parameters { - field: "worker_pool.name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "worker_pool"; - option (google.api.method_signature) = "worker_pool,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "WorkerPool" - metadata_type: "WorkerPool" - }; - } - - // Deletes a WorkerPool. - rpc DeleteWorkerPool(DeleteWorkerPoolRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/workerPools/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "WorkerPool" - metadata_type: "WorkerPool" - }; - } - - // Gets the IAM Access Control policy currently in effect for the given - // Cloud Run WorkerPool. This result does not include any inherited policies. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - get: "/v2/{resource=projects/*/locations/*/workerPools/*}:getIamPolicy" - }; - } - - // Sets the IAM Access control policy for the specified WorkerPool. Overwrites - // any existing policy. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/workerPools/*}:setIamPolicy" - body: "*" - }; - } - - // Returns permissions that a caller has on the specified Project. - // - // There are no permissions required for making this API call. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/workerPools/*}:testIamPermissions" - body: "*" - }; - } -} - -// Request message for creating a WorkerPool. -message CreateWorkerPoolRequest { - // Required. The location and project in which this worker pool should be - // created. Format: `projects/{project}/locations/{location}`, where - // `{project}` can be project id or number. Only lowercase characters, digits, - // and hyphens. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/WorkerPool" - } - ]; - - // Required. The WorkerPool instance to create. - WorkerPool worker_pool = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The unique identifier for the WorkerPool. It must begin with - // letter, and cannot end with hyphen; must contain fewer than 50 characters. - // The name of the worker pool becomes - // `{parent}/workerPools/{worker_pool_id}`. - string worker_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Indicates that the request should be validated and default values - // populated, without persisting the request or creating any resources. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for updating a worker pool. -message UpdateWorkerPoolRequest { - // Optional. The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The WorkerPool to be updated. - WorkerPool worker_pool = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Indicates that the request should be validated and default values - // populated, without persisting the request or updating any resources. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, and if the WorkerPool does not exist, it will - // create a new one. The caller must have 'run.workerpools.create' permissions - // if this is set to true and the WorkerPool does not exist. - bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, a new revision will be created from the template - // even if the system doesn't detect any changes from the previously deployed - // revision. - // - // This may be useful for cases where the underlying resources need to be - // recreated or reinitialized. For example if the image is specified by label, - // but the underlying image digest has changed) or if the container performs - // deployment initialization work that needs to be performed again. - bool force_new_revision = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for retrieving a list of WorkerPools. -message ListWorkerPoolsRequest { - // Required. The location and project to list resources on. - // Location must be a valid Google Cloud region, and cannot be the "-" - // wildcard. Format: `projects/{project}/locations/{location}`, where - // `{project}` can be project id or number. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/WorkerPool" - } - ]; - - // Maximum number of WorkerPools to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListWorkerPools. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of WorkerPools. -message ListWorkerPoolsResponse { - // The resulting list of WorkerPools. - repeated WorkerPool worker_pools = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListWorkerPools request to continue. - string next_page_token = 2; -} - -// Request message for obtaining a WorkerPool by its full name. -message GetWorkerPoolRequest { - // Required. The full name of the WorkerPool. - // Format: - // `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - // `{project}` can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/WorkerPool" } - ]; -} - -// Request message to delete a WorkerPool by its full name. -message DeleteWorkerPoolRequest { - // Required. The full name of the WorkerPool. - // Format: - // `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - // `{project}` can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/WorkerPool" } - ]; - - // Optional. Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; - - // A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 3; -} - -// WorkerPool acts as a top-level container that manages a set of -// configurations and revision templates which implement a pull-based workload. -// WorkerPool exists to provide a singular abstraction which can be access -// controlled, reasoned about, and which encapsulates software lifecycle -// decisions such as rollout policy and team resource ownership. -message WorkerPool { - option (google.api.resource) = { - type: "run.googleapis.com/WorkerPool" - pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" - plural: "workerPools" - singular: "workerPool" - style: DECLARATIVE_FRIENDLY - }; - - // The fully qualified name of this WorkerPool. In CreateWorkerPoolRequest, - // this field is ignored, and instead composed from - // CreateWorkerPoolRequest.parent and CreateWorkerPoolRequest.worker_id. - // - // Format: - // `projects/{project}/locations/{location}/workerPools/{worker_id}` - string name = 1; - - // User-provided description of the WorkerPool. This field currently has a - // 512-character limit. - string description = 2; - - // Output only. Server assigned unique identifier for the trigger. The value - // is a UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - // Please note that unlike v1, this is an int64 value. As with most Google - // APIs, its JSON representation will be a `string` instead of an `integer`. - int64 generation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - // Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 WorkerPool. - map labels = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Unstructured key value map that may be set by external tools to - // store and arbitrary metadata. They are not queryable and should be - // preserved when modifying objects. - // - // Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected in new resources. All system - // annotations in v1 now have a corresponding field in v2 WorkerPool. - // - //

This field follows Kubernetes - // annotations' namespacing, limits, and rules. - map annotations = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The deletion time. It is only populated as a response to a - // Delete request. - google.protobuf.Timestamp delete_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permamently deleted. - google.protobuf.Timestamp expire_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the authenticated creator. - string creator = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the last authenticated modifier. - string last_modifier = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Arbitrary identifier for the API client. - string client = 13; - - // Arbitrary version identifier for the API client. - string client_version = 14; - - // Optional. The launch stage as defined by [Google Cloud Platform - // Launch Stages](https://cloud.google.com/terms/launch-stages). - // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - // is assumed. - // Set the launch stage to a preview stage on input to allow use of preview - // features in that stage. On read (or output), describes whether the - // resource uses preview features. - // - // For example, if ALPHA is provided as input, but only BETA and GA-level - // features are used, this field will be BETA on output. - google.api.LaunchStage launch_stage = 16 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings for the Binary Authorization feature. - BinaryAuthorization binary_authorization = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The template used to create revisions for this WorkerPool. - WorkerPoolRevisionTemplate template = 18 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifies how to distribute instances over a collection of - // Revisions belonging to the WorkerPool. If instance split is empty or not - // provided, defaults to 100% instances assigned to the latest `Ready` - // Revision. - repeated InstanceSplit instance_splits = 26 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies worker-pool-level scaling settings - WorkerPoolScaling scaling = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The generation of this WorkerPool currently serving workloads. - // See comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. Please note that unlike v1, this is an int64 value. - // As with most Google APIs, its JSON representation will be a `string` - // instead of an `integer`. - int64 observed_generation = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this WorkerPool, containing its readiness - // status, and detailed error information in case it did not reach a serving - // state. See comments in `reconciling` for additional information on - // reconciliation process in Cloud Run. - Condition terminal_condition = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Conditions of all other associated sub-resources. They - // contain additional diagnostics information in case the WorkerPool does not - // reach its Serving state. See comments in `reconciling` for additional - // information on reconciliation process in Cloud Run. - repeated Condition conditions = 32 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the latest revision that is serving workloads. See - // comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. - string latest_ready_revision = 33 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Output only. Name of the last created revision. See comments in - // `reconciling` for additional information on reconciliation process in Cloud - // Run. - string latest_created_revision = 34 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Output only. Detailed status information for corresponding instance splits. - // See comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. - repeated InstanceSplitStatus instance_split_statuses = 27 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Indicates whether Cloud Run Threat Detection monitoring is - // enabled for the parent project of this worker pool. - bool threat_detection_enabled = 28 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Not supported, and ignored by Cloud Run. - repeated string custom_audiences = 37; - - // Output only. Reserved for future use. - bool satisfies_pzs = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Returns true if the WorkerPool is currently being acted upon - // by the system to bring it into the desired state. - // - // When a new WorkerPool is created, or an existing one is updated, Cloud Run - // will asynchronously perform all necessary steps to bring the WorkerPool to - // the desired serving state. This process is called reconciliation. While - // reconciliation is in process, `observed_generation`, - // `latest_ready_revison`, `instance_split_statuses`, and `uri` will have - // transient values that might mismatch the intended state: Once - // reconciliation is over (and this field is false), there are two possible - // outcomes: reconciliation succeeded and the serving state matches the - // WorkerPool, or there was an error, and reconciliation failed. This state - // can be found in `terminal_condition.state`. - // - // If reconciliation succeeded, the following fields will match: - // `instance_splits` and `instance_split_statuses`, `observed_generation` and - // `generation`, `latest_ready_revision` and `latest_created_revision`. - // - // If reconciliation failed, `instance_split_statuses`, `observed_generation`, - // and `latest_ready_revision` will have the state of the last serving - // revision, or empty for newly created WorkerPools. Additional information on - // the failure can be found in `terminal_condition` and `conditions`. - bool reconciling = 98 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto deleted file mode 100644 index fa07f6f8e07..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "WorkerPoolRevisionTemplateProto"; -option java_package = "com.google.cloud.run.v2"; - -// WorkerPoolRevisionTemplate describes the data a worker pool revision should -// have when created from a template. -message WorkerPoolRevisionTemplate { - // Optional. The unique name for the revision. If this field is omitted, it - // will be automatically generated based on the WorkerPool name. - string revision = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Optional. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - // Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 WorkerPoolRevisionTemplate. - map labels = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Unstructured key value map that may be set by external tools to - // store and arbitrary metadata. They are not queryable and should be - // preserved when modifying objects. - // - // Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system annotations in v1 now - // have a corresponding field in v2 WorkerPoolRevisionTemplate. - // - // This field follows Kubernetes annotations' namespacing, limits, and - // rules. - map annotations = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. VPC Access configuration to use for this Revision. For more - // information, visit - // https://cloud.google.com/run/docs/configuring/connecting-vpc. - VpcAccess vpc_access = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Email address of the IAM service account associated with the - // revision of the service. The service account represents the identity of the - // running revision, and determines what permissions the revision has. If not - // provided, the revision will use the project's default service account. - string service_account = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Holds list of the containers that defines the unit of execution for this - // Revision. - repeated Container containers = 6; - - // Optional. A list of Volumes to make available to containers. - repeated Volume volumes = 7 [(google.api.field_behavior) = OPTIONAL]; - - // A reference to a customer managed encryption key (CMEK) to use to encrypt - // this container image. For more information, go to - // https://cloud.google.com/run/docs/securing/using-cmek - string encryption_key = 8 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Optional. Enables service mesh connectivity. - ServiceMesh service_mesh = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The action to take if the encryption key is revoked. - EncryptionKeyRevocationAction encryption_key_revocation_action = 10 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If encryption_key_revocation_action is SHUTDOWN, the duration - // before shutting down all instances. The minimum increment is 1 hour. - google.protobuf.Duration encryption_key_shutdown_duration = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The node selector for the revision template. - NodeSelector node_selector = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. True if GPU zonal redundancy is disabled on this worker pool. - optional bool gpu_zonal_redundancy_disabled = 16 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/protos.d.ts b/owl-bot-staging/google-cloud-run/protos/protos.d.ts deleted file mode 100644 index 0f969068560..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/protos.d.ts +++ /dev/null @@ -1,22927 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace run. */ - namespace run { - - /** Namespace v2. */ - namespace v2 { - - /** Represents a Builds */ - class Builds extends $protobuf.rpc.Service { - - /** - * Constructs a new Builds 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 Builds 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): Builds; - - /** - * Calls SubmitBuild. - * @param request SubmitBuildRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SubmitBuildResponse - */ - public submitBuild(request: google.cloud.run.v2.ISubmitBuildRequest, callback: google.cloud.run.v2.Builds.SubmitBuildCallback): void; - - /** - * Calls SubmitBuild. - * @param request SubmitBuildRequest message or plain object - * @returns Promise - */ - public submitBuild(request: google.cloud.run.v2.ISubmitBuildRequest): Promise; - } - - namespace Builds { - - /** - * Callback as used by {@link google.cloud.run.v2.Builds|submitBuild}. - * @param error Error, if any - * @param [response] SubmitBuildResponse - */ - type SubmitBuildCallback = (error: (Error|null), response?: google.cloud.run.v2.SubmitBuildResponse) => void; - } - - /** Properties of a SubmitBuildRequest. */ - interface ISubmitBuildRequest { - - /** SubmitBuildRequest parent */ - parent?: (string|null); - - /** SubmitBuildRequest storageSource */ - storageSource?: (google.cloud.run.v2.IStorageSource|null); - - /** SubmitBuildRequest imageUri */ - imageUri?: (string|null); - - /** SubmitBuildRequest buildpackBuild */ - buildpackBuild?: (google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null); - - /** SubmitBuildRequest dockerBuild */ - dockerBuild?: (google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null); - - /** SubmitBuildRequest serviceAccount */ - serviceAccount?: (string|null); - - /** SubmitBuildRequest workerPool */ - workerPool?: (string|null); - - /** SubmitBuildRequest tags */ - tags?: (string[]|null); - - /** SubmitBuildRequest machineType */ - machineType?: (string|null); - - /** SubmitBuildRequest releaseTrack */ - releaseTrack?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** SubmitBuildRequest client */ - client?: (string|null); - } - - /** Represents a SubmitBuildRequest. */ - class SubmitBuildRequest implements ISubmitBuildRequest { - - /** - * Constructs a new SubmitBuildRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ISubmitBuildRequest); - - /** SubmitBuildRequest parent. */ - public parent: string; - - /** SubmitBuildRequest storageSource. */ - public storageSource?: (google.cloud.run.v2.IStorageSource|null); - - /** SubmitBuildRequest imageUri. */ - public imageUri: string; - - /** SubmitBuildRequest buildpackBuild. */ - public buildpackBuild?: (google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null); - - /** SubmitBuildRequest dockerBuild. */ - public dockerBuild?: (google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null); - - /** SubmitBuildRequest serviceAccount. */ - public serviceAccount: string; - - /** SubmitBuildRequest workerPool. */ - public workerPool: string; - - /** SubmitBuildRequest tags. */ - public tags: string[]; - - /** SubmitBuildRequest machineType. */ - public machineType: string; - - /** SubmitBuildRequest releaseTrack. */ - public releaseTrack: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** SubmitBuildRequest client. */ - public client: string; - - /** SubmitBuildRequest source. */ - public source?: "storageSource"; - - /** SubmitBuildRequest buildType. */ - public buildType?: ("buildpackBuild"|"dockerBuild"); - - /** - * Creates a new SubmitBuildRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SubmitBuildRequest instance - */ - public static create(properties?: google.cloud.run.v2.ISubmitBuildRequest): google.cloud.run.v2.SubmitBuildRequest; - - /** - * Encodes the specified SubmitBuildRequest message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. - * @param message SubmitBuildRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ISubmitBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubmitBuildRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. - * @param message SubmitBuildRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ISubmitBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubmitBuildRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubmitBuildRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildRequest; - - /** - * Decodes a SubmitBuildRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubmitBuildRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildRequest; - - /** - * Verifies a SubmitBuildRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SubmitBuildRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubmitBuildRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildRequest; - - /** - * Creates a plain object from a SubmitBuildRequest message. Also converts values to other types if specified. - * @param message SubmitBuildRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SubmitBuildRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubmitBuildRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubmitBuildRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SubmitBuildRequest { - - /** Properties of a DockerBuild. */ - interface IDockerBuild { - } - - /** Represents a DockerBuild. */ - class DockerBuild implements IDockerBuild { - - /** - * Constructs a new DockerBuild. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild); - - /** - * Creates a new DockerBuild instance using the specified properties. - * @param [properties] Properties to set - * @returns DockerBuild instance - */ - public static create(properties?: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; - - /** - * Encodes the specified DockerBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. - * @param message DockerBuild message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DockerBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. - * @param message DockerBuild message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DockerBuild message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DockerBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; - - /** - * Decodes a DockerBuild message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DockerBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; - - /** - * Verifies a DockerBuild message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DockerBuild message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DockerBuild - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; - - /** - * Creates a plain object from a DockerBuild message. Also converts values to other types if specified. - * @param message DockerBuild - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SubmitBuildRequest.DockerBuild, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DockerBuild to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DockerBuild - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BuildpacksBuild. */ - interface IBuildpacksBuild { - - /** BuildpacksBuild runtime */ - runtime?: (string|null); - - /** BuildpacksBuild functionTarget */ - functionTarget?: (string|null); - - /** BuildpacksBuild cacheImageUri */ - cacheImageUri?: (string|null); - - /** BuildpacksBuild baseImage */ - baseImage?: (string|null); - - /** BuildpacksBuild environmentVariables */ - environmentVariables?: ({ [k: string]: string }|null); - - /** BuildpacksBuild enableAutomaticUpdates */ - enableAutomaticUpdates?: (boolean|null); - - /** BuildpacksBuild projectDescriptor */ - projectDescriptor?: (string|null); - } - - /** Represents a BuildpacksBuild. */ - class BuildpacksBuild implements IBuildpacksBuild { - - /** - * Constructs a new BuildpacksBuild. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild); - - /** BuildpacksBuild runtime. */ - public runtime: string; - - /** BuildpacksBuild functionTarget. */ - public functionTarget: string; - - /** BuildpacksBuild cacheImageUri. */ - public cacheImageUri: string; - - /** BuildpacksBuild baseImage. */ - public baseImage: string; - - /** BuildpacksBuild environmentVariables. */ - public environmentVariables: { [k: string]: string }; - - /** BuildpacksBuild enableAutomaticUpdates. */ - public enableAutomaticUpdates: boolean; - - /** BuildpacksBuild projectDescriptor. */ - public projectDescriptor: string; - - /** - * Creates a new BuildpacksBuild instance using the specified properties. - * @param [properties] Properties to set - * @returns BuildpacksBuild instance - */ - public static create(properties?: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; - - /** - * Encodes the specified BuildpacksBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. - * @param message BuildpacksBuild message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BuildpacksBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. - * @param message BuildpacksBuild message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BuildpacksBuild message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BuildpacksBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; - - /** - * Decodes a BuildpacksBuild message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BuildpacksBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; - - /** - * Verifies a BuildpacksBuild message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BuildpacksBuild message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BuildpacksBuild - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; - - /** - * Creates a plain object from a BuildpacksBuild message. Also converts values to other types if specified. - * @param message BuildpacksBuild - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BuildpacksBuild to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BuildpacksBuild - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SubmitBuildResponse. */ - interface ISubmitBuildResponse { - - /** SubmitBuildResponse buildOperation */ - buildOperation?: (google.longrunning.IOperation|null); - - /** SubmitBuildResponse baseImageUri */ - baseImageUri?: (string|null); - - /** SubmitBuildResponse baseImageWarning */ - baseImageWarning?: (string|null); - } - - /** Represents a SubmitBuildResponse. */ - class SubmitBuildResponse implements ISubmitBuildResponse { - - /** - * Constructs a new SubmitBuildResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ISubmitBuildResponse); - - /** SubmitBuildResponse buildOperation. */ - public buildOperation?: (google.longrunning.IOperation|null); - - /** SubmitBuildResponse baseImageUri. */ - public baseImageUri: string; - - /** SubmitBuildResponse baseImageWarning. */ - public baseImageWarning: string; - - /** - * Creates a new SubmitBuildResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SubmitBuildResponse instance - */ - public static create(properties?: google.cloud.run.v2.ISubmitBuildResponse): google.cloud.run.v2.SubmitBuildResponse; - - /** - * Encodes the specified SubmitBuildResponse message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. - * @param message SubmitBuildResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ISubmitBuildResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubmitBuildResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. - * @param message SubmitBuildResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ISubmitBuildResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubmitBuildResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubmitBuildResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildResponse; - - /** - * Decodes a SubmitBuildResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubmitBuildResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildResponse; - - /** - * Verifies a SubmitBuildResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SubmitBuildResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubmitBuildResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildResponse; - - /** - * Creates a plain object from a SubmitBuildResponse message. Also converts values to other types if specified. - * @param message SubmitBuildResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SubmitBuildResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubmitBuildResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubmitBuildResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StorageSource. */ - interface IStorageSource { - - /** StorageSource bucket */ - bucket?: (string|null); - - /** StorageSource object */ - object?: (string|null); - - /** StorageSource generation */ - generation?: (number|Long|string|null); - } - - /** Represents a StorageSource. */ - class StorageSource implements IStorageSource { - - /** - * Constructs a new StorageSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IStorageSource); - - /** StorageSource bucket. */ - public bucket: string; - - /** StorageSource object. */ - public object: string; - - /** StorageSource generation. */ - public generation: (number|Long|string); - - /** - * Creates a new StorageSource instance using the specified properties. - * @param [properties] Properties to set - * @returns StorageSource instance - */ - public static create(properties?: google.cloud.run.v2.IStorageSource): google.cloud.run.v2.StorageSource; - - /** - * Encodes the specified StorageSource message. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. - * @param message StorageSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. - * @param message StorageSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StorageSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StorageSource; - - /** - * Decodes a StorageSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StorageSource; - - /** - * Verifies a StorageSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StorageSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StorageSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StorageSource; - - /** - * Creates a plain object from a StorageSource message. Also converts values to other types if specified. - * @param message StorageSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.StorageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StorageSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StorageSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Condition. */ - interface ICondition { - - /** Condition type */ - type?: (string|null); - - /** Condition state */ - state?: (google.cloud.run.v2.Condition.State|keyof typeof google.cloud.run.v2.Condition.State|null); - - /** Condition message */ - message?: (string|null); - - /** Condition lastTransitionTime */ - lastTransitionTime?: (google.protobuf.ITimestamp|null); - - /** Condition severity */ - severity?: (google.cloud.run.v2.Condition.Severity|keyof typeof google.cloud.run.v2.Condition.Severity|null); - - /** Condition reason */ - reason?: (google.cloud.run.v2.Condition.CommonReason|keyof typeof google.cloud.run.v2.Condition.CommonReason|null); - - /** Condition revisionReason */ - revisionReason?: (google.cloud.run.v2.Condition.RevisionReason|keyof typeof google.cloud.run.v2.Condition.RevisionReason|null); - - /** Condition executionReason */ - executionReason?: (google.cloud.run.v2.Condition.ExecutionReason|keyof typeof google.cloud.run.v2.Condition.ExecutionReason|null); - } - - /** Represents a Condition. */ - class Condition implements ICondition { - - /** - * Constructs a new Condition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICondition); - - /** Condition type. */ - public type: string; - - /** Condition state. */ - public state: (google.cloud.run.v2.Condition.State|keyof typeof google.cloud.run.v2.Condition.State); - - /** Condition message. */ - public message: string; - - /** Condition lastTransitionTime. */ - public lastTransitionTime?: (google.protobuf.ITimestamp|null); - - /** Condition severity. */ - public severity: (google.cloud.run.v2.Condition.Severity|keyof typeof google.cloud.run.v2.Condition.Severity); - - /** Condition reason. */ - public reason?: (google.cloud.run.v2.Condition.CommonReason|keyof typeof google.cloud.run.v2.Condition.CommonReason|null); - - /** Condition revisionReason. */ - public revisionReason?: (google.cloud.run.v2.Condition.RevisionReason|keyof typeof google.cloud.run.v2.Condition.RevisionReason|null); - - /** Condition executionReason. */ - public executionReason?: (google.cloud.run.v2.Condition.ExecutionReason|keyof typeof google.cloud.run.v2.Condition.ExecutionReason|null); - - /** Condition reasons. */ - public reasons?: ("reason"|"revisionReason"|"executionReason"); - - /** - * Creates a new Condition instance using the specified properties. - * @param [properties] Properties to set - * @returns Condition instance - */ - public static create(properties?: google.cloud.run.v2.ICondition): google.cloud.run.v2.Condition; - - /** - * Encodes the specified Condition message. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Condition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Condition; - - /** - * Decodes a Condition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Condition; - - /** - * Verifies a Condition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Condition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Condition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Condition; - - /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @param message Condition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Condition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Condition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Condition { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CONDITION_PENDING = 1, - CONDITION_RECONCILING = 2, - CONDITION_FAILED = 3, - CONDITION_SUCCEEDED = 4 - } - - /** Severity enum. */ - enum Severity { - SEVERITY_UNSPECIFIED = 0, - ERROR = 1, - WARNING = 2, - INFO = 3 - } - - /** CommonReason enum. */ - enum CommonReason { - COMMON_REASON_UNDEFINED = 0, - UNKNOWN = 1, - REVISION_FAILED = 3, - PROGRESS_DEADLINE_EXCEEDED = 4, - CONTAINER_MISSING = 6, - CONTAINER_PERMISSION_DENIED = 7, - CONTAINER_IMAGE_UNAUTHORIZED = 8, - CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9, - ENCRYPTION_KEY_PERMISSION_DENIED = 10, - ENCRYPTION_KEY_CHECK_FAILED = 11, - SECRETS_ACCESS_CHECK_FAILED = 12, - WAITING_FOR_OPERATION = 13, - IMMEDIATE_RETRY = 14, - POSTPONED_RETRY = 15, - INTERNAL = 16, - VPC_NETWORK_NOT_FOUND = 17 - } - - /** RevisionReason enum. */ - enum RevisionReason { - REVISION_REASON_UNDEFINED = 0, - PENDING = 1, - RESERVE = 2, - RETIRED = 3, - RETIRING = 4, - RECREATING = 5, - HEALTH_CHECK_CONTAINER_ERROR = 6, - CUSTOMIZED_PATH_RESPONSE_PENDING = 7, - MIN_INSTANCES_NOT_PROVISIONED = 8, - ACTIVE_REVISION_LIMIT_REACHED = 9, - NO_DEPLOYMENT = 10, - HEALTH_CHECK_SKIPPED = 11, - MIN_INSTANCES_WARMING = 12 - } - - /** ExecutionReason enum. */ - enum ExecutionReason { - EXECUTION_REASON_UNDEFINED = 0, - JOB_STATUS_SERVICE_POLLING_ERROR = 1, - NON_ZERO_EXIT_CODE = 2, - CANCELLED = 3, - CANCELLING = 4, - DELETED = 5, - DELAYED_START_PENDING = 6 - } - } - - /** Properties of a ContainerStatus. */ - interface IContainerStatus { - - /** ContainerStatus name */ - name?: (string|null); - - /** ContainerStatus imageDigest */ - imageDigest?: (string|null); - } - - /** Represents a ContainerStatus. */ - class ContainerStatus implements IContainerStatus { - - /** - * Constructs a new ContainerStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IContainerStatus); - - /** ContainerStatus name. */ - public name: string; - - /** ContainerStatus imageDigest. */ - public imageDigest: string; - - /** - * Creates a new ContainerStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns ContainerStatus instance - */ - public static create(properties?: google.cloud.run.v2.IContainerStatus): google.cloud.run.v2.ContainerStatus; - - /** - * Encodes the specified ContainerStatus message. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. - * @param message ContainerStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IContainerStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContainerStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. - * @param message ContainerStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IContainerStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContainerStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContainerStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ContainerStatus; - - /** - * Decodes a ContainerStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContainerStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ContainerStatus; - - /** - * Verifies a ContainerStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContainerStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContainerStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ContainerStatus; - - /** - * Creates a plain object from a ContainerStatus message. Also converts values to other types if specified. - * @param message ContainerStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ContainerStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContainerStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContainerStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an Executions */ - class Executions extends $protobuf.rpc.Service { - - /** - * Constructs a new Executions 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 Executions 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): Executions; - - /** - * Calls GetExecution. - * @param request GetExecutionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Execution - */ - public getExecution(request: google.cloud.run.v2.IGetExecutionRequest, callback: google.cloud.run.v2.Executions.GetExecutionCallback): void; - - /** - * Calls GetExecution. - * @param request GetExecutionRequest message or plain object - * @returns Promise - */ - public getExecution(request: google.cloud.run.v2.IGetExecutionRequest): Promise; - - /** - * Calls ListExecutions. - * @param request ListExecutionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListExecutionsResponse - */ - public listExecutions(request: google.cloud.run.v2.IListExecutionsRequest, callback: google.cloud.run.v2.Executions.ListExecutionsCallback): void; - - /** - * Calls ListExecutions. - * @param request ListExecutionsRequest message or plain object - * @returns Promise - */ - public listExecutions(request: google.cloud.run.v2.IListExecutionsRequest): Promise; - - /** - * Calls DeleteExecution. - * @param request DeleteExecutionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteExecution(request: google.cloud.run.v2.IDeleteExecutionRequest, callback: google.cloud.run.v2.Executions.DeleteExecutionCallback): void; - - /** - * Calls DeleteExecution. - * @param request DeleteExecutionRequest message or plain object - * @returns Promise - */ - public deleteExecution(request: google.cloud.run.v2.IDeleteExecutionRequest): Promise; - - /** - * Calls CancelExecution. - * @param request CancelExecutionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public cancelExecution(request: google.cloud.run.v2.ICancelExecutionRequest, callback: google.cloud.run.v2.Executions.CancelExecutionCallback): void; - - /** - * Calls CancelExecution. - * @param request CancelExecutionRequest message or plain object - * @returns Promise - */ - public cancelExecution(request: google.cloud.run.v2.ICancelExecutionRequest): Promise; - } - - namespace Executions { - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|getExecution}. - * @param error Error, if any - * @param [response] Execution - */ - type GetExecutionCallback = (error: (Error|null), response?: google.cloud.run.v2.Execution) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|listExecutions}. - * @param error Error, if any - * @param [response] ListExecutionsResponse - */ - type ListExecutionsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListExecutionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|deleteExecution}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteExecutionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|cancelExecution}. - * @param error Error, if any - * @param [response] Operation - */ - type CancelExecutionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a GetExecutionRequest. */ - interface IGetExecutionRequest { - - /** GetExecutionRequest name */ - name?: (string|null); - } - - /** Represents a GetExecutionRequest. */ - class GetExecutionRequest implements IGetExecutionRequest { - - /** - * Constructs a new GetExecutionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGetExecutionRequest); - - /** GetExecutionRequest name. */ - public name: string; - - /** - * Creates a new GetExecutionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetExecutionRequest instance - */ - public static create(properties?: google.cloud.run.v2.IGetExecutionRequest): google.cloud.run.v2.GetExecutionRequest; - - /** - * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. - * @param message GetExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. - * @param message GetExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetExecutionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetExecutionRequest; - - /** - * Decodes a GetExecutionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetExecutionRequest; - - /** - * Verifies a GetExecutionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetExecutionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetExecutionRequest; - - /** - * Creates a plain object from a GetExecutionRequest message. Also converts values to other types if specified. - * @param message GetExecutionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GetExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetExecutionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetExecutionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListExecutionsRequest. */ - interface IListExecutionsRequest { - - /** ListExecutionsRequest parent */ - parent?: (string|null); - - /** ListExecutionsRequest pageSize */ - pageSize?: (number|null); - - /** ListExecutionsRequest pageToken */ - pageToken?: (string|null); - - /** ListExecutionsRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListExecutionsRequest. */ - class ListExecutionsRequest implements IListExecutionsRequest { - - /** - * Constructs a new ListExecutionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListExecutionsRequest); - - /** ListExecutionsRequest parent. */ - public parent: string; - - /** ListExecutionsRequest pageSize. */ - public pageSize: number; - - /** ListExecutionsRequest pageToken. */ - public pageToken: string; - - /** ListExecutionsRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListExecutionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListExecutionsRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListExecutionsRequest): google.cloud.run.v2.ListExecutionsRequest; - - /** - * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. - * @param message ListExecutionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. - * @param message ListExecutionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListExecutionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListExecutionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListExecutionsRequest; - - /** - * Decodes a ListExecutionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListExecutionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListExecutionsRequest; - - /** - * Verifies a ListExecutionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListExecutionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListExecutionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListExecutionsRequest; - - /** - * Creates a plain object from a ListExecutionsRequest message. Also converts values to other types if specified. - * @param message ListExecutionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListExecutionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListExecutionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListExecutionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListExecutionsResponse. */ - interface IListExecutionsResponse { - - /** ListExecutionsResponse executions */ - executions?: (google.cloud.run.v2.IExecution[]|null); - - /** ListExecutionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListExecutionsResponse. */ - class ListExecutionsResponse implements IListExecutionsResponse { - - /** - * Constructs a new ListExecutionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListExecutionsResponse); - - /** ListExecutionsResponse executions. */ - public executions: google.cloud.run.v2.IExecution[]; - - /** ListExecutionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListExecutionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListExecutionsResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListExecutionsResponse): google.cloud.run.v2.ListExecutionsResponse; - - /** - * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. - * @param message ListExecutionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. - * @param message ListExecutionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListExecutionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListExecutionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListExecutionsResponse; - - /** - * Decodes a ListExecutionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListExecutionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListExecutionsResponse; - - /** - * Verifies a ListExecutionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListExecutionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListExecutionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListExecutionsResponse; - - /** - * Creates a plain object from a ListExecutionsResponse message. Also converts values to other types if specified. - * @param message ListExecutionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListExecutionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListExecutionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListExecutionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteExecutionRequest. */ - interface IDeleteExecutionRequest { - - /** DeleteExecutionRequest name */ - name?: (string|null); - - /** DeleteExecutionRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteExecutionRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteExecutionRequest. */ - class DeleteExecutionRequest implements IDeleteExecutionRequest { - - /** - * Constructs a new DeleteExecutionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteExecutionRequest); - - /** DeleteExecutionRequest name. */ - public name: string; - - /** DeleteExecutionRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteExecutionRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteExecutionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteExecutionRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteExecutionRequest): google.cloud.run.v2.DeleteExecutionRequest; - - /** - * Encodes the specified DeleteExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. - * @param message DeleteExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IDeleteExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. - * @param message DeleteExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IDeleteExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteExecutionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteExecutionRequest; - - /** - * Decodes a DeleteExecutionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteExecutionRequest; - - /** - * Verifies a DeleteExecutionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteExecutionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteExecutionRequest; - - /** - * Creates a plain object from a DeleteExecutionRequest message. Also converts values to other types if specified. - * @param message DeleteExecutionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.DeleteExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteExecutionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteExecutionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelExecutionRequest. */ - interface ICancelExecutionRequest { - - /** CancelExecutionRequest name */ - name?: (string|null); - - /** CancelExecutionRequest validateOnly */ - validateOnly?: (boolean|null); - - /** CancelExecutionRequest etag */ - etag?: (string|null); - } - - /** Represents a CancelExecutionRequest. */ - class CancelExecutionRequest implements ICancelExecutionRequest { - - /** - * Constructs a new CancelExecutionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICancelExecutionRequest); - - /** CancelExecutionRequest name. */ - public name: string; - - /** CancelExecutionRequest validateOnly. */ - public validateOnly: boolean; - - /** CancelExecutionRequest etag. */ - public etag: string; - - /** - * Creates a new CancelExecutionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelExecutionRequest instance - */ - public static create(properties?: google.cloud.run.v2.ICancelExecutionRequest): google.cloud.run.v2.CancelExecutionRequest; - - /** - * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. - * @param message CancelExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. - * @param message CancelExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelExecutionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CancelExecutionRequest; - - /** - * Decodes a CancelExecutionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CancelExecutionRequest; - - /** - * Verifies a CancelExecutionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelExecutionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CancelExecutionRequest; - - /** - * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. - * @param message CancelExecutionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.CancelExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelExecutionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelExecutionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Execution. */ - interface IExecution { - - /** Execution name */ - name?: (string|null); - - /** Execution uid */ - uid?: (string|null); - - /** Execution creator */ - creator?: (string|null); - - /** Execution generation */ - generation?: (number|Long|string|null); - - /** Execution labels */ - labels?: ({ [k: string]: string }|null); - - /** Execution annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Execution createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Execution startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Execution completionTime */ - completionTime?: (google.protobuf.ITimestamp|null); - - /** Execution updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Execution deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Execution expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Execution launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** Execution job */ - job?: (string|null); - - /** Execution parallelism */ - parallelism?: (number|null); - - /** Execution taskCount */ - taskCount?: (number|null); - - /** Execution template */ - template?: (google.cloud.run.v2.ITaskTemplate|null); - - /** Execution reconciling */ - reconciling?: (boolean|null); - - /** Execution conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Execution observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Execution runningCount */ - runningCount?: (number|null); - - /** Execution succeededCount */ - succeededCount?: (number|null); - - /** Execution failedCount */ - failedCount?: (number|null); - - /** Execution cancelledCount */ - cancelledCount?: (number|null); - - /** Execution retriedCount */ - retriedCount?: (number|null); - - /** Execution logUri */ - logUri?: (string|null); - - /** Execution satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Execution etag */ - etag?: (string|null); - } - - /** Represents an Execution. */ - class Execution implements IExecution { - - /** - * Constructs a new Execution. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IExecution); - - /** Execution name. */ - public name: string; - - /** Execution uid. */ - public uid: string; - - /** Execution creator. */ - public creator: string; - - /** Execution generation. */ - public generation: (number|Long|string); - - /** Execution labels. */ - public labels: { [k: string]: string }; - - /** Execution annotations. */ - public annotations: { [k: string]: string }; - - /** Execution createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Execution startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Execution completionTime. */ - public completionTime?: (google.protobuf.ITimestamp|null); - - /** Execution updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Execution deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Execution expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Execution launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** Execution job. */ - public job: string; - - /** Execution parallelism. */ - public parallelism: number; - - /** Execution taskCount. */ - public taskCount: number; - - /** Execution template. */ - public template?: (google.cloud.run.v2.ITaskTemplate|null); - - /** Execution reconciling. */ - public reconciling: boolean; - - /** Execution conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Execution observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Execution runningCount. */ - public runningCount: number; - - /** Execution succeededCount. */ - public succeededCount: number; - - /** Execution failedCount. */ - public failedCount: number; - - /** Execution cancelledCount. */ - public cancelledCount: number; - - /** Execution retriedCount. */ - public retriedCount: number; - - /** Execution logUri. */ - public logUri: string; - - /** Execution satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Execution etag. */ - public etag: string; - - /** - * Creates a new Execution instance using the specified properties. - * @param [properties] Properties to set - * @returns Execution instance - */ - public static create(properties?: google.cloud.run.v2.IExecution): google.cloud.run.v2.Execution; - - /** - * Encodes the specified Execution message. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. - * @param message Execution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. - * @param message Execution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Execution message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Execution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Execution; - - /** - * Decodes an Execution message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Execution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Execution; - - /** - * Verifies an Execution message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Execution message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Execution - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Execution; - - /** - * Creates a plain object from an Execution message. Also converts values to other types if specified. - * @param message Execution - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Execution, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Execution to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Execution - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskTemplate. */ - interface ITaskTemplate { - - /** TaskTemplate containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** TaskTemplate volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** TaskTemplate maxRetries */ - maxRetries?: (number|null); - - /** TaskTemplate timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** TaskTemplate serviceAccount */ - serviceAccount?: (string|null); - - /** TaskTemplate executionEnvironment */ - executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); - - /** TaskTemplate encryptionKey */ - encryptionKey?: (string|null); - - /** TaskTemplate vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** TaskTemplate nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** TaskTemplate gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - } - - /** Represents a TaskTemplate. */ - class TaskTemplate implements ITaskTemplate { - - /** - * Constructs a new TaskTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITaskTemplate); - - /** TaskTemplate containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** TaskTemplate volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** TaskTemplate maxRetries. */ - public maxRetries?: (number|null); - - /** TaskTemplate timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** TaskTemplate serviceAccount. */ - public serviceAccount: string; - - /** TaskTemplate executionEnvironment. */ - public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); - - /** TaskTemplate encryptionKey. */ - public encryptionKey: string; - - /** TaskTemplate vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** TaskTemplate nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** TaskTemplate gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** TaskTemplate retries. */ - public retries?: "maxRetries"; - - /** - * Creates a new TaskTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskTemplate instance - */ - public static create(properties?: google.cloud.run.v2.ITaskTemplate): google.cloud.run.v2.TaskTemplate; - - /** - * Encodes the specified TaskTemplate message. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. - * @param message TaskTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ITaskTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. - * @param message TaskTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ITaskTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TaskTemplate; - - /** - * Decodes a TaskTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TaskTemplate; - - /** - * Verifies a TaskTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TaskTemplate; - - /** - * Creates a plain object from a TaskTemplate message. Also converts values to other types if specified. - * @param message TaskTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.TaskTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Container. */ - interface IContainer { - - /** Container name */ - name?: (string|null); - - /** Container image */ - image?: (string|null); - - /** Container sourceCode */ - sourceCode?: (google.cloud.run.v2.ISourceCode|null); - - /** Container command */ - command?: (string[]|null); - - /** Container args */ - args?: (string[]|null); - - /** Container env */ - env?: (google.cloud.run.v2.IEnvVar[]|null); - - /** Container resources */ - resources?: (google.cloud.run.v2.IResourceRequirements|null); - - /** Container ports */ - ports?: (google.cloud.run.v2.IContainerPort[]|null); - - /** Container volumeMounts */ - volumeMounts?: (google.cloud.run.v2.IVolumeMount[]|null); - - /** Container workingDir */ - workingDir?: (string|null); - - /** Container livenessProbe */ - livenessProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container startupProbe */ - startupProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container readinessProbe */ - readinessProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container dependsOn */ - dependsOn?: (string[]|null); - - /** Container baseImageUri */ - baseImageUri?: (string|null); - - /** Container buildInfo */ - buildInfo?: (google.cloud.run.v2.IBuildInfo|null); - } - - /** Represents a Container. */ - class Container implements IContainer { - - /** - * Constructs a new Container. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IContainer); - - /** Container name. */ - public name: string; - - /** Container image. */ - public image: string; - - /** Container sourceCode. */ - public sourceCode?: (google.cloud.run.v2.ISourceCode|null); - - /** Container command. */ - public command: string[]; - - /** Container args. */ - public args: string[]; - - /** Container env. */ - public env: google.cloud.run.v2.IEnvVar[]; - - /** Container resources. */ - public resources?: (google.cloud.run.v2.IResourceRequirements|null); - - /** Container ports. */ - public ports: google.cloud.run.v2.IContainerPort[]; - - /** Container volumeMounts. */ - public volumeMounts: google.cloud.run.v2.IVolumeMount[]; - - /** Container workingDir. */ - public workingDir: string; - - /** Container livenessProbe. */ - public livenessProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container startupProbe. */ - public startupProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container readinessProbe. */ - public readinessProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container dependsOn. */ - public dependsOn: string[]; - - /** Container baseImageUri. */ - public baseImageUri: string; - - /** Container buildInfo. */ - public buildInfo?: (google.cloud.run.v2.IBuildInfo|null); - - /** - * Creates a new Container instance using the specified properties. - * @param [properties] Properties to set - * @returns Container instance - */ - public static create(properties?: google.cloud.run.v2.IContainer): google.cloud.run.v2.Container; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 ResourceRequirements. */ - interface IResourceRequirements { - - /** ResourceRequirements limits */ - limits?: ({ [k: string]: string }|null); - - /** ResourceRequirements cpuIdle */ - cpuIdle?: (boolean|null); - - /** ResourceRequirements startupCpuBoost */ - startupCpuBoost?: (boolean|null); - } - - /** Represents a ResourceRequirements. */ - class ResourceRequirements implements IResourceRequirements { - - /** - * Constructs a new ResourceRequirements. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IResourceRequirements); - - /** ResourceRequirements limits. */ - public limits: { [k: string]: string }; - - /** ResourceRequirements cpuIdle. */ - public cpuIdle: boolean; - - /** ResourceRequirements startupCpuBoost. */ - public startupCpuBoost: boolean; - - /** - * Creates a new ResourceRequirements instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceRequirements instance - */ - public static create(properties?: google.cloud.run.v2.IResourceRequirements): google.cloud.run.v2.ResourceRequirements; - - /** - * Encodes the specified ResourceRequirements message. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. - * @param message ResourceRequirements message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IResourceRequirements, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceRequirements message, length delimited. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. - * @param message ResourceRequirements message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IResourceRequirements, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceRequirements message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceRequirements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ResourceRequirements; - - /** - * Decodes a ResourceRequirements message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceRequirements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ResourceRequirements; - - /** - * Verifies a ResourceRequirements message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceRequirements message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceRequirements - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ResourceRequirements; - - /** - * Creates a plain object from a ResourceRequirements message. Also converts values to other types if specified. - * @param message ResourceRequirements - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ResourceRequirements, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceRequirements to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceRequirements - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnvVar. */ - interface IEnvVar { - - /** EnvVar name */ - name?: (string|null); - - /** EnvVar value */ - value?: (string|null); - - /** EnvVar valueSource */ - valueSource?: (google.cloud.run.v2.IEnvVarSource|null); - } - - /** Represents an EnvVar. */ - class EnvVar implements IEnvVar { - - /** - * Constructs a new EnvVar. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IEnvVar); - - /** EnvVar name. */ - public name: string; - - /** EnvVar value. */ - public value?: (string|null); - - /** EnvVar valueSource. */ - public valueSource?: (google.cloud.run.v2.IEnvVarSource|null); - - /** EnvVar values. */ - public values?: ("value"|"valueSource"); - - /** - * Creates a new EnvVar instance using the specified properties. - * @param [properties] Properties to set - * @returns EnvVar instance - */ - public static create(properties?: google.cloud.run.v2.IEnvVar): google.cloud.run.v2.EnvVar; - - /** - * Encodes the specified EnvVar message. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. - * @param message EnvVar message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IEnvVar, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnvVar message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. - * @param message EnvVar message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IEnvVar, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnvVar message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnvVar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.EnvVar; - - /** - * Decodes an EnvVar message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnvVar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.EnvVar; - - /** - * Verifies an EnvVar message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnvVar message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnvVar - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.EnvVar; - - /** - * Creates a plain object from an EnvVar message. Also converts values to other types if specified. - * @param message EnvVar - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.EnvVar, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnvVar to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnvVar - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnvVarSource. */ - interface IEnvVarSource { - - /** EnvVarSource secretKeyRef */ - secretKeyRef?: (google.cloud.run.v2.ISecretKeySelector|null); - } - - /** Represents an EnvVarSource. */ - class EnvVarSource implements IEnvVarSource { - - /** - * Constructs a new EnvVarSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IEnvVarSource); - - /** EnvVarSource secretKeyRef. */ - public secretKeyRef?: (google.cloud.run.v2.ISecretKeySelector|null); - - /** - * Creates a new EnvVarSource instance using the specified properties. - * @param [properties] Properties to set - * @returns EnvVarSource instance - */ - public static create(properties?: google.cloud.run.v2.IEnvVarSource): google.cloud.run.v2.EnvVarSource; - - /** - * Encodes the specified EnvVarSource message. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. - * @param message EnvVarSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IEnvVarSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnvVarSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. - * @param message EnvVarSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IEnvVarSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnvVarSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnvVarSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.EnvVarSource; - - /** - * Decodes an EnvVarSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnvVarSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.EnvVarSource; - - /** - * Verifies an EnvVarSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnvVarSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnvVarSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.EnvVarSource; - - /** - * Creates a plain object from an EnvVarSource message. Also converts values to other types if specified. - * @param message EnvVarSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.EnvVarSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnvVarSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnvVarSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SecretKeySelector. */ - interface ISecretKeySelector { - - /** SecretKeySelector secret */ - secret?: (string|null); - - /** SecretKeySelector version */ - version?: (string|null); - } - - /** Represents a SecretKeySelector. */ - class SecretKeySelector implements ISecretKeySelector { - - /** - * Constructs a new SecretKeySelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ISecretKeySelector); - - /** SecretKeySelector secret. */ - public secret: string; - - /** SecretKeySelector version. */ - public version: string; - - /** - * Creates a new SecretKeySelector instance using the specified properties. - * @param [properties] Properties to set - * @returns SecretKeySelector instance - */ - public static create(properties?: google.cloud.run.v2.ISecretKeySelector): google.cloud.run.v2.SecretKeySelector; - - /** - * Encodes the specified SecretKeySelector message. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. - * @param message SecretKeySelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ISecretKeySelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecretKeySelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. - * @param message SecretKeySelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ISecretKeySelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecretKeySelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecretKeySelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SecretKeySelector; - - /** - * Decodes a SecretKeySelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecretKeySelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SecretKeySelector; - - /** - * Verifies a SecretKeySelector message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecretKeySelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecretKeySelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SecretKeySelector; - - /** - * Creates a plain object from a SecretKeySelector message. Also converts values to other types if specified. - * @param message SecretKeySelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SecretKeySelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecretKeySelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecretKeySelector - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ContainerPort. */ - interface IContainerPort { - - /** ContainerPort name */ - name?: (string|null); - - /** ContainerPort containerPort */ - containerPort?: (number|null); - } - - /** Represents a ContainerPort. */ - class ContainerPort implements IContainerPort { - - /** - * Constructs a new ContainerPort. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IContainerPort); - - /** ContainerPort name. */ - public name: string; - - /** ContainerPort containerPort. */ - public containerPort: number; - - /** - * Creates a new ContainerPort instance using the specified properties. - * @param [properties] Properties to set - * @returns ContainerPort instance - */ - public static create(properties?: google.cloud.run.v2.IContainerPort): google.cloud.run.v2.ContainerPort; - - /** - * Encodes the specified ContainerPort message. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. - * @param message ContainerPort message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IContainerPort, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContainerPort message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. - * @param message ContainerPort message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IContainerPort, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContainerPort message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContainerPort - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ContainerPort; - - /** - * Decodes a ContainerPort message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContainerPort - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ContainerPort; - - /** - * Verifies a ContainerPort message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContainerPort message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContainerPort - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ContainerPort; - - /** - * Creates a plain object from a ContainerPort message. Also converts values to other types if specified. - * @param message ContainerPort - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ContainerPort, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContainerPort to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContainerPort - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a VolumeMount. */ - interface IVolumeMount { - - /** VolumeMount name */ - name?: (string|null); - - /** VolumeMount mountPath */ - mountPath?: (string|null); - - /** VolumeMount subPath */ - subPath?: (string|null); - } - - /** Represents a VolumeMount. */ - class VolumeMount implements IVolumeMount { - - /** - * Constructs a new VolumeMount. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IVolumeMount); - - /** VolumeMount name. */ - public name: string; - - /** VolumeMount mountPath. */ - public mountPath: string; - - /** VolumeMount subPath. */ - public subPath: string; - - /** - * Creates a new VolumeMount instance using the specified properties. - * @param [properties] Properties to set - * @returns VolumeMount instance - */ - public static create(properties?: google.cloud.run.v2.IVolumeMount): google.cloud.run.v2.VolumeMount; - - /** - * Encodes the specified VolumeMount message. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. - * @param message VolumeMount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IVolumeMount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VolumeMount message, length delimited. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. - * @param message VolumeMount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IVolumeMount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VolumeMount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VolumeMount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.VolumeMount; - - /** - * Decodes a VolumeMount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VolumeMount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.VolumeMount; - - /** - * Verifies a VolumeMount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VolumeMount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VolumeMount - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.VolumeMount; - - /** - * Creates a plain object from a VolumeMount message. Also converts values to other types if specified. - * @param message VolumeMount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.VolumeMount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VolumeMount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VolumeMount - * @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 name */ - name?: (string|null); - - /** Volume secret */ - secret?: (google.cloud.run.v2.ISecretVolumeSource|null); - - /** Volume cloudSqlInstance */ - cloudSqlInstance?: (google.cloud.run.v2.ICloudSqlInstance|null); - - /** Volume emptyDir */ - emptyDir?: (google.cloud.run.v2.IEmptyDirVolumeSource|null); - - /** Volume nfs */ - nfs?: (google.cloud.run.v2.INFSVolumeSource|null); - - /** Volume gcs */ - gcs?: (google.cloud.run.v2.IGCSVolumeSource|null); - } - - /** Represents a Volume. */ - class Volume implements IVolume { - - /** - * Constructs a new Volume. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IVolume); - - /** Volume name. */ - public name: string; - - /** Volume secret. */ - public secret?: (google.cloud.run.v2.ISecretVolumeSource|null); - - /** Volume cloudSqlInstance. */ - public cloudSqlInstance?: (google.cloud.run.v2.ICloudSqlInstance|null); - - /** Volume emptyDir. */ - public emptyDir?: (google.cloud.run.v2.IEmptyDirVolumeSource|null); - - /** Volume nfs. */ - public nfs?: (google.cloud.run.v2.INFSVolumeSource|null); - - /** Volume gcs. */ - public gcs?: (google.cloud.run.v2.IGCSVolumeSource|null); - - /** Volume volumeType. */ - public volumeType?: ("secret"|"cloudSqlInstance"|"emptyDir"|"nfs"|"gcs"); - - /** - * Creates a new Volume instance using the specified properties. - * @param [properties] Properties to set - * @returns Volume instance - */ - public static create(properties?: google.cloud.run.v2.IVolume): google.cloud.run.v2.Volume; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 SecretVolumeSource. */ - interface ISecretVolumeSource { - - /** SecretVolumeSource secret */ - secret?: (string|null); - - /** SecretVolumeSource items */ - items?: (google.cloud.run.v2.IVersionToPath[]|null); - - /** SecretVolumeSource defaultMode */ - defaultMode?: (number|null); - } - - /** Represents a SecretVolumeSource. */ - class SecretVolumeSource implements ISecretVolumeSource { - - /** - * Constructs a new SecretVolumeSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ISecretVolumeSource); - - /** SecretVolumeSource secret. */ - public secret: string; - - /** SecretVolumeSource items. */ - public items: google.cloud.run.v2.IVersionToPath[]; - - /** SecretVolumeSource defaultMode. */ - public defaultMode: number; - - /** - * Creates a new SecretVolumeSource instance using the specified properties. - * @param [properties] Properties to set - * @returns SecretVolumeSource instance - */ - public static create(properties?: google.cloud.run.v2.ISecretVolumeSource): google.cloud.run.v2.SecretVolumeSource; - - /** - * Encodes the specified SecretVolumeSource message. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. - * @param message SecretVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ISecretVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecretVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. - * @param message SecretVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ISecretVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecretVolumeSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecretVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SecretVolumeSource; - - /** - * Decodes a SecretVolumeSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecretVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SecretVolumeSource; - - /** - * Verifies a SecretVolumeSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecretVolumeSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecretVolumeSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SecretVolumeSource; - - /** - * Creates a plain object from a SecretVolumeSource message. Also converts values to other types if specified. - * @param message SecretVolumeSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SecretVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecretVolumeSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecretVolumeSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a VersionToPath. */ - interface IVersionToPath { - - /** VersionToPath path */ - path?: (string|null); - - /** VersionToPath version */ - version?: (string|null); - - /** VersionToPath mode */ - mode?: (number|null); - } - - /** Represents a VersionToPath. */ - class VersionToPath implements IVersionToPath { - - /** - * Constructs a new VersionToPath. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IVersionToPath); - - /** VersionToPath path. */ - public path: string; - - /** VersionToPath version. */ - public version: string; - - /** VersionToPath mode. */ - public mode: number; - - /** - * Creates a new VersionToPath instance using the specified properties. - * @param [properties] Properties to set - * @returns VersionToPath instance - */ - public static create(properties?: google.cloud.run.v2.IVersionToPath): google.cloud.run.v2.VersionToPath; - - /** - * Encodes the specified VersionToPath message. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. - * @param message VersionToPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IVersionToPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VersionToPath message, length delimited. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. - * @param message VersionToPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IVersionToPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VersionToPath message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VersionToPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.VersionToPath; - - /** - * Decodes a VersionToPath message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VersionToPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.VersionToPath; - - /** - * Verifies a VersionToPath message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VersionToPath message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VersionToPath - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.VersionToPath; - - /** - * Creates a plain object from a VersionToPath message. Also converts values to other types if specified. - * @param message VersionToPath - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.VersionToPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VersionToPath to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VersionToPath - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudSqlInstance. */ - interface ICloudSqlInstance { - - /** CloudSqlInstance instances */ - instances?: (string[]|null); - } - - /** Represents a CloudSqlInstance. */ - class CloudSqlInstance implements ICloudSqlInstance { - - /** - * Constructs a new CloudSqlInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICloudSqlInstance); - - /** CloudSqlInstance instances. */ - public instances: string[]; - - /** - * Creates a new CloudSqlInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSqlInstance instance - */ - public static create(properties?: google.cloud.run.v2.ICloudSqlInstance): google.cloud.run.v2.CloudSqlInstance; - - /** - * Encodes the specified CloudSqlInstance message. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. - * @param message CloudSqlInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICloudSqlInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudSqlInstance message, length delimited. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. - * @param message CloudSqlInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICloudSqlInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudSqlInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudSqlInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CloudSqlInstance; - - /** - * Decodes a CloudSqlInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudSqlInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CloudSqlInstance; - - /** - * Verifies a CloudSqlInstance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudSqlInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudSqlInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CloudSqlInstance; - - /** - * Creates a plain object from a CloudSqlInstance message. Also converts values to other types if specified. - * @param message CloudSqlInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.CloudSqlInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudSqlInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudSqlInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EmptyDirVolumeSource. */ - interface IEmptyDirVolumeSource { - - /** EmptyDirVolumeSource medium */ - medium?: (google.cloud.run.v2.EmptyDirVolumeSource.Medium|keyof typeof google.cloud.run.v2.EmptyDirVolumeSource.Medium|null); - - /** EmptyDirVolumeSource sizeLimit */ - sizeLimit?: (string|null); - } - - /** Represents an EmptyDirVolumeSource. */ - class EmptyDirVolumeSource implements IEmptyDirVolumeSource { - - /** - * Constructs a new EmptyDirVolumeSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IEmptyDirVolumeSource); - - /** EmptyDirVolumeSource medium. */ - public medium: (google.cloud.run.v2.EmptyDirVolumeSource.Medium|keyof typeof google.cloud.run.v2.EmptyDirVolumeSource.Medium); - - /** EmptyDirVolumeSource sizeLimit. */ - public sizeLimit: string; - - /** - * Creates a new EmptyDirVolumeSource instance using the specified properties. - * @param [properties] Properties to set - * @returns EmptyDirVolumeSource instance - */ - public static create(properties?: google.cloud.run.v2.IEmptyDirVolumeSource): google.cloud.run.v2.EmptyDirVolumeSource; - - /** - * Encodes the specified EmptyDirVolumeSource message. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. - * @param message EmptyDirVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IEmptyDirVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EmptyDirVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. - * @param message EmptyDirVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IEmptyDirVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EmptyDirVolumeSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EmptyDirVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.EmptyDirVolumeSource; - - /** - * Decodes an EmptyDirVolumeSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EmptyDirVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.EmptyDirVolumeSource; - - /** - * Verifies an EmptyDirVolumeSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EmptyDirVolumeSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EmptyDirVolumeSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.EmptyDirVolumeSource; - - /** - * Creates a plain object from an EmptyDirVolumeSource message. Also converts values to other types if specified. - * @param message EmptyDirVolumeSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.EmptyDirVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EmptyDirVolumeSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EmptyDirVolumeSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EmptyDirVolumeSource { - - /** Medium enum. */ - enum Medium { - MEDIUM_UNSPECIFIED = 0, - MEMORY = 1 - } - } - - /** Properties of a NFSVolumeSource. */ - interface INFSVolumeSource { - - /** NFSVolumeSource server */ - server?: (string|null); - - /** NFSVolumeSource path */ - path?: (string|null); - - /** NFSVolumeSource readOnly */ - readOnly?: (boolean|null); - } - - /** Represents a NFSVolumeSource. */ - class NFSVolumeSource implements INFSVolumeSource { - - /** - * Constructs a new NFSVolumeSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.INFSVolumeSource); - - /** NFSVolumeSource server. */ - public server: string; - - /** NFSVolumeSource path. */ - public path: string; - - /** NFSVolumeSource readOnly. */ - public readOnly: boolean; - - /** - * Creates a new NFSVolumeSource instance using the specified properties. - * @param [properties] Properties to set - * @returns NFSVolumeSource instance - */ - public static create(properties?: google.cloud.run.v2.INFSVolumeSource): google.cloud.run.v2.NFSVolumeSource; - - /** - * Encodes the specified NFSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. - * @param message NFSVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.INFSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NFSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. - * @param message NFSVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.INFSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NFSVolumeSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NFSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.NFSVolumeSource; - - /** - * Decodes a NFSVolumeSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NFSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.NFSVolumeSource; - - /** - * Verifies a NFSVolumeSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NFSVolumeSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NFSVolumeSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.NFSVolumeSource; - - /** - * Creates a plain object from a NFSVolumeSource message. Also converts values to other types if specified. - * @param message NFSVolumeSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.NFSVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NFSVolumeSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NFSVolumeSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GCSVolumeSource. */ - interface IGCSVolumeSource { - - /** GCSVolumeSource bucket */ - bucket?: (string|null); - - /** GCSVolumeSource readOnly */ - readOnly?: (boolean|null); - - /** GCSVolumeSource mountOptions */ - mountOptions?: (string[]|null); - } - - /** Represents a GCSVolumeSource. */ - class GCSVolumeSource implements IGCSVolumeSource { - - /** - * Constructs a new GCSVolumeSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGCSVolumeSource); - - /** GCSVolumeSource bucket. */ - public bucket: string; - - /** GCSVolumeSource readOnly. */ - public readOnly: boolean; - - /** GCSVolumeSource mountOptions. */ - public mountOptions: string[]; - - /** - * Creates a new GCSVolumeSource instance using the specified properties. - * @param [properties] Properties to set - * @returns GCSVolumeSource instance - */ - public static create(properties?: google.cloud.run.v2.IGCSVolumeSource): google.cloud.run.v2.GCSVolumeSource; - - /** - * Encodes the specified GCSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. - * @param message GCSVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGCSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. - * @param message GCSVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGCSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCSVolumeSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GCSVolumeSource; - - /** - * Decodes a GCSVolumeSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GCSVolumeSource; - - /** - * Verifies a GCSVolumeSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCSVolumeSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCSVolumeSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GCSVolumeSource; - - /** - * Creates a plain object from a GCSVolumeSource message. Also converts values to other types if specified. - * @param message GCSVolumeSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GCSVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCSVolumeSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCSVolumeSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Probe. */ - interface IProbe { - - /** Probe initialDelaySeconds */ - initialDelaySeconds?: (number|null); - - /** Probe timeoutSeconds */ - timeoutSeconds?: (number|null); - - /** Probe periodSeconds */ - periodSeconds?: (number|null); - - /** Probe failureThreshold */ - failureThreshold?: (number|null); - - /** Probe httpGet */ - httpGet?: (google.cloud.run.v2.IHTTPGetAction|null); - - /** Probe tcpSocket */ - tcpSocket?: (google.cloud.run.v2.ITCPSocketAction|null); - - /** Probe grpc */ - grpc?: (google.cloud.run.v2.IGRPCAction|null); - } - - /** Represents a Probe. */ - class Probe implements IProbe { - - /** - * Constructs a new Probe. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IProbe); - - /** Probe initialDelaySeconds. */ - public initialDelaySeconds: number; - - /** Probe timeoutSeconds. */ - public timeoutSeconds: number; - - /** Probe periodSeconds. */ - public periodSeconds: number; - - /** Probe failureThreshold. */ - public failureThreshold: number; - - /** Probe httpGet. */ - public httpGet?: (google.cloud.run.v2.IHTTPGetAction|null); - - /** Probe tcpSocket. */ - public tcpSocket?: (google.cloud.run.v2.ITCPSocketAction|null); - - /** Probe grpc. */ - public grpc?: (google.cloud.run.v2.IGRPCAction|null); - - /** Probe probeType. */ - public probeType?: ("httpGet"|"tcpSocket"|"grpc"); - - /** - * Creates a new Probe instance using the specified properties. - * @param [properties] Properties to set - * @returns Probe instance - */ - public static create(properties?: google.cloud.run.v2.IProbe): google.cloud.run.v2.Probe; - - /** - * Encodes the specified Probe message. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. - * @param message Probe message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IProbe, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Probe message, length delimited. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. - * @param message Probe message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IProbe, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Probe message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Probe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Probe; - - /** - * Decodes a Probe message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Probe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Probe; - - /** - * Verifies a Probe message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Probe message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Probe - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Probe; - - /** - * Creates a plain object from a Probe message. Also converts values to other types if specified. - * @param message Probe - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Probe, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Probe to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Probe - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HTTPGetAction. */ - interface IHTTPGetAction { - - /** HTTPGetAction path */ - path?: (string|null); - - /** HTTPGetAction httpHeaders */ - httpHeaders?: (google.cloud.run.v2.IHTTPHeader[]|null); - - /** HTTPGetAction port */ - port?: (number|null); - } - - /** Represents a HTTPGetAction. */ - class HTTPGetAction implements IHTTPGetAction { - - /** - * Constructs a new HTTPGetAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IHTTPGetAction); - - /** HTTPGetAction path. */ - public path: string; - - /** HTTPGetAction httpHeaders. */ - public httpHeaders: google.cloud.run.v2.IHTTPHeader[]; - - /** HTTPGetAction port. */ - public port: number; - - /** - * Creates a new HTTPGetAction instance using the specified properties. - * @param [properties] Properties to set - * @returns HTTPGetAction instance - */ - public static create(properties?: google.cloud.run.v2.IHTTPGetAction): google.cloud.run.v2.HTTPGetAction; - - /** - * Encodes the specified HTTPGetAction message. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. - * @param message HTTPGetAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IHTTPGetAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HTTPGetAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. - * @param message HTTPGetAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IHTTPGetAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HTTPGetAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HTTPGetAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.HTTPGetAction; - - /** - * Decodes a HTTPGetAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HTTPGetAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.HTTPGetAction; - - /** - * Verifies a HTTPGetAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HTTPGetAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HTTPGetAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.HTTPGetAction; - - /** - * Creates a plain object from a HTTPGetAction message. Also converts values to other types if specified. - * @param message HTTPGetAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.HTTPGetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HTTPGetAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HTTPGetAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HTTPHeader. */ - interface IHTTPHeader { - - /** HTTPHeader name */ - name?: (string|null); - - /** HTTPHeader value */ - value?: (string|null); - } - - /** Represents a HTTPHeader. */ - class HTTPHeader implements IHTTPHeader { - - /** - * Constructs a new HTTPHeader. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IHTTPHeader); - - /** HTTPHeader name. */ - public name: string; - - /** HTTPHeader value. */ - public value: string; - - /** - * Creates a new HTTPHeader instance using the specified properties. - * @param [properties] Properties to set - * @returns HTTPHeader instance - */ - public static create(properties?: google.cloud.run.v2.IHTTPHeader): google.cloud.run.v2.HTTPHeader; - - /** - * Encodes the specified HTTPHeader message. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. - * @param message HTTPHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IHTTPHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HTTPHeader message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. - * @param message HTTPHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IHTTPHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HTTPHeader message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HTTPHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.HTTPHeader; - - /** - * Decodes a HTTPHeader message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HTTPHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.HTTPHeader; - - /** - * Verifies a HTTPHeader message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HTTPHeader message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HTTPHeader - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.HTTPHeader; - - /** - * Creates a plain object from a HTTPHeader message. Also converts values to other types if specified. - * @param message HTTPHeader - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.HTTPHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HTTPHeader to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HTTPHeader - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TCPSocketAction. */ - interface ITCPSocketAction { - - /** TCPSocketAction port */ - port?: (number|null); - } - - /** Represents a TCPSocketAction. */ - class TCPSocketAction implements ITCPSocketAction { - - /** - * Constructs a new TCPSocketAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITCPSocketAction); - - /** TCPSocketAction port. */ - public port: number; - - /** - * Creates a new TCPSocketAction instance using the specified properties. - * @param [properties] Properties to set - * @returns TCPSocketAction instance - */ - public static create(properties?: google.cloud.run.v2.ITCPSocketAction): google.cloud.run.v2.TCPSocketAction; - - /** - * Encodes the specified TCPSocketAction message. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. - * @param message TCPSocketAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ITCPSocketAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TCPSocketAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. - * @param message TCPSocketAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ITCPSocketAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TCPSocketAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TCPSocketAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TCPSocketAction; - - /** - * Decodes a TCPSocketAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TCPSocketAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TCPSocketAction; - - /** - * Verifies a TCPSocketAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TCPSocketAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TCPSocketAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TCPSocketAction; - - /** - * Creates a plain object from a TCPSocketAction message. Also converts values to other types if specified. - * @param message TCPSocketAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.TCPSocketAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TCPSocketAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TCPSocketAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GRPCAction. */ - interface IGRPCAction { - - /** GRPCAction port */ - port?: (number|null); - - /** GRPCAction service */ - service?: (string|null); - } - - /** Represents a GRPCAction. */ - class GRPCAction implements IGRPCAction { - - /** - * Constructs a new GRPCAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGRPCAction); - - /** GRPCAction port. */ - public port: number; - - /** GRPCAction service. */ - public service: string; - - /** - * Creates a new GRPCAction instance using the specified properties. - * @param [properties] Properties to set - * @returns GRPCAction instance - */ - public static create(properties?: google.cloud.run.v2.IGRPCAction): google.cloud.run.v2.GRPCAction; - - /** - * Encodes the specified GRPCAction message. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. - * @param message GRPCAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGRPCAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GRPCAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. - * @param message GRPCAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGRPCAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GRPCAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GRPCAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GRPCAction; - - /** - * Decodes a GRPCAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GRPCAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GRPCAction; - - /** - * Verifies a GRPCAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GRPCAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GRPCAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GRPCAction; - - /** - * Creates a plain object from a GRPCAction message. Also converts values to other types if specified. - * @param message GRPCAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GRPCAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GRPCAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GRPCAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BuildInfo. */ - interface IBuildInfo { - - /** BuildInfo functionTarget */ - functionTarget?: (string|null); - - /** BuildInfo sourceLocation */ - sourceLocation?: (string|null); - } - - /** Represents a BuildInfo. */ - class BuildInfo implements IBuildInfo { - - /** - * Constructs a new BuildInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IBuildInfo); - - /** BuildInfo functionTarget. */ - public functionTarget: string; - - /** BuildInfo sourceLocation. */ - public sourceLocation: string; - - /** - * Creates a new BuildInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns BuildInfo instance - */ - public static create(properties?: google.cloud.run.v2.IBuildInfo): google.cloud.run.v2.BuildInfo; - - /** - * Encodes the specified BuildInfo message. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. - * @param message BuildInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IBuildInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BuildInfo message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. - * @param message BuildInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IBuildInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BuildInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BuildInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.BuildInfo; - - /** - * Decodes a BuildInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BuildInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.BuildInfo; - - /** - * Verifies a BuildInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BuildInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BuildInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.BuildInfo; - - /** - * Creates a plain object from a BuildInfo message. Also converts values to other types if specified. - * @param message BuildInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.BuildInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BuildInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BuildInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SourceCode. */ - interface ISourceCode { - - /** SourceCode cloudStorageSource */ - cloudStorageSource?: (google.cloud.run.v2.SourceCode.ICloudStorageSource|null); - } - - /** Represents a SourceCode. */ - class SourceCode implements ISourceCode { - - /** - * Constructs a new SourceCode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ISourceCode); - - /** SourceCode cloudStorageSource. */ - public cloudStorageSource?: (google.cloud.run.v2.SourceCode.ICloudStorageSource|null); - - /** SourceCode sourceType. */ - public sourceType?: "cloudStorageSource"; - - /** - * Creates a new SourceCode instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCode instance - */ - public static create(properties?: google.cloud.run.v2.ISourceCode): google.cloud.run.v2.SourceCode; - - /** - * Encodes the specified SourceCode message. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. - * @param message SourceCode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ISourceCode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCode message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. - * @param message SourceCode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ISourceCode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SourceCode; - - /** - * Decodes a SourceCode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SourceCode; - - /** - * Verifies a SourceCode message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SourceCode; - - /** - * Creates a plain object from a SourceCode message. Also converts values to other types if specified. - * @param message SourceCode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SourceCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCode { - - /** Properties of a CloudStorageSource. */ - interface ICloudStorageSource { - - /** CloudStorageSource bucket */ - bucket?: (string|null); - - /** CloudStorageSource object */ - object?: (string|null); - - /** CloudStorageSource generation */ - generation?: (number|Long|string|null); - } - - /** Represents a CloudStorageSource. */ - class CloudStorageSource implements ICloudStorageSource { - - /** - * Constructs a new CloudStorageSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.SourceCode.ICloudStorageSource); - - /** CloudStorageSource bucket. */ - public bucket: string; - - /** CloudStorageSource object. */ - public object: string; - - /** CloudStorageSource generation. */ - public generation: (number|Long|string); - - /** - * Creates a new CloudStorageSource instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudStorageSource instance - */ - public static create(properties?: google.cloud.run.v2.SourceCode.ICloudStorageSource): google.cloud.run.v2.SourceCode.CloudStorageSource; - - /** - * Encodes the specified CloudStorageSource message. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. - * @param message CloudStorageSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.SourceCode.ICloudStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudStorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. - * @param message CloudStorageSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.SourceCode.ICloudStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudStorageSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudStorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SourceCode.CloudStorageSource; - - /** - * Decodes a CloudStorageSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudStorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SourceCode.CloudStorageSource; - - /** - * Verifies a CloudStorageSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudStorageSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudStorageSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SourceCode.CloudStorageSource; - - /** - * Creates a plain object from a CloudStorageSource message. Also converts values to other types if specified. - * @param message CloudStorageSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SourceCode.CloudStorageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudStorageSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudStorageSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a VpcAccess. */ - interface IVpcAccess { - - /** VpcAccess connector */ - connector?: (string|null); - - /** VpcAccess egress */ - egress?: (google.cloud.run.v2.VpcAccess.VpcEgress|keyof typeof google.cloud.run.v2.VpcAccess.VpcEgress|null); - - /** VpcAccess networkInterfaces */ - networkInterfaces?: (google.cloud.run.v2.VpcAccess.INetworkInterface[]|null); - } - - /** Represents a VpcAccess. */ - class VpcAccess implements IVpcAccess { - - /** - * Constructs a new VpcAccess. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IVpcAccess); - - /** VpcAccess connector. */ - public connector: string; - - /** VpcAccess egress. */ - public egress: (google.cloud.run.v2.VpcAccess.VpcEgress|keyof typeof google.cloud.run.v2.VpcAccess.VpcEgress); - - /** VpcAccess networkInterfaces. */ - public networkInterfaces: google.cloud.run.v2.VpcAccess.INetworkInterface[]; - - /** - * Creates a new VpcAccess instance using the specified properties. - * @param [properties] Properties to set - * @returns VpcAccess instance - */ - public static create(properties?: google.cloud.run.v2.IVpcAccess): google.cloud.run.v2.VpcAccess; - - /** - * Encodes the specified VpcAccess message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. - * @param message VpcAccess message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IVpcAccess, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VpcAccess message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. - * @param message VpcAccess message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IVpcAccess, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VpcAccess message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VpcAccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.VpcAccess; - - /** - * Decodes a VpcAccess message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VpcAccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.VpcAccess; - - /** - * Verifies a VpcAccess message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VpcAccess message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VpcAccess - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.VpcAccess; - - /** - * Creates a plain object from a VpcAccess message. Also converts values to other types if specified. - * @param message VpcAccess - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.VpcAccess, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VpcAccess to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VpcAccess - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace VpcAccess { - - /** VpcEgress enum. */ - enum VpcEgress { - VPC_EGRESS_UNSPECIFIED = 0, - ALL_TRAFFIC = 1, - PRIVATE_RANGES_ONLY = 2 - } - - /** Properties of a NetworkInterface. */ - interface INetworkInterface { - - /** NetworkInterface network */ - network?: (string|null); - - /** NetworkInterface subnetwork */ - subnetwork?: (string|null); - - /** NetworkInterface tags */ - tags?: (string[]|null); - } - - /** Represents a NetworkInterface. */ - class NetworkInterface implements INetworkInterface { - - /** - * Constructs a new NetworkInterface. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.VpcAccess.INetworkInterface); - - /** NetworkInterface network. */ - public network: string; - - /** NetworkInterface subnetwork. */ - public subnetwork: string; - - /** NetworkInterface tags. */ - public tags: string[]; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkInterface instance - */ - public static create(properties?: google.cloud.run.v2.VpcAccess.INetworkInterface): google.cloud.run.v2.VpcAccess.NetworkInterface; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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 BinaryAuthorization. */ - interface IBinaryAuthorization { - - /** BinaryAuthorization useDefault */ - useDefault?: (boolean|null); - - /** BinaryAuthorization policy */ - policy?: (string|null); - - /** BinaryAuthorization breakglassJustification */ - breakglassJustification?: (string|null); - } - - /** Represents a BinaryAuthorization. */ - class BinaryAuthorization implements IBinaryAuthorization { - - /** - * Constructs a new BinaryAuthorization. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IBinaryAuthorization); - - /** BinaryAuthorization useDefault. */ - public useDefault?: (boolean|null); - - /** BinaryAuthorization policy. */ - public policy?: (string|null); - - /** BinaryAuthorization breakglassJustification. */ - public breakglassJustification: string; - - /** BinaryAuthorization binauthzMethod. */ - public binauthzMethod?: ("useDefault"|"policy"); - - /** - * Creates a new BinaryAuthorization instance using the specified properties. - * @param [properties] Properties to set - * @returns BinaryAuthorization instance - */ - public static create(properties?: google.cloud.run.v2.IBinaryAuthorization): google.cloud.run.v2.BinaryAuthorization; - - /** - * Encodes the specified BinaryAuthorization message. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. - * @param message BinaryAuthorization message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IBinaryAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BinaryAuthorization message, length delimited. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. - * @param message BinaryAuthorization message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IBinaryAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BinaryAuthorization message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BinaryAuthorization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.BinaryAuthorization; - - /** - * Decodes a BinaryAuthorization message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BinaryAuthorization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.BinaryAuthorization; - - /** - * Verifies a BinaryAuthorization message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BinaryAuthorization message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BinaryAuthorization - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.BinaryAuthorization; - - /** - * Creates a plain object from a BinaryAuthorization message. Also converts values to other types if specified. - * @param message BinaryAuthorization - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.BinaryAuthorization, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BinaryAuthorization to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BinaryAuthorization - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RevisionScaling. */ - interface IRevisionScaling { - - /** RevisionScaling minInstanceCount */ - minInstanceCount?: (number|null); - - /** RevisionScaling maxInstanceCount */ - maxInstanceCount?: (number|null); - } - - /** Represents a RevisionScaling. */ - class RevisionScaling implements IRevisionScaling { - - /** - * Constructs a new RevisionScaling. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IRevisionScaling); - - /** RevisionScaling minInstanceCount. */ - public minInstanceCount: number; - - /** RevisionScaling maxInstanceCount. */ - public maxInstanceCount: number; - - /** - * Creates a new RevisionScaling instance using the specified properties. - * @param [properties] Properties to set - * @returns RevisionScaling instance - */ - public static create(properties?: google.cloud.run.v2.IRevisionScaling): google.cloud.run.v2.RevisionScaling; - - /** - * Encodes the specified RevisionScaling message. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. - * @param message RevisionScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IRevisionScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevisionScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. - * @param message RevisionScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IRevisionScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevisionScaling message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevisionScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RevisionScaling; - - /** - * Decodes a RevisionScaling message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevisionScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RevisionScaling; - - /** - * Verifies a RevisionScaling message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RevisionScaling message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevisionScaling - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RevisionScaling; - - /** - * Creates a plain object from a RevisionScaling message. Also converts values to other types if specified. - * @param message RevisionScaling - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RevisionScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevisionScaling to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevisionScaling - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceMesh. */ - interface IServiceMesh { - - /** ServiceMesh mesh */ - mesh?: (string|null); - } - - /** Represents a ServiceMesh. */ - class ServiceMesh implements IServiceMesh { - - /** - * Constructs a new ServiceMesh. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IServiceMesh); - - /** ServiceMesh mesh. */ - public mesh: string; - - /** - * Creates a new ServiceMesh instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceMesh instance - */ - public static create(properties?: google.cloud.run.v2.IServiceMesh): google.cloud.run.v2.ServiceMesh; - - /** - * Encodes the specified ServiceMesh message. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. - * @param message ServiceMesh message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IServiceMesh, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceMesh message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. - * @param message ServiceMesh message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IServiceMesh, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceMesh message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceMesh - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ServiceMesh; - - /** - * Decodes a ServiceMesh message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceMesh - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ServiceMesh; - - /** - * Verifies a ServiceMesh message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceMesh message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceMesh - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ServiceMesh; - - /** - * Creates a plain object from a ServiceMesh message. Also converts values to other types if specified. - * @param message ServiceMesh - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ServiceMesh, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceMesh to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceMesh - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceScaling. */ - interface IServiceScaling { - - /** ServiceScaling minInstanceCount */ - minInstanceCount?: (number|null); - - /** ServiceScaling scalingMode */ - scalingMode?: (google.cloud.run.v2.ServiceScaling.ScalingMode|keyof typeof google.cloud.run.v2.ServiceScaling.ScalingMode|null); - - /** ServiceScaling maxInstanceCount */ - maxInstanceCount?: (number|null); - - /** ServiceScaling manualInstanceCount */ - manualInstanceCount?: (number|null); - } - - /** Represents a ServiceScaling. */ - class ServiceScaling implements IServiceScaling { - - /** - * Constructs a new ServiceScaling. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IServiceScaling); - - /** ServiceScaling minInstanceCount. */ - public minInstanceCount: number; - - /** ServiceScaling scalingMode. */ - public scalingMode: (google.cloud.run.v2.ServiceScaling.ScalingMode|keyof typeof google.cloud.run.v2.ServiceScaling.ScalingMode); - - /** ServiceScaling maxInstanceCount. */ - public maxInstanceCount: number; - - /** ServiceScaling manualInstanceCount. */ - public manualInstanceCount?: (number|null); - - /** - * Creates a new ServiceScaling instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceScaling instance - */ - public static create(properties?: google.cloud.run.v2.IServiceScaling): google.cloud.run.v2.ServiceScaling; - - /** - * Encodes the specified ServiceScaling message. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. - * @param message ServiceScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IServiceScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. - * @param message ServiceScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IServiceScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceScaling message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ServiceScaling; - - /** - * Decodes a ServiceScaling message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ServiceScaling; - - /** - * Verifies a ServiceScaling message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceScaling message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceScaling - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ServiceScaling; - - /** - * Creates a plain object from a ServiceScaling message. Also converts values to other types if specified. - * @param message ServiceScaling - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ServiceScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceScaling to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceScaling - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ServiceScaling { - - /** ScalingMode enum. */ - enum ScalingMode { - SCALING_MODE_UNSPECIFIED = 0, - AUTOMATIC = 1, - MANUAL = 2 - } - } - - /** Properties of a WorkerPoolScaling. */ - interface IWorkerPoolScaling { - - /** WorkerPoolScaling manualInstanceCount */ - manualInstanceCount?: (number|null); - } - - /** Represents a WorkerPoolScaling. */ - class WorkerPoolScaling implements IWorkerPoolScaling { - - /** - * Constructs a new WorkerPoolScaling. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IWorkerPoolScaling); - - /** WorkerPoolScaling manualInstanceCount. */ - public manualInstanceCount?: (number|null); - - /** - * Creates a new WorkerPoolScaling instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkerPoolScaling instance - */ - public static create(properties?: google.cloud.run.v2.IWorkerPoolScaling): google.cloud.run.v2.WorkerPoolScaling; - - /** - * Encodes the specified WorkerPoolScaling message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. - * @param message WorkerPoolScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IWorkerPoolScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkerPoolScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. - * @param message WorkerPoolScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IWorkerPoolScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkerPoolScaling message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkerPoolScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.WorkerPoolScaling; - - /** - * Decodes a WorkerPoolScaling message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkerPoolScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.WorkerPoolScaling; - - /** - * Verifies a WorkerPoolScaling message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkerPoolScaling message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkerPoolScaling - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.WorkerPoolScaling; - - /** - * Creates a plain object from a WorkerPoolScaling message. Also converts values to other types if specified. - * @param message WorkerPoolScaling - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.WorkerPoolScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkerPoolScaling to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkerPoolScaling - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSelector. */ - interface INodeSelector { - - /** NodeSelector accelerator */ - accelerator?: (string|null); - } - - /** Represents a NodeSelector. */ - class NodeSelector implements INodeSelector { - - /** - * Constructs a new NodeSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.INodeSelector); - - /** NodeSelector accelerator. */ - public accelerator: string; - - /** - * Creates a new NodeSelector instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSelector instance - */ - public static create(properties?: google.cloud.run.v2.INodeSelector): google.cloud.run.v2.NodeSelector; - - /** - * Encodes the specified NodeSelector message. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. - * @param message NodeSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.INodeSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. - * @param message NodeSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.INodeSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.NodeSelector; - - /** - * Decodes a NodeSelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.NodeSelector; - - /** - * Verifies a NodeSelector message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.NodeSelector; - - /** - * Creates a plain object from a NodeSelector message. Also converts values to other types if specified. - * @param message NodeSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.NodeSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSelector - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BuildConfig. */ - interface IBuildConfig { - - /** BuildConfig name */ - name?: (string|null); - - /** BuildConfig sourceLocation */ - sourceLocation?: (string|null); - - /** BuildConfig functionTarget */ - functionTarget?: (string|null); - - /** BuildConfig imageUri */ - imageUri?: (string|null); - - /** BuildConfig baseImage */ - baseImage?: (string|null); - - /** BuildConfig enableAutomaticUpdates */ - enableAutomaticUpdates?: (boolean|null); - - /** BuildConfig workerPool */ - workerPool?: (string|null); - - /** BuildConfig environmentVariables */ - environmentVariables?: ({ [k: string]: string }|null); - - /** BuildConfig serviceAccount */ - serviceAccount?: (string|null); - } - - /** Represents a BuildConfig. */ - class BuildConfig implements IBuildConfig { - - /** - * Constructs a new BuildConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IBuildConfig); - - /** BuildConfig name. */ - public name: string; - - /** BuildConfig sourceLocation. */ - public sourceLocation: string; - - /** BuildConfig functionTarget. */ - public functionTarget: string; - - /** BuildConfig imageUri. */ - public imageUri: string; - - /** BuildConfig baseImage. */ - public baseImage: string; - - /** BuildConfig enableAutomaticUpdates. */ - public enableAutomaticUpdates: boolean; - - /** BuildConfig workerPool. */ - public workerPool: string; - - /** BuildConfig environmentVariables. */ - public environmentVariables: { [k: string]: string }; - - /** BuildConfig serviceAccount. */ - public serviceAccount: string; - - /** - * Creates a new BuildConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BuildConfig instance - */ - public static create(properties?: google.cloud.run.v2.IBuildConfig): google.cloud.run.v2.BuildConfig; - - /** - * Encodes the specified BuildConfig message. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. - * @param message BuildConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IBuildConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BuildConfig message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. - * @param message BuildConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IBuildConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BuildConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BuildConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.BuildConfig; - - /** - * Decodes a BuildConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BuildConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.BuildConfig; - - /** - * Verifies a BuildConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BuildConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BuildConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.BuildConfig; - - /** - * Creates a plain object from a BuildConfig message. Also converts values to other types if specified. - * @param message BuildConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.BuildConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BuildConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BuildConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** IngressTraffic enum. */ - enum IngressTraffic { - INGRESS_TRAFFIC_UNSPECIFIED = 0, - INGRESS_TRAFFIC_ALL = 1, - INGRESS_TRAFFIC_INTERNAL_ONLY = 2, - INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3, - INGRESS_TRAFFIC_NONE = 4 - } - - /** ExecutionEnvironment enum. */ - enum ExecutionEnvironment { - EXECUTION_ENVIRONMENT_UNSPECIFIED = 0, - EXECUTION_ENVIRONMENT_GEN1 = 1, - EXECUTION_ENVIRONMENT_GEN2 = 2 - } - - /** EncryptionKeyRevocationAction enum. */ - enum EncryptionKeyRevocationAction { - ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0, - PREVENT_NEW = 1, - SHUTDOWN = 2 - } - - /** Properties of an ExecutionTemplate. */ - interface IExecutionTemplate { - - /** ExecutionTemplate labels */ - labels?: ({ [k: string]: string }|null); - - /** ExecutionTemplate annotations */ - annotations?: ({ [k: string]: string }|null); - - /** ExecutionTemplate parallelism */ - parallelism?: (number|null); - - /** ExecutionTemplate taskCount */ - taskCount?: (number|null); - - /** ExecutionTemplate template */ - template?: (google.cloud.run.v2.ITaskTemplate|null); - } - - /** Represents an ExecutionTemplate. */ - class ExecutionTemplate implements IExecutionTemplate { - - /** - * Constructs a new ExecutionTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IExecutionTemplate); - - /** ExecutionTemplate labels. */ - public labels: { [k: string]: string }; - - /** ExecutionTemplate annotations. */ - public annotations: { [k: string]: string }; - - /** ExecutionTemplate parallelism. */ - public parallelism: number; - - /** ExecutionTemplate taskCount. */ - public taskCount: number; - - /** ExecutionTemplate template. */ - public template?: (google.cloud.run.v2.ITaskTemplate|null); - - /** - * Creates a new ExecutionTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecutionTemplate instance - */ - public static create(properties?: google.cloud.run.v2.IExecutionTemplate): google.cloud.run.v2.ExecutionTemplate; - - /** - * Encodes the specified ExecutionTemplate message. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. - * @param message ExecutionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IExecutionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecutionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. - * @param message ExecutionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IExecutionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecutionTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecutionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ExecutionTemplate; - - /** - * Decodes an ExecutionTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecutionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ExecutionTemplate; - - /** - * Verifies an ExecutionTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecutionTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecutionTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ExecutionTemplate; - - /** - * Creates a plain object from an ExecutionTemplate message. Also converts values to other types if specified. - * @param message ExecutionTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ExecutionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecutionTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecutionTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an Instances */ - class Instances extends $protobuf.rpc.Service { - - /** - * Constructs a new Instances 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 Instances 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): Instances; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createInstance(request: google.cloud.run.v2.ICreateInstanceRequest, callback: google.cloud.run.v2.Instances.CreateInstanceCallback): void; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @returns Promise - */ - public createInstance(request: google.cloud.run.v2.ICreateInstanceRequest): Promise; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteInstance(request: google.cloud.run.v2.IDeleteInstanceRequest, callback: google.cloud.run.v2.Instances.DeleteInstanceCallback): void; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @returns Promise - */ - public deleteInstance(request: google.cloud.run.v2.IDeleteInstanceRequest): Promise; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Instance - */ - public getInstance(request: google.cloud.run.v2.IGetInstanceRequest, callback: google.cloud.run.v2.Instances.GetInstanceCallback): void; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @returns Promise - */ - public getInstance(request: google.cloud.run.v2.IGetInstanceRequest): Promise; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancesResponse - */ - public listInstances(request: google.cloud.run.v2.IListInstancesRequest, callback: google.cloud.run.v2.Instances.ListInstancesCallback): void; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @returns Promise - */ - public listInstances(request: google.cloud.run.v2.IListInstancesRequest): Promise; - - /** - * Calls StopInstance. - * @param request StopInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public stopInstance(request: google.cloud.run.v2.IStopInstanceRequest, callback: google.cloud.run.v2.Instances.StopInstanceCallback): void; - - /** - * Calls StopInstance. - * @param request StopInstanceRequest message or plain object - * @returns Promise - */ - public stopInstance(request: google.cloud.run.v2.IStopInstanceRequest): Promise; - - /** - * Calls StartInstance. - * @param request StartInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public startInstance(request: google.cloud.run.v2.IStartInstanceRequest, callback: google.cloud.run.v2.Instances.StartInstanceCallback): void; - - /** - * Calls StartInstance. - * @param request StartInstanceRequest message or plain object - * @returns Promise - */ - public startInstance(request: google.cloud.run.v2.IStartInstanceRequest): Promise; - } - - namespace Instances { - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|createInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|deleteInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|getInstance}. - * @param error Error, if any - * @param [response] Instance - */ - type GetInstanceCallback = (error: (Error|null), response?: google.cloud.run.v2.Instance) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|listInstances}. - * @param error Error, if any - * @param [response] ListInstancesResponse - */ - type ListInstancesCallback = (error: (Error|null), response?: google.cloud.run.v2.ListInstancesResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|stopInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type StopInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|startInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type StartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { - - /** CreateInstanceRequest parent */ - parent?: (string|null); - - /** CreateInstanceRequest instance */ - instance?: (google.cloud.run.v2.IInstance|null); - - /** CreateInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { - - /** - * Constructs a new CreateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICreateInstanceRequest); - - /** CreateInstanceRequest parent. */ - public parent: string; - - /** CreateInstanceRequest instance. */ - public instance?: (google.cloud.run.v2.IInstance|null); - - /** CreateInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceRequest instance - */ - public static create(properties?: google.cloud.run.v2.ICreateInstanceRequest): google.cloud.run.v2.CreateInstanceRequest; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateInstanceRequest; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateInstanceRequest; - - /** - * Verifies a CreateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateInstanceRequest; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstanceRequest. */ - interface IGetInstanceRequest { - - /** GetInstanceRequest name */ - name?: (string|null); - } - - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { - - /** - * Constructs a new GetInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGetInstanceRequest); - - /** GetInstanceRequest name. */ - public name: string; - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstanceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IGetInstanceRequest): google.cloud.run.v2.GetInstanceRequest; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetInstanceRequest; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetInstanceRequest; - - /** - * Verifies a GetInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetInstanceRequest; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstanceRequest. */ - interface IDeleteInstanceRequest { - - /** DeleteInstanceRequest name */ - name?: (string|null); - - /** DeleteInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteInstanceRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteInstanceRequest. */ - class DeleteInstanceRequest implements IDeleteInstanceRequest { - - /** - * Constructs a new DeleteInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteInstanceRequest); - - /** DeleteInstanceRequest name. */ - public name: string; - - /** DeleteInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteInstanceRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstanceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteInstanceRequest): google.cloud.run.v2.DeleteInstanceRequest; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteInstanceRequest; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteInstanceRequest; - - /** - * Verifies a DeleteInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteInstanceRequest; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); - - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancesRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { - - /** - * Constructs a new ListInstancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; - - /** ListInstancesRequest pageSize. */ - public pageSize: number; - - /** ListInstancesRequest pageToken. */ - public pageToken: string; - - /** ListInstancesRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListInstancesRequest): google.cloud.run.v2.ListInstancesRequest; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListInstancesRequest; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListInstancesRequest; - - /** - * Verifies a ListInstancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListInstancesRequest; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { - - /** ListInstancesResponse instances */ - instances?: (google.cloud.run.v2.IInstance[]|null); - - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { - - /** - * Constructs a new ListInstancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListInstancesResponse); - - /** ListInstancesResponse instances. */ - public instances: google.cloud.run.v2.IInstance[]; - - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListInstancesResponse): google.cloud.run.v2.ListInstancesResponse; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListInstancesResponse; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListInstancesResponse; - - /** - * Verifies a ListInstancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListInstancesResponse; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StopInstanceRequest. */ - interface IStopInstanceRequest { - - /** StopInstanceRequest name */ - name?: (string|null); - - /** StopInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** StopInstanceRequest etag */ - etag?: (string|null); - } - - /** Represents a StopInstanceRequest. */ - class StopInstanceRequest implements IStopInstanceRequest { - - /** - * Constructs a new StopInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IStopInstanceRequest); - - /** StopInstanceRequest name. */ - public name: string; - - /** StopInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** StopInstanceRequest etag. */ - public etag: string; - - /** - * Creates a new StopInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns StopInstanceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IStopInstanceRequest): google.cloud.run.v2.StopInstanceRequest; - - /** - * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. - * @param message StopInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. - * @param message StopInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StopInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StopInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StopInstanceRequest; - - /** - * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StopInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StopInstanceRequest; - - /** - * Verifies a StopInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StopInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StopInstanceRequest; - - /** - * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. - * @param message StopInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.StopInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StopInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StopInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StartInstanceRequest. */ - interface IStartInstanceRequest { - - /** StartInstanceRequest name */ - name?: (string|null); - - /** StartInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** StartInstanceRequest etag */ - etag?: (string|null); - } - - /** Represents a StartInstanceRequest. */ - class StartInstanceRequest implements IStartInstanceRequest { - - /** - * Constructs a new StartInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IStartInstanceRequest); - - /** StartInstanceRequest name. */ - public name: string; - - /** StartInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** StartInstanceRequest etag. */ - public etag: string; - - /** - * Creates a new StartInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns StartInstanceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IStartInstanceRequest): google.cloud.run.v2.StartInstanceRequest; - - /** - * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. - * @param message StartInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. - * @param message StartInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StartInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StartInstanceRequest; - - /** - * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StartInstanceRequest; - - /** - * Verifies a StartInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StartInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StartInstanceRequest; - - /** - * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. - * @param message StartInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.StartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StartInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StartInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Instance. */ - interface IInstance { - - /** Instance name */ - name?: (string|null); - - /** Instance description */ - description?: (string|null); - - /** Instance uid */ - uid?: (string|null); - - /** Instance generation */ - generation?: (number|Long|string|null); - - /** Instance labels */ - labels?: ({ [k: string]: string }|null); - - /** Instance annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Instance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Instance expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Instance creator */ - creator?: (string|null); - - /** Instance lastModifier */ - lastModifier?: (string|null); - - /** Instance client */ - client?: (string|null); - - /** Instance clientVersion */ - clientVersion?: (string|null); - - /** Instance launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** Instance binaryAuthorization */ - binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Instance vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Instance serviceAccount */ - serviceAccount?: (string|null); - - /** Instance containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** Instance volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** Instance encryptionKey */ - encryptionKey?: (string|null); - - /** Instance encryptionKeyRevocationAction */ - encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); - - /** Instance encryptionKeyShutdownDuration */ - encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** Instance nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Instance gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - - /** Instance ingress */ - ingress?: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic|null); - - /** Instance invokerIamDisabled */ - invokerIamDisabled?: (boolean|null); - - /** Instance iapEnabled */ - iapEnabled?: (boolean|null); - - /** Instance observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Instance logUri */ - logUri?: (string|null); - - /** Instance terminalCondition */ - terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Instance conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Instance containerStatuses */ - containerStatuses?: (google.cloud.run.v2.IContainerStatus[]|null); - - /** Instance satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Instance urls */ - urls?: (string[]|null); - - /** Instance reconciling */ - reconciling?: (boolean|null); - - /** Instance etag */ - etag?: (string|null); - } - - /** Represents an Instance. */ - class Instance implements IInstance { - - /** - * Constructs a new Instance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IInstance); - - /** Instance name. */ - public name: string; - - /** Instance description. */ - public description: string; - - /** Instance uid. */ - public uid: string; - - /** Instance generation. */ - public generation: (number|Long|string); - - /** Instance labels. */ - public labels: { [k: string]: string }; - - /** Instance annotations. */ - public annotations: { [k: string]: string }; - - /** Instance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Instance expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Instance creator. */ - public creator: string; - - /** Instance lastModifier. */ - public lastModifier: string; - - /** Instance client. */ - public client: string; - - /** Instance clientVersion. */ - public clientVersion: string; - - /** Instance launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** Instance binaryAuthorization. */ - public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Instance vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Instance serviceAccount. */ - public serviceAccount: string; - - /** Instance containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** Instance volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** Instance encryptionKey. */ - public encryptionKey: string; - - /** Instance encryptionKeyRevocationAction. */ - public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); - - /** Instance encryptionKeyShutdownDuration. */ - public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** Instance nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Instance gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** Instance ingress. */ - public ingress: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic); - - /** Instance invokerIamDisabled. */ - public invokerIamDisabled: boolean; - - /** Instance iapEnabled. */ - public iapEnabled: boolean; - - /** Instance observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Instance logUri. */ - public logUri: string; - - /** Instance terminalCondition. */ - public terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Instance conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Instance containerStatuses. */ - public containerStatuses: google.cloud.run.v2.IContainerStatus[]; - - /** Instance satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Instance urls. */ - public urls: string[]; - - /** Instance reconciling. */ - public reconciling: boolean; - - /** Instance etag. */ - public etag: string; - - /** - * Creates a new Instance instance using the specified properties. - * @param [properties] Properties to set - * @returns Instance instance - */ - public static create(properties?: google.cloud.run.v2.IInstance): google.cloud.run.v2.Instance; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Instance; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Instance; - - /** - * Verifies an Instance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Instance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Instance; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @param message Instance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Instance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Instance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceSplit. */ - interface IInstanceSplit { - - /** InstanceSplit type */ - type?: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType|null); - - /** InstanceSplit revision */ - revision?: (string|null); - - /** InstanceSplit percent */ - percent?: (number|null); - } - - /** Represents an InstanceSplit. */ - class InstanceSplit implements IInstanceSplit { - - /** - * Constructs a new InstanceSplit. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IInstanceSplit); - - /** InstanceSplit type. */ - public type: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType); - - /** InstanceSplit revision. */ - public revision: string; - - /** InstanceSplit percent. */ - public percent: number; - - /** - * Creates a new InstanceSplit instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceSplit instance - */ - public static create(properties?: google.cloud.run.v2.IInstanceSplit): google.cloud.run.v2.InstanceSplit; - - /** - * Encodes the specified InstanceSplit message. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. - * @param message InstanceSplit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IInstanceSplit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceSplit message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. - * @param message InstanceSplit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IInstanceSplit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceSplit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceSplit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.InstanceSplit; - - /** - * Decodes an InstanceSplit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceSplit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.InstanceSplit; - - /** - * Verifies an InstanceSplit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceSplit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceSplit - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.InstanceSplit; - - /** - * Creates a plain object from an InstanceSplit message. Also converts values to other types if specified. - * @param message InstanceSplit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.InstanceSplit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceSplit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceSplit - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceSplitStatus. */ - interface IInstanceSplitStatus { - - /** InstanceSplitStatus type */ - type?: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType|null); - - /** InstanceSplitStatus revision */ - revision?: (string|null); - - /** InstanceSplitStatus percent */ - percent?: (number|null); - } - - /** Represents an InstanceSplitStatus. */ - class InstanceSplitStatus implements IInstanceSplitStatus { - - /** - * Constructs a new InstanceSplitStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IInstanceSplitStatus); - - /** InstanceSplitStatus type. */ - public type: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType); - - /** InstanceSplitStatus revision. */ - public revision: string; - - /** InstanceSplitStatus percent. */ - public percent: number; - - /** - * Creates a new InstanceSplitStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceSplitStatus instance - */ - public static create(properties?: google.cloud.run.v2.IInstanceSplitStatus): google.cloud.run.v2.InstanceSplitStatus; - - /** - * Encodes the specified InstanceSplitStatus message. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. - * @param message InstanceSplitStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IInstanceSplitStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceSplitStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. - * @param message InstanceSplitStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IInstanceSplitStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceSplitStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceSplitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.InstanceSplitStatus; - - /** - * Decodes an InstanceSplitStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceSplitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.InstanceSplitStatus; - - /** - * Verifies an InstanceSplitStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceSplitStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceSplitStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.InstanceSplitStatus; - - /** - * Creates a plain object from an InstanceSplitStatus message. Also converts values to other types if specified. - * @param message InstanceSplitStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.InstanceSplitStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceSplitStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceSplitStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** InstanceSplitAllocationType enum. */ - enum InstanceSplitAllocationType { - INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED = 0, - INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST = 1, - INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION = 2 - } - - /** Represents a Jobs */ - class Jobs extends $protobuf.rpc.Service { - - /** - * Constructs a new Jobs 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 Jobs 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): Jobs; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createJob(request: google.cloud.run.v2.ICreateJobRequest, callback: google.cloud.run.v2.Jobs.CreateJobCallback): void; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @returns Promise - */ - public createJob(request: google.cloud.run.v2.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.run.v2.IGetJobRequest, callback: google.cloud.run.v2.Jobs.GetJobCallback): void; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @returns Promise - */ - public getJob(request: google.cloud.run.v2.IGetJobRequest): 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.run.v2.IListJobsRequest, callback: google.cloud.run.v2.Jobs.ListJobsCallback): void; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @returns Promise - */ - public listJobs(request: google.cloud.run.v2.IListJobsRequest): Promise; - - /** - * Calls UpdateJob. - * @param request UpdateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateJob(request: google.cloud.run.v2.IUpdateJobRequest, callback: google.cloud.run.v2.Jobs.UpdateJobCallback): void; - - /** - * Calls UpdateJob. - * @param request UpdateJobRequest message or plain object - * @returns Promise - */ - public updateJob(request: google.cloud.run.v2.IUpdateJobRequest): 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.run.v2.IDeleteJobRequest, callback: google.cloud.run.v2.Jobs.DeleteJobCallback): void; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @returns Promise - */ - public deleteJob(request: google.cloud.run.v2.IDeleteJobRequest): Promise; - - /** - * Calls RunJob. - * @param request RunJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public runJob(request: google.cloud.run.v2.IRunJobRequest, callback: google.cloud.run.v2.Jobs.RunJobCallback): void; - - /** - * Calls RunJob. - * @param request RunJobRequest message or plain object - * @returns Promise - */ - public runJob(request: google.cloud.run.v2.IRunJobRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.run.v2.Jobs.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.run.v2.Jobs.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.run.v2.Jobs.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace Jobs { - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|createJob}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|getJob}. - * @param error Error, if any - * @param [response] Job - */ - type GetJobCallback = (error: (Error|null), response?: google.cloud.run.v2.Job) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|listJobs}. - * @param error Error, if any - * @param [response] ListJobsResponse - */ - type ListJobsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListJobsResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|updateJob}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|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.run.v2.Jobs|runJob}. - * @param error Error, if any - * @param [response] Operation - */ - type RunJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a CreateJobRequest. */ - interface ICreateJobRequest { - - /** CreateJobRequest parent */ - parent?: (string|null); - - /** CreateJobRequest job */ - job?: (google.cloud.run.v2.IJob|null); - - /** CreateJobRequest jobId */ - jobId?: (string|null); - - /** CreateJobRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateJobRequest. */ - class CreateJobRequest implements ICreateJobRequest { - - /** - * Constructs a new CreateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICreateJobRequest); - - /** CreateJobRequest parent. */ - public parent: string; - - /** CreateJobRequest job. */ - public job?: (google.cloud.run.v2.IJob|null); - - /** CreateJobRequest jobId. */ - public jobId: string; - - /** CreateJobRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateJobRequest instance - */ - public static create(properties?: google.cloud.run.v2.ICreateJobRequest): google.cloud.run.v2.CreateJobRequest; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.IGetJobRequest): google.cloud.run.v2.GetJobRequest; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 an UpdateJobRequest. */ - interface IUpdateJobRequest { - - /** UpdateJobRequest job */ - job?: (google.cloud.run.v2.IJob|null); - - /** UpdateJobRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateJobRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateJobRequest. */ - class UpdateJobRequest implements IUpdateJobRequest { - - /** - * Constructs a new UpdateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IUpdateJobRequest); - - /** UpdateJobRequest job. */ - public job?: (google.cloud.run.v2.IJob|null); - - /** UpdateJobRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateJobRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateJobRequest instance - */ - public static create(properties?: google.cloud.run.v2.IUpdateJobRequest): google.cloud.run.v2.UpdateJobRequest; - - /** - * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 pageSize */ - pageSize?: (number|null); - - /** ListJobsRequest pageToken */ - pageToken?: (string|null); - - /** ListJobsRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListJobsRequest. */ - class ListJobsRequest implements IListJobsRequest { - - /** - * Constructs a new ListJobsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListJobsRequest); - - /** ListJobsRequest parent. */ - public parent: string; - - /** ListJobsRequest pageSize. */ - public pageSize: number; - - /** ListJobsRequest pageToken. */ - public pageToken: string; - - /** ListJobsRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListJobsRequest): google.cloud.run.v2.ListJobsRequest; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.IJob[]|null); - - /** ListJobsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListJobsResponse. */ - class ListJobsResponse implements IListJobsResponse { - - /** - * Constructs a new ListJobsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListJobsResponse); - - /** ListJobsResponse jobs. */ - public jobs: google.cloud.run.v2.IJob[]; - - /** ListJobsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListJobsResponse): google.cloud.run.v2.ListJobsResponse; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 DeleteJobRequest. */ - interface IDeleteJobRequest { - - /** DeleteJobRequest name */ - name?: (string|null); - - /** DeleteJobRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteJobRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteJobRequest. */ - class DeleteJobRequest implements IDeleteJobRequest { - - /** - * Constructs a new DeleteJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteJobRequest); - - /** DeleteJobRequest name. */ - public name: string; - - /** DeleteJobRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteJobRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteJobRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteJobRequest): google.cloud.run.v2.DeleteJobRequest; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 RunJobRequest. */ - interface IRunJobRequest { - - /** RunJobRequest name */ - name?: (string|null); - - /** RunJobRequest validateOnly */ - validateOnly?: (boolean|null); - - /** RunJobRequest etag */ - etag?: (string|null); - - /** RunJobRequest overrides */ - overrides?: (google.cloud.run.v2.RunJobRequest.IOverrides|null); - } - - /** Represents a RunJobRequest. */ - class RunJobRequest implements IRunJobRequest { - - /** - * Constructs a new RunJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IRunJobRequest); - - /** RunJobRequest name. */ - public name: string; - - /** RunJobRequest validateOnly. */ - public validateOnly: boolean; - - /** RunJobRequest etag. */ - public etag: string; - - /** RunJobRequest overrides. */ - public overrides?: (google.cloud.run.v2.RunJobRequest.IOverrides|null); - - /** - * Creates a new RunJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunJobRequest instance - */ - public static create(properties?: google.cloud.run.v2.IRunJobRequest): google.cloud.run.v2.RunJobRequest; - - /** - * Encodes the specified RunJobRequest message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. - * @param message RunJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IRunJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. - * @param message RunJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IRunJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest; - - /** - * Decodes a RunJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest; - - /** - * Verifies a RunJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest; - - /** - * Creates a plain object from a RunJobRequest message. Also converts values to other types if specified. - * @param message RunJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RunJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RunJobRequest { - - /** Properties of an Overrides. */ - interface IOverrides { - - /** Overrides containerOverrides */ - containerOverrides?: (google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride[]|null); - - /** Overrides taskCount */ - taskCount?: (number|null); - - /** Overrides timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents an Overrides. */ - class Overrides implements IOverrides { - - /** - * Constructs a new Overrides. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.RunJobRequest.IOverrides); - - /** Overrides containerOverrides. */ - public containerOverrides: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride[]; - - /** Overrides taskCount. */ - public taskCount: number; - - /** Overrides timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new Overrides instance using the specified properties. - * @param [properties] Properties to set - * @returns Overrides instance - */ - public static create(properties?: google.cloud.run.v2.RunJobRequest.IOverrides): google.cloud.run.v2.RunJobRequest.Overrides; - - /** - * Encodes the specified Overrides message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. - * @param message Overrides message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.RunJobRequest.IOverrides, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Overrides message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. - * @param message Overrides message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.RunJobRequest.IOverrides, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Overrides message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Overrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest.Overrides; - - /** - * Decodes an Overrides message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Overrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest.Overrides; - - /** - * Verifies an Overrides message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Overrides message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Overrides - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest.Overrides; - - /** - * Creates a plain object from an Overrides message. Also converts values to other types if specified. - * @param message Overrides - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RunJobRequest.Overrides, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Overrides to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Overrides - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Overrides { - - /** Properties of a ContainerOverride. */ - interface IContainerOverride { - - /** ContainerOverride name */ - name?: (string|null); - - /** ContainerOverride args */ - args?: (string[]|null); - - /** ContainerOverride env */ - env?: (google.cloud.run.v2.IEnvVar[]|null); - - /** ContainerOverride clearArgs */ - clearArgs?: (boolean|null); - } - - /** Represents a ContainerOverride. */ - class ContainerOverride implements IContainerOverride { - - /** - * Constructs a new ContainerOverride. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride); - - /** ContainerOverride name. */ - public name: string; - - /** ContainerOverride args. */ - public args: string[]; - - /** ContainerOverride env. */ - public env: google.cloud.run.v2.IEnvVar[]; - - /** ContainerOverride clearArgs. */ - public clearArgs: boolean; - - /** - * Creates a new ContainerOverride instance using the specified properties. - * @param [properties] Properties to set - * @returns ContainerOverride instance - */ - public static create(properties?: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; - - /** - * Encodes the specified ContainerOverride message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. - * @param message ContainerOverride message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContainerOverride message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. - * @param message ContainerOverride message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContainerOverride message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContainerOverride - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; - - /** - * Decodes a ContainerOverride message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContainerOverride - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; - - /** - * Verifies a ContainerOverride message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContainerOverride message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContainerOverride - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; - - /** - * Creates a plain object from a ContainerOverride message. Also converts values to other types if specified. - * @param message ContainerOverride - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContainerOverride to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContainerOverride - * @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 generation */ - generation?: (number|Long|string|null); - - /** Job labels */ - labels?: ({ [k: string]: string }|null); - - /** Job annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Job createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Job deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Job expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Job creator */ - creator?: (string|null); - - /** Job lastModifier */ - lastModifier?: (string|null); - - /** Job client */ - client?: (string|null); - - /** Job clientVersion */ - clientVersion?: (string|null); - - /** Job launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** Job binaryAuthorization */ - binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Job template */ - template?: (google.cloud.run.v2.IExecutionTemplate|null); - - /** Job observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Job terminalCondition */ - terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Job conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Job executionCount */ - executionCount?: (number|null); - - /** Job latestCreatedExecution */ - latestCreatedExecution?: (google.cloud.run.v2.IExecutionReference|null); - - /** Job reconciling */ - reconciling?: (boolean|null); - - /** Job satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Job startExecutionToken */ - startExecutionToken?: (string|null); - - /** Job runExecutionToken */ - runExecutionToken?: (string|null); - - /** Job etag */ - etag?: (string|null); - } - - /** Represents a Job. */ - class Job implements IJob { - - /** - * Constructs a new Job. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IJob); - - /** Job name. */ - public name: string; - - /** Job uid. */ - public uid: string; - - /** Job generation. */ - public generation: (number|Long|string); - - /** Job labels. */ - public labels: { [k: string]: string }; - - /** Job annotations. */ - public annotations: { [k: string]: string }; - - /** Job createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Job deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Job expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Job creator. */ - public creator: string; - - /** Job lastModifier. */ - public lastModifier: string; - - /** Job client. */ - public client: string; - - /** Job clientVersion. */ - public clientVersion: string; - - /** Job launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** Job binaryAuthorization. */ - public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Job template. */ - public template?: (google.cloud.run.v2.IExecutionTemplate|null); - - /** Job observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Job terminalCondition. */ - public terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Job conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Job executionCount. */ - public executionCount: number; - - /** Job latestCreatedExecution. */ - public latestCreatedExecution?: (google.cloud.run.v2.IExecutionReference|null); - - /** Job reconciling. */ - public reconciling: boolean; - - /** Job satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Job startExecutionToken. */ - public startExecutionToken?: (string|null); - - /** Job runExecutionToken. */ - public runExecutionToken?: (string|null); - - /** Job etag. */ - public etag: string; - - /** Job createExecution. */ - public createExecution?: ("startExecutionToken"|"runExecutionToken"); - - /** - * Creates a new Job instance using the specified properties. - * @param [properties] Properties to set - * @returns Job instance - */ - public static create(properties?: google.cloud.run.v2.IJob): google.cloud.run.v2.Job; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 an ExecutionReference. */ - interface IExecutionReference { - - /** ExecutionReference name */ - name?: (string|null); - - /** ExecutionReference createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference completionTime */ - completionTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference completionStatus */ - completionStatus?: (google.cloud.run.v2.ExecutionReference.CompletionStatus|keyof typeof google.cloud.run.v2.ExecutionReference.CompletionStatus|null); - } - - /** Represents an ExecutionReference. */ - class ExecutionReference implements IExecutionReference { - - /** - * Constructs a new ExecutionReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IExecutionReference); - - /** ExecutionReference name. */ - public name: string; - - /** ExecutionReference createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference completionTime. */ - public completionTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference completionStatus. */ - public completionStatus: (google.cloud.run.v2.ExecutionReference.CompletionStatus|keyof typeof google.cloud.run.v2.ExecutionReference.CompletionStatus); - - /** - * Creates a new ExecutionReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecutionReference instance - */ - public static create(properties?: google.cloud.run.v2.IExecutionReference): google.cloud.run.v2.ExecutionReference; - - /** - * Encodes the specified ExecutionReference message. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. - * @param message ExecutionReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IExecutionReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecutionReference message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. - * @param message ExecutionReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IExecutionReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecutionReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecutionReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ExecutionReference; - - /** - * Decodes an ExecutionReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecutionReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ExecutionReference; - - /** - * Verifies an ExecutionReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecutionReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecutionReference - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ExecutionReference; - - /** - * Creates a plain object from an ExecutionReference message. Also converts values to other types if specified. - * @param message ExecutionReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ExecutionReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecutionReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecutionReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExecutionReference { - - /** CompletionStatus enum. */ - enum CompletionStatus { - COMPLETION_STATUS_UNSPECIFIED = 0, - EXECUTION_SUCCEEDED = 1, - EXECUTION_FAILED = 2, - EXECUTION_RUNNING = 3, - EXECUTION_PENDING = 4, - EXECUTION_CANCELLED = 5 - } - } - - /** Represents a Revisions */ - class Revisions extends $protobuf.rpc.Service { - - /** - * Constructs a new Revisions 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 Revisions 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): Revisions; - - /** - * Calls GetRevision. - * @param request GetRevisionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Revision - */ - public getRevision(request: google.cloud.run.v2.IGetRevisionRequest, callback: google.cloud.run.v2.Revisions.GetRevisionCallback): void; - - /** - * Calls GetRevision. - * @param request GetRevisionRequest message or plain object - * @returns Promise - */ - public getRevision(request: google.cloud.run.v2.IGetRevisionRequest): Promise; - - /** - * Calls ListRevisions. - * @param request ListRevisionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListRevisionsResponse - */ - public listRevisions(request: google.cloud.run.v2.IListRevisionsRequest, callback: google.cloud.run.v2.Revisions.ListRevisionsCallback): void; - - /** - * Calls ListRevisions. - * @param request ListRevisionsRequest message or plain object - * @returns Promise - */ - public listRevisions(request: google.cloud.run.v2.IListRevisionsRequest): Promise; - - /** - * Calls DeleteRevision. - * @param request DeleteRevisionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteRevision(request: google.cloud.run.v2.IDeleteRevisionRequest, callback: google.cloud.run.v2.Revisions.DeleteRevisionCallback): void; - - /** - * Calls DeleteRevision. - * @param request DeleteRevisionRequest message or plain object - * @returns Promise - */ - public deleteRevision(request: google.cloud.run.v2.IDeleteRevisionRequest): Promise; - } - - namespace Revisions { - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|getRevision}. - * @param error Error, if any - * @param [response] Revision - */ - type GetRevisionCallback = (error: (Error|null), response?: google.cloud.run.v2.Revision) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|listRevisions}. - * @param error Error, if any - * @param [response] ListRevisionsResponse - */ - type ListRevisionsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListRevisionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|deleteRevision}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteRevisionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a GetRevisionRequest. */ - interface IGetRevisionRequest { - - /** GetRevisionRequest name */ - name?: (string|null); - } - - /** Represents a GetRevisionRequest. */ - class GetRevisionRequest implements IGetRevisionRequest { - - /** - * Constructs a new GetRevisionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGetRevisionRequest); - - /** GetRevisionRequest name. */ - public name: string; - - /** - * Creates a new GetRevisionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetRevisionRequest instance - */ - public static create(properties?: google.cloud.run.v2.IGetRevisionRequest): google.cloud.run.v2.GetRevisionRequest; - - /** - * Encodes the specified GetRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. - * @param message GetRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGetRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. - * @param message GetRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGetRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetRevisionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetRevisionRequest; - - /** - * Decodes a GetRevisionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetRevisionRequest; - - /** - * Verifies a GetRevisionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetRevisionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetRevisionRequest; - - /** - * Creates a plain object from a GetRevisionRequest message. Also converts values to other types if specified. - * @param message GetRevisionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GetRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetRevisionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetRevisionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListRevisionsRequest. */ - interface IListRevisionsRequest { - - /** ListRevisionsRequest parent */ - parent?: (string|null); - - /** ListRevisionsRequest pageSize */ - pageSize?: (number|null); - - /** ListRevisionsRequest pageToken */ - pageToken?: (string|null); - - /** ListRevisionsRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListRevisionsRequest. */ - class ListRevisionsRequest implements IListRevisionsRequest { - - /** - * Constructs a new ListRevisionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListRevisionsRequest); - - /** ListRevisionsRequest parent. */ - public parent: string; - - /** ListRevisionsRequest pageSize. */ - public pageSize: number; - - /** ListRevisionsRequest pageToken. */ - public pageToken: string; - - /** ListRevisionsRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListRevisionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListRevisionsRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListRevisionsRequest): google.cloud.run.v2.ListRevisionsRequest; - - /** - * Encodes the specified ListRevisionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. - * @param message ListRevisionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. - * @param message ListRevisionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListRevisionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListRevisionsRequest; - - /** - * Decodes a ListRevisionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListRevisionsRequest; - - /** - * Verifies a ListRevisionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListRevisionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListRevisionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListRevisionsRequest; - - /** - * Creates a plain object from a ListRevisionsRequest message. Also converts values to other types if specified. - * @param message ListRevisionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListRevisionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListRevisionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListRevisionsResponse. */ - interface IListRevisionsResponse { - - /** ListRevisionsResponse revisions */ - revisions?: (google.cloud.run.v2.IRevision[]|null); - - /** ListRevisionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListRevisionsResponse. */ - class ListRevisionsResponse implements IListRevisionsResponse { - - /** - * Constructs a new ListRevisionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListRevisionsResponse); - - /** ListRevisionsResponse revisions. */ - public revisions: google.cloud.run.v2.IRevision[]; - - /** ListRevisionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListRevisionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListRevisionsResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListRevisionsResponse): google.cloud.run.v2.ListRevisionsResponse; - - /** - * Encodes the specified ListRevisionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. - * @param message ListRevisionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. - * @param message ListRevisionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListRevisionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListRevisionsResponse; - - /** - * Decodes a ListRevisionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListRevisionsResponse; - - /** - * Verifies a ListRevisionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListRevisionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListRevisionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListRevisionsResponse; - - /** - * Creates a plain object from a ListRevisionsResponse message. Also converts values to other types if specified. - * @param message ListRevisionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListRevisionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListRevisionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteRevisionRequest. */ - interface IDeleteRevisionRequest { - - /** DeleteRevisionRequest name */ - name?: (string|null); - - /** DeleteRevisionRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteRevisionRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteRevisionRequest. */ - class DeleteRevisionRequest implements IDeleteRevisionRequest { - - /** - * Constructs a new DeleteRevisionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteRevisionRequest); - - /** DeleteRevisionRequest name. */ - public name: string; - - /** DeleteRevisionRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteRevisionRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteRevisionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteRevisionRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteRevisionRequest): google.cloud.run.v2.DeleteRevisionRequest; - - /** - * Encodes the specified DeleteRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. - * @param message DeleteRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IDeleteRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. - * @param message DeleteRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IDeleteRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteRevisionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteRevisionRequest; - - /** - * Decodes a DeleteRevisionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteRevisionRequest; - - /** - * Verifies a DeleteRevisionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteRevisionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteRevisionRequest; - - /** - * Creates a plain object from a DeleteRevisionRequest message. Also converts values to other types if specified. - * @param message DeleteRevisionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.DeleteRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteRevisionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteRevisionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Revision. */ - interface IRevision { - - /** Revision name */ - name?: (string|null); - - /** Revision uid */ - uid?: (string|null); - - /** Revision generation */ - generation?: (number|Long|string|null); - - /** Revision labels */ - labels?: ({ [k: string]: string }|null); - - /** Revision annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Revision createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Revision updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Revision deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Revision expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Revision launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** Revision service */ - service?: (string|null); - - /** Revision scaling */ - scaling?: (google.cloud.run.v2.IRevisionScaling|null); - - /** Revision vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Revision maxInstanceRequestConcurrency */ - maxInstanceRequestConcurrency?: (number|null); - - /** Revision timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** Revision serviceAccount */ - serviceAccount?: (string|null); - - /** Revision containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** Revision volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** Revision executionEnvironment */ - executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); - - /** Revision encryptionKey */ - encryptionKey?: (string|null); - - /** Revision serviceMesh */ - serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** Revision encryptionKeyRevocationAction */ - encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); - - /** Revision encryptionKeyShutdownDuration */ - encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** Revision reconciling */ - reconciling?: (boolean|null); - - /** Revision conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Revision observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Revision logUri */ - logUri?: (string|null); - - /** Revision satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Revision sessionAffinity */ - sessionAffinity?: (boolean|null); - - /** Revision scalingStatus */ - scalingStatus?: (google.cloud.run.v2.IRevisionScalingStatus|null); - - /** Revision nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Revision gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - - /** Revision creator */ - creator?: (string|null); - - /** Revision etag */ - etag?: (string|null); - } - - /** Represents a Revision. */ - class Revision implements IRevision { - - /** - * Constructs a new Revision. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IRevision); - - /** Revision name. */ - public name: string; - - /** Revision uid. */ - public uid: string; - - /** Revision generation. */ - public generation: (number|Long|string); - - /** Revision labels. */ - public labels: { [k: string]: string }; - - /** Revision annotations. */ - public annotations: { [k: string]: string }; - - /** Revision createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Revision updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Revision deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Revision expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Revision launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** Revision service. */ - public service: string; - - /** Revision scaling. */ - public scaling?: (google.cloud.run.v2.IRevisionScaling|null); - - /** Revision vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Revision maxInstanceRequestConcurrency. */ - public maxInstanceRequestConcurrency: number; - - /** Revision timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** Revision serviceAccount. */ - public serviceAccount: string; - - /** Revision containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** Revision volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** Revision executionEnvironment. */ - public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); - - /** Revision encryptionKey. */ - public encryptionKey: string; - - /** Revision serviceMesh. */ - public serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** Revision encryptionKeyRevocationAction. */ - public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); - - /** Revision encryptionKeyShutdownDuration. */ - public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** Revision reconciling. */ - public reconciling: boolean; - - /** Revision conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Revision observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Revision logUri. */ - public logUri: string; - - /** Revision satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Revision sessionAffinity. */ - public sessionAffinity: boolean; - - /** Revision scalingStatus. */ - public scalingStatus?: (google.cloud.run.v2.IRevisionScalingStatus|null); - - /** Revision nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Revision gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** Revision creator. */ - public creator: string; - - /** Revision etag. */ - public etag: string; - - /** - * Creates a new Revision instance using the specified properties. - * @param [properties] Properties to set - * @returns Revision instance - */ - public static create(properties?: google.cloud.run.v2.IRevision): google.cloud.run.v2.Revision; - - /** - * Encodes the specified Revision message. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. - * @param message Revision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. - * @param message Revision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Revision message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Revision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Revision; - - /** - * Decodes a Revision message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Revision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Revision; - - /** - * Verifies a Revision message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Revision message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Revision - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Revision; - - /** - * Creates a plain object from a Revision message. Also converts values to other types if specified. - * @param message Revision - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Revision, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Revision to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Revision - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RevisionScalingStatus. */ - interface IRevisionScalingStatus { - - /** RevisionScalingStatus desiredMinInstanceCount */ - desiredMinInstanceCount?: (number|null); - } - - /** Represents a RevisionScalingStatus. */ - class RevisionScalingStatus implements IRevisionScalingStatus { - - /** - * Constructs a new RevisionScalingStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IRevisionScalingStatus); - - /** RevisionScalingStatus desiredMinInstanceCount. */ - public desiredMinInstanceCount: number; - - /** - * Creates a new RevisionScalingStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns RevisionScalingStatus instance - */ - public static create(properties?: google.cloud.run.v2.IRevisionScalingStatus): google.cloud.run.v2.RevisionScalingStatus; - - /** - * Encodes the specified RevisionScalingStatus message. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. - * @param message RevisionScalingStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IRevisionScalingStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevisionScalingStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. - * @param message RevisionScalingStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IRevisionScalingStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevisionScalingStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevisionScalingStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RevisionScalingStatus; - - /** - * Decodes a RevisionScalingStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevisionScalingStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RevisionScalingStatus; - - /** - * Verifies a RevisionScalingStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RevisionScalingStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevisionScalingStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RevisionScalingStatus; - - /** - * Creates a plain object from a RevisionScalingStatus message. Also converts values to other types if specified. - * @param message RevisionScalingStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RevisionScalingStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevisionScalingStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevisionScalingStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RevisionTemplate. */ - interface IRevisionTemplate { - - /** RevisionTemplate revision */ - revision?: (string|null); - - /** RevisionTemplate labels */ - labels?: ({ [k: string]: string }|null); - - /** RevisionTemplate annotations */ - annotations?: ({ [k: string]: string }|null); - - /** RevisionTemplate scaling */ - scaling?: (google.cloud.run.v2.IRevisionScaling|null); - - /** RevisionTemplate vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** RevisionTemplate timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** RevisionTemplate serviceAccount */ - serviceAccount?: (string|null); - - /** RevisionTemplate containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** RevisionTemplate volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** RevisionTemplate executionEnvironment */ - executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); - - /** RevisionTemplate encryptionKey */ - encryptionKey?: (string|null); - - /** RevisionTemplate maxInstanceRequestConcurrency */ - maxInstanceRequestConcurrency?: (number|null); - - /** RevisionTemplate serviceMesh */ - serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** RevisionTemplate encryptionKeyRevocationAction */ - encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); - - /** RevisionTemplate encryptionKeyShutdownDuration */ - encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** RevisionTemplate sessionAffinity */ - sessionAffinity?: (boolean|null); - - /** RevisionTemplate healthCheckDisabled */ - healthCheckDisabled?: (boolean|null); - - /** RevisionTemplate nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** RevisionTemplate gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - } - - /** Represents a RevisionTemplate. */ - class RevisionTemplate implements IRevisionTemplate { - - /** - * Constructs a new RevisionTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IRevisionTemplate); - - /** RevisionTemplate revision. */ - public revision: string; - - /** RevisionTemplate labels. */ - public labels: { [k: string]: string }; - - /** RevisionTemplate annotations. */ - public annotations: { [k: string]: string }; - - /** RevisionTemplate scaling. */ - public scaling?: (google.cloud.run.v2.IRevisionScaling|null); - - /** RevisionTemplate vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** RevisionTemplate timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** RevisionTemplate serviceAccount. */ - public serviceAccount: string; - - /** RevisionTemplate containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** RevisionTemplate volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** RevisionTemplate executionEnvironment. */ - public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); - - /** RevisionTemplate encryptionKey. */ - public encryptionKey: string; - - /** RevisionTemplate maxInstanceRequestConcurrency. */ - public maxInstanceRequestConcurrency: number; - - /** RevisionTemplate serviceMesh. */ - public serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** RevisionTemplate encryptionKeyRevocationAction. */ - public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); - - /** RevisionTemplate encryptionKeyShutdownDuration. */ - public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** RevisionTemplate sessionAffinity. */ - public sessionAffinity: boolean; - - /** RevisionTemplate healthCheckDisabled. */ - public healthCheckDisabled: boolean; - - /** RevisionTemplate nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** RevisionTemplate gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** - * Creates a new RevisionTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns RevisionTemplate instance - */ - public static create(properties?: google.cloud.run.v2.IRevisionTemplate): google.cloud.run.v2.RevisionTemplate; - - /** - * Encodes the specified RevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. - * @param message RevisionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. - * @param message RevisionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevisionTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RevisionTemplate; - - /** - * Decodes a RevisionTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RevisionTemplate; - - /** - * Verifies a RevisionTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RevisionTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevisionTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RevisionTemplate; - - /** - * Creates a plain object from a RevisionTemplate message. Also converts values to other types if specified. - * @param message RevisionTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RevisionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevisionTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevisionTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a Services */ - class Services extends $protobuf.rpc.Service { - - /** - * Constructs a new Services 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 Services 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): Services; - - /** - * Calls CreateService. - * @param request CreateServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createService(request: google.cloud.run.v2.ICreateServiceRequest, callback: google.cloud.run.v2.Services.CreateServiceCallback): void; - - /** - * Calls CreateService. - * @param request CreateServiceRequest message or plain object - * @returns Promise - */ - public createService(request: google.cloud.run.v2.ICreateServiceRequest): Promise; - - /** - * Calls GetService. - * @param request GetServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Service - */ - public getService(request: google.cloud.run.v2.IGetServiceRequest, callback: google.cloud.run.v2.Services.GetServiceCallback): void; - - /** - * Calls GetService. - * @param request GetServiceRequest message or plain object - * @returns Promise - */ - public getService(request: google.cloud.run.v2.IGetServiceRequest): Promise; - - /** - * Calls ListServices. - * @param request ListServicesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListServicesResponse - */ - public listServices(request: google.cloud.run.v2.IListServicesRequest, callback: google.cloud.run.v2.Services.ListServicesCallback): void; - - /** - * Calls ListServices. - * @param request ListServicesRequest message or plain object - * @returns Promise - */ - public listServices(request: google.cloud.run.v2.IListServicesRequest): Promise; - - /** - * Calls UpdateService. - * @param request UpdateServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateService(request: google.cloud.run.v2.IUpdateServiceRequest, callback: google.cloud.run.v2.Services.UpdateServiceCallback): void; - - /** - * Calls UpdateService. - * @param request UpdateServiceRequest message or plain object - * @returns Promise - */ - public updateService(request: google.cloud.run.v2.IUpdateServiceRequest): Promise; - - /** - * Calls DeleteService. - * @param request DeleteServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteService(request: google.cloud.run.v2.IDeleteServiceRequest, callback: google.cloud.run.v2.Services.DeleteServiceCallback): void; - - /** - * Calls DeleteService. - * @param request DeleteServiceRequest message or plain object - * @returns Promise - */ - public deleteService(request: google.cloud.run.v2.IDeleteServiceRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.run.v2.Services.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.run.v2.Services.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.run.v2.Services.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace Services { - - /** - * Callback as used by {@link google.cloud.run.v2.Services|createService}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|getService}. - * @param error Error, if any - * @param [response] Service - */ - type GetServiceCallback = (error: (Error|null), response?: google.cloud.run.v2.Service) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|listServices}. - * @param error Error, if any - * @param [response] ListServicesResponse - */ - type ListServicesCallback = (error: (Error|null), response?: google.cloud.run.v2.ListServicesResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|updateService}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|deleteService}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a CreateServiceRequest. */ - interface ICreateServiceRequest { - - /** CreateServiceRequest parent */ - parent?: (string|null); - - /** CreateServiceRequest service */ - service?: (google.cloud.run.v2.IService|null); - - /** CreateServiceRequest serviceId */ - serviceId?: (string|null); - - /** CreateServiceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateServiceRequest. */ - class CreateServiceRequest implements ICreateServiceRequest { - - /** - * Constructs a new CreateServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICreateServiceRequest); - - /** CreateServiceRequest parent. */ - public parent: string; - - /** CreateServiceRequest service. */ - public service?: (google.cloud.run.v2.IService|null); - - /** CreateServiceRequest serviceId. */ - public serviceId: string; - - /** CreateServiceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateServiceRequest instance - */ - public static create(properties?: google.cloud.run.v2.ICreateServiceRequest): google.cloud.run.v2.CreateServiceRequest; - - /** - * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. - * @param message CreateServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. - * @param message CreateServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateServiceRequest; - - /** - * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateServiceRequest; - - /** - * Verifies a CreateServiceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateServiceRequest; - - /** - * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. - * @param message CreateServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.CreateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateServiceRequest. */ - interface IUpdateServiceRequest { - - /** UpdateServiceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateServiceRequest service */ - service?: (google.cloud.run.v2.IService|null); - - /** UpdateServiceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateServiceRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateServiceRequest. */ - class UpdateServiceRequest implements IUpdateServiceRequest { - - /** - * Constructs a new UpdateServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IUpdateServiceRequest); - - /** UpdateServiceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateServiceRequest service. */ - public service?: (google.cloud.run.v2.IService|null); - - /** UpdateServiceRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateServiceRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateServiceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IUpdateServiceRequest): google.cloud.run.v2.UpdateServiceRequest; - - /** - * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. - * @param message UpdateServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. - * @param message UpdateServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.UpdateServiceRequest; - - /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.UpdateServiceRequest; - - /** - * Verifies an UpdateServiceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.UpdateServiceRequest; - - /** - * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. - * @param message UpdateServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.UpdateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListServicesRequest. */ - interface IListServicesRequest { - - /** ListServicesRequest parent */ - parent?: (string|null); - - /** ListServicesRequest pageSize */ - pageSize?: (number|null); - - /** ListServicesRequest pageToken */ - pageToken?: (string|null); - - /** ListServicesRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListServicesRequest. */ - class ListServicesRequest implements IListServicesRequest { - - /** - * Constructs a new ListServicesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListServicesRequest); - - /** ListServicesRequest parent. */ - public parent: string; - - /** ListServicesRequest pageSize. */ - public pageSize: number; - - /** ListServicesRequest pageToken. */ - public pageToken: string; - - /** ListServicesRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListServicesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListServicesRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListServicesRequest): google.cloud.run.v2.ListServicesRequest; - - /** - * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. - * @param message ListServicesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. - * @param message ListServicesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListServicesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListServicesRequest; - - /** - * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListServicesRequest; - - /** - * Verifies a ListServicesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListServicesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListServicesRequest; - - /** - * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. - * @param message ListServicesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListServicesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListServicesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListServicesResponse. */ - interface IListServicesResponse { - - /** ListServicesResponse services */ - services?: (google.cloud.run.v2.IService[]|null); - - /** ListServicesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListServicesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListServicesResponse. */ - class ListServicesResponse implements IListServicesResponse { - - /** - * Constructs a new ListServicesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListServicesResponse); - - /** ListServicesResponse services. */ - public services: google.cloud.run.v2.IService[]; - - /** ListServicesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListServicesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListServicesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListServicesResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListServicesResponse): google.cloud.run.v2.ListServicesResponse; - - /** - * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. - * @param message ListServicesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. - * @param message ListServicesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListServicesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListServicesResponse; - - /** - * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListServicesResponse; - - /** - * Verifies a ListServicesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListServicesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListServicesResponse; - - /** - * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. - * @param message ListServicesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListServicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListServicesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListServicesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetServiceRequest. */ - interface IGetServiceRequest { - - /** GetServiceRequest name */ - name?: (string|null); - } - - /** Represents a GetServiceRequest. */ - class GetServiceRequest implements IGetServiceRequest { - - /** - * Constructs a new GetServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGetServiceRequest); - - /** GetServiceRequest name. */ - public name: string; - - /** - * Creates a new GetServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetServiceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IGetServiceRequest): google.cloud.run.v2.GetServiceRequest; - - /** - * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. - * @param message GetServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. - * @param message GetServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetServiceRequest; - - /** - * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetServiceRequest; - - /** - * Verifies a GetServiceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetServiceRequest; - - /** - * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. - * @param message GetServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GetServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteServiceRequest. */ - interface IDeleteServiceRequest { - - /** DeleteServiceRequest name */ - name?: (string|null); - - /** DeleteServiceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteServiceRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteServiceRequest. */ - class DeleteServiceRequest implements IDeleteServiceRequest { - - /** - * Constructs a new DeleteServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteServiceRequest); - - /** DeleteServiceRequest name. */ - public name: string; - - /** DeleteServiceRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteServiceRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteServiceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteServiceRequest): google.cloud.run.v2.DeleteServiceRequest; - - /** - * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. - * @param message DeleteServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. - * @param message DeleteServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteServiceRequest; - - /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteServiceRequest; - - /** - * Verifies a DeleteServiceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteServiceRequest; - - /** - * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. - * @param message DeleteServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.DeleteServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Service. */ - interface IService { - - /** Service name */ - name?: (string|null); - - /** Service description */ - description?: (string|null); - - /** Service uid */ - uid?: (string|null); - - /** Service generation */ - generation?: (number|Long|string|null); - - /** Service labels */ - labels?: ({ [k: string]: string }|null); - - /** Service annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Service createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Service updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Service deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Service expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Service creator */ - creator?: (string|null); - - /** Service lastModifier */ - lastModifier?: (string|null); - - /** Service client */ - client?: (string|null); - - /** Service clientVersion */ - clientVersion?: (string|null); - - /** Service ingress */ - ingress?: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic|null); - - /** Service launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** Service binaryAuthorization */ - binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Service template */ - template?: (google.cloud.run.v2.IRevisionTemplate|null); - - /** Service traffic */ - traffic?: (google.cloud.run.v2.ITrafficTarget[]|null); - - /** Service scaling */ - scaling?: (google.cloud.run.v2.IServiceScaling|null); - - /** Service invokerIamDisabled */ - invokerIamDisabled?: (boolean|null); - - /** Service defaultUriDisabled */ - defaultUriDisabled?: (boolean|null); - - /** Service urls */ - urls?: (string[]|null); - - /** Service iapEnabled */ - iapEnabled?: (boolean|null); - - /** Service multiRegionSettings */ - multiRegionSettings?: (google.cloud.run.v2.Service.IMultiRegionSettings|null); - - /** Service customAudiences */ - customAudiences?: (string[]|null); - - /** Service observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Service terminalCondition */ - terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Service conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Service latestReadyRevision */ - latestReadyRevision?: (string|null); - - /** Service latestCreatedRevision */ - latestCreatedRevision?: (string|null); - - /** Service trafficStatuses */ - trafficStatuses?: (google.cloud.run.v2.ITrafficTargetStatus[]|null); - - /** Service uri */ - uri?: (string|null); - - /** Service satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Service threatDetectionEnabled */ - threatDetectionEnabled?: (boolean|null); - - /** Service buildConfig */ - buildConfig?: (google.cloud.run.v2.IBuildConfig|null); - - /** Service reconciling */ - reconciling?: (boolean|null); - - /** Service etag */ - etag?: (string|null); - } - - /** Represents a Service. */ - class Service implements IService { - - /** - * Constructs a new Service. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IService); - - /** Service name. */ - public name: string; - - /** Service description. */ - public description: string; - - /** Service uid. */ - public uid: string; - - /** Service generation. */ - public generation: (number|Long|string); - - /** Service labels. */ - public labels: { [k: string]: string }; - - /** Service annotations. */ - public annotations: { [k: string]: string }; - - /** Service createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Service updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Service deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Service expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Service creator. */ - public creator: string; - - /** Service lastModifier. */ - public lastModifier: string; - - /** Service client. */ - public client: string; - - /** Service clientVersion. */ - public clientVersion: string; - - /** Service ingress. */ - public ingress: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic); - - /** Service launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** Service binaryAuthorization. */ - public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Service template. */ - public template?: (google.cloud.run.v2.IRevisionTemplate|null); - - /** Service traffic. */ - public traffic: google.cloud.run.v2.ITrafficTarget[]; - - /** Service scaling. */ - public scaling?: (google.cloud.run.v2.IServiceScaling|null); - - /** Service invokerIamDisabled. */ - public invokerIamDisabled: boolean; - - /** Service defaultUriDisabled. */ - public defaultUriDisabled: boolean; - - /** Service urls. */ - public urls: string[]; - - /** Service iapEnabled. */ - public iapEnabled: boolean; - - /** Service multiRegionSettings. */ - public multiRegionSettings?: (google.cloud.run.v2.Service.IMultiRegionSettings|null); - - /** Service customAudiences. */ - public customAudiences: string[]; - - /** Service observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Service terminalCondition. */ - public terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Service conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Service latestReadyRevision. */ - public latestReadyRevision: string; - - /** Service latestCreatedRevision. */ - public latestCreatedRevision: string; - - /** Service trafficStatuses. */ - public trafficStatuses: google.cloud.run.v2.ITrafficTargetStatus[]; - - /** Service uri. */ - public uri: string; - - /** Service satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Service threatDetectionEnabled. */ - public threatDetectionEnabled: boolean; - - /** Service buildConfig. */ - public buildConfig?: (google.cloud.run.v2.IBuildConfig|null); - - /** Service reconciling. */ - public reconciling: boolean; - - /** Service etag. */ - public etag: string; - - /** - * Creates a new Service instance using the specified properties. - * @param [properties] Properties to set - * @returns Service instance - */ - public static create(properties?: google.cloud.run.v2.IService): google.cloud.run.v2.Service; - - /** - * Encodes the specified Service message. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. - * @param message Service message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Service message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. - * @param message Service message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Service message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Service - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Service; - - /** - * Decodes a Service message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Service - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Service; - - /** - * Verifies a Service message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Service message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Service - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Service; - - /** - * Creates a plain object from a Service message. Also converts values to other types if specified. - * @param message Service - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Service, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Service to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Service - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Service { - - /** Properties of a MultiRegionSettings. */ - interface IMultiRegionSettings { - - /** MultiRegionSettings regions */ - regions?: (string[]|null); - - /** MultiRegionSettings multiRegionId */ - multiRegionId?: (string|null); - } - - /** Represents a MultiRegionSettings. */ - class MultiRegionSettings implements IMultiRegionSettings { - - /** - * Constructs a new MultiRegionSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.Service.IMultiRegionSettings); - - /** MultiRegionSettings regions. */ - public regions: string[]; - - /** MultiRegionSettings multiRegionId. */ - public multiRegionId: string; - - /** - * Creates a new MultiRegionSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MultiRegionSettings instance - */ - public static create(properties?: google.cloud.run.v2.Service.IMultiRegionSettings): google.cloud.run.v2.Service.MultiRegionSettings; - - /** - * Encodes the specified MultiRegionSettings message. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. - * @param message MultiRegionSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.Service.IMultiRegionSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MultiRegionSettings message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. - * @param message MultiRegionSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.Service.IMultiRegionSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MultiRegionSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MultiRegionSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Service.MultiRegionSettings; - - /** - * Decodes a MultiRegionSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MultiRegionSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Service.MultiRegionSettings; - - /** - * Verifies a MultiRegionSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MultiRegionSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MultiRegionSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Service.MultiRegionSettings; - - /** - * Creates a plain object from a MultiRegionSettings message. Also converts values to other types if specified. - * @param message MultiRegionSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Service.MultiRegionSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MultiRegionSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MultiRegionSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TrafficTarget. */ - interface ITrafficTarget { - - /** TrafficTarget type */ - type?: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType|null); - - /** TrafficTarget revision */ - revision?: (string|null); - - /** TrafficTarget percent */ - percent?: (number|null); - - /** TrafficTarget tag */ - tag?: (string|null); - } - - /** Represents a TrafficTarget. */ - class TrafficTarget implements ITrafficTarget { - - /** - * Constructs a new TrafficTarget. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITrafficTarget); - - /** TrafficTarget type. */ - public type: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType); - - /** TrafficTarget revision. */ - public revision: string; - - /** TrafficTarget percent. */ - public percent: number; - - /** TrafficTarget tag. */ - public tag: string; - - /** - * Creates a new TrafficTarget instance using the specified properties. - * @param [properties] Properties to set - * @returns TrafficTarget instance - */ - public static create(properties?: google.cloud.run.v2.ITrafficTarget): google.cloud.run.v2.TrafficTarget; - - /** - * Encodes the specified TrafficTarget message. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. - * @param message TrafficTarget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ITrafficTarget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrafficTarget message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. - * @param message TrafficTarget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ITrafficTarget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrafficTarget message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrafficTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TrafficTarget; - - /** - * Decodes a TrafficTarget message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrafficTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TrafficTarget; - - /** - * Verifies a TrafficTarget message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrafficTarget message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrafficTarget - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TrafficTarget; - - /** - * Creates a plain object from a TrafficTarget message. Also converts values to other types if specified. - * @param message TrafficTarget - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.TrafficTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrafficTarget to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrafficTarget - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TrafficTargetStatus. */ - interface ITrafficTargetStatus { - - /** TrafficTargetStatus type */ - type?: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType|null); - - /** TrafficTargetStatus revision */ - revision?: (string|null); - - /** TrafficTargetStatus percent */ - percent?: (number|null); - - /** TrafficTargetStatus tag */ - tag?: (string|null); - - /** TrafficTargetStatus uri */ - uri?: (string|null); - } - - /** Represents a TrafficTargetStatus. */ - class TrafficTargetStatus implements ITrafficTargetStatus { - - /** - * Constructs a new TrafficTargetStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITrafficTargetStatus); - - /** TrafficTargetStatus type. */ - public type: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType); - - /** TrafficTargetStatus revision. */ - public revision: string; - - /** TrafficTargetStatus percent. */ - public percent: number; - - /** TrafficTargetStatus tag. */ - public tag: string; - - /** TrafficTargetStatus uri. */ - public uri: string; - - /** - * Creates a new TrafficTargetStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TrafficTargetStatus instance - */ - public static create(properties?: google.cloud.run.v2.ITrafficTargetStatus): google.cloud.run.v2.TrafficTargetStatus; - - /** - * Encodes the specified TrafficTargetStatus message. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. - * @param message TrafficTargetStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ITrafficTargetStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrafficTargetStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. - * @param message TrafficTargetStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ITrafficTargetStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrafficTargetStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrafficTargetStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TrafficTargetStatus; - - /** - * Decodes a TrafficTargetStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrafficTargetStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TrafficTargetStatus; - - /** - * Verifies a TrafficTargetStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrafficTargetStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrafficTargetStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TrafficTargetStatus; - - /** - * Creates a plain object from a TrafficTargetStatus message. Also converts values to other types if specified. - * @param message TrafficTargetStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.TrafficTargetStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrafficTargetStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrafficTargetStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** TrafficTargetAllocationType enum. */ - enum TrafficTargetAllocationType { - TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0, - TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1, - TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2 - } - - /** Represents a Tasks */ - class Tasks extends $protobuf.rpc.Service { - - /** - * Constructs a new Tasks 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 Tasks 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): Tasks; - - /** - * 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.run.v2.IGetTaskRequest, callback: google.cloud.run.v2.Tasks.GetTaskCallback): void; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @returns Promise - */ - public getTask(request: google.cloud.run.v2.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.run.v2.IListTasksRequest, callback: google.cloud.run.v2.Tasks.ListTasksCallback): void; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @returns Promise - */ - public listTasks(request: google.cloud.run.v2.IListTasksRequest): Promise; - } - - namespace Tasks { - - /** - * Callback as used by {@link google.cloud.run.v2.Tasks|getTask}. - * @param error Error, if any - * @param [response] Task - */ - type GetTaskCallback = (error: (Error|null), response?: google.cloud.run.v2.Task) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Tasks|listTasks}. - * @param error Error, if any - * @param [response] ListTasksResponse - */ - type ListTasksCallback = (error: (Error|null), response?: google.cloud.run.v2.ListTasksResponse) => void; - } - - /** 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.run.v2.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.run.v2.IGetTaskRequest): google.cloud.run.v2.GetTaskRequest; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 ListTasksRequest. */ - interface IListTasksRequest { - - /** ListTasksRequest parent */ - parent?: (string|null); - - /** ListTasksRequest pageSize */ - pageSize?: (number|null); - - /** ListTasksRequest pageToken */ - pageToken?: (string|null); - - /** ListTasksRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListTasksRequest. */ - class ListTasksRequest implements IListTasksRequest { - - /** - * Constructs a new ListTasksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListTasksRequest); - - /** ListTasksRequest parent. */ - public parent: string; - - /** ListTasksRequest pageSize. */ - public pageSize: number; - - /** ListTasksRequest pageToken. */ - public pageToken: string; - - /** ListTasksRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListTasksRequest): google.cloud.run.v2.ListTasksRequest; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.ITask[]|null); - - /** ListTasksResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTasksResponse. */ - class ListTasksResponse implements IListTasksResponse { - - /** - * Constructs a new ListTasksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListTasksResponse); - - /** ListTasksResponse tasks. */ - public tasks: google.cloud.run.v2.ITask[]; - - /** ListTasksResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListTasksResponse): google.cloud.run.v2.ListTasksResponse; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 Task. */ - interface ITask { - - /** Task name */ - name?: (string|null); - - /** Task uid */ - uid?: (string|null); - - /** Task generation */ - generation?: (number|Long|string|null); - - /** Task labels */ - labels?: ({ [k: string]: string }|null); - - /** Task annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Task createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Task scheduledTime */ - scheduledTime?: (google.protobuf.ITimestamp|null); - - /** Task startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Task completionTime */ - completionTime?: (google.protobuf.ITimestamp|null); - - /** Task updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Task deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Task expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Task job */ - job?: (string|null); - - /** Task execution */ - execution?: (string|null); - - /** Task containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** Task volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** Task maxRetries */ - maxRetries?: (number|null); - - /** Task timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** Task serviceAccount */ - serviceAccount?: (string|null); - - /** Task executionEnvironment */ - executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); - - /** Task reconciling */ - reconciling?: (boolean|null); - - /** Task conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Task observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Task index */ - index?: (number|null); - - /** Task retried */ - retried?: (number|null); - - /** Task lastAttemptResult */ - lastAttemptResult?: (google.cloud.run.v2.ITaskAttemptResult|null); - - /** Task encryptionKey */ - encryptionKey?: (string|null); - - /** Task vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Task logUri */ - logUri?: (string|null); - - /** Task satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Task nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Task gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - - /** Task etag */ - etag?: (string|null); - } - - /** Represents a Task. */ - class Task implements ITask { - - /** - * Constructs a new Task. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITask); - - /** Task name. */ - public name: string; - - /** Task uid. */ - public uid: string; - - /** Task generation. */ - public generation: (number|Long|string); - - /** Task labels. */ - public labels: { [k: string]: string }; - - /** Task annotations. */ - public annotations: { [k: string]: string }; - - /** Task createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Task scheduledTime. */ - public scheduledTime?: (google.protobuf.ITimestamp|null); - - /** Task startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Task completionTime. */ - public completionTime?: (google.protobuf.ITimestamp|null); - - /** Task updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Task deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Task expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Task job. */ - public job: string; - - /** Task execution. */ - public execution: string; - - /** Task containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** Task volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** Task maxRetries. */ - public maxRetries: number; - - /** Task timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** Task serviceAccount. */ - public serviceAccount: string; - - /** Task executionEnvironment. */ - public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); - - /** Task reconciling. */ - public reconciling: boolean; - - /** Task conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Task observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Task index. */ - public index: number; - - /** Task retried. */ - public retried: number; - - /** Task lastAttemptResult. */ - public lastAttemptResult?: (google.cloud.run.v2.ITaskAttemptResult|null); - - /** Task encryptionKey. */ - public encryptionKey: string; - - /** Task vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Task logUri. */ - public logUri: string; - - /** Task satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Task nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Task gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** Task etag. */ - public etag: string; - - /** - * Creates a new Task instance using the specified properties. - * @param [properties] Properties to set - * @returns Task instance - */ - public static create(properties?: google.cloud.run.v2.ITask): google.cloud.run.v2.Task; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 a TaskAttemptResult. */ - interface ITaskAttemptResult { - - /** TaskAttemptResult status */ - status?: (google.rpc.IStatus|null); - - /** TaskAttemptResult exitCode */ - exitCode?: (number|null); - - /** TaskAttemptResult termSignal */ - termSignal?: (number|null); - } - - /** Represents a TaskAttemptResult. */ - class TaskAttemptResult implements ITaskAttemptResult { - - /** - * Constructs a new TaskAttemptResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITaskAttemptResult); - - /** TaskAttemptResult status. */ - public status?: (google.rpc.IStatus|null); - - /** TaskAttemptResult exitCode. */ - public exitCode: number; - - /** TaskAttemptResult termSignal. */ - public termSignal: number; - - /** - * Creates a new TaskAttemptResult instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskAttemptResult instance - */ - public static create(properties?: google.cloud.run.v2.ITaskAttemptResult): google.cloud.run.v2.TaskAttemptResult; - - /** - * Encodes the specified TaskAttemptResult message. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. - * @param message TaskAttemptResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ITaskAttemptResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskAttemptResult message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. - * @param message TaskAttemptResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ITaskAttemptResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskAttemptResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskAttemptResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TaskAttemptResult; - - /** - * Decodes a TaskAttemptResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskAttemptResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TaskAttemptResult; - - /** - * Verifies a TaskAttemptResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskAttemptResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskAttemptResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TaskAttemptResult; - - /** - * Creates a plain object from a TaskAttemptResult message. Also converts values to other types if specified. - * @param message TaskAttemptResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.TaskAttemptResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskAttemptResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskAttemptResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a WorkerPools */ - class WorkerPools extends $protobuf.rpc.Service { - - /** - * Constructs a new WorkerPools 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 WorkerPools 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): WorkerPools; - - /** - * Calls CreateWorkerPool. - * @param request CreateWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createWorkerPool(request: google.cloud.run.v2.ICreateWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.CreateWorkerPoolCallback): void; - - /** - * Calls CreateWorkerPool. - * @param request CreateWorkerPoolRequest message or plain object - * @returns Promise - */ - public createWorkerPool(request: google.cloud.run.v2.ICreateWorkerPoolRequest): Promise; - - /** - * Calls GetWorkerPool. - * @param request GetWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WorkerPool - */ - public getWorkerPool(request: google.cloud.run.v2.IGetWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.GetWorkerPoolCallback): void; - - /** - * Calls GetWorkerPool. - * @param request GetWorkerPoolRequest message or plain object - * @returns Promise - */ - public getWorkerPool(request: google.cloud.run.v2.IGetWorkerPoolRequest): Promise; - - /** - * Calls ListWorkerPools. - * @param request ListWorkerPoolsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListWorkerPoolsResponse - */ - public listWorkerPools(request: google.cloud.run.v2.IListWorkerPoolsRequest, callback: google.cloud.run.v2.WorkerPools.ListWorkerPoolsCallback): void; - - /** - * Calls ListWorkerPools. - * @param request ListWorkerPoolsRequest message or plain object - * @returns Promise - */ - public listWorkerPools(request: google.cloud.run.v2.IListWorkerPoolsRequest): Promise; - - /** - * Calls UpdateWorkerPool. - * @param request UpdateWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateWorkerPool(request: google.cloud.run.v2.IUpdateWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.UpdateWorkerPoolCallback): void; - - /** - * Calls UpdateWorkerPool. - * @param request UpdateWorkerPoolRequest message or plain object - * @returns Promise - */ - public updateWorkerPool(request: google.cloud.run.v2.IUpdateWorkerPoolRequest): Promise; - - /** - * Calls DeleteWorkerPool. - * @param request DeleteWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteWorkerPool(request: google.cloud.run.v2.IDeleteWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.DeleteWorkerPoolCallback): void; - - /** - * Calls DeleteWorkerPool. - * @param request DeleteWorkerPoolRequest message or plain object - * @returns Promise - */ - public deleteWorkerPool(request: google.cloud.run.v2.IDeleteWorkerPoolRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.run.v2.WorkerPools.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.run.v2.WorkerPools.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.run.v2.WorkerPools.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace WorkerPools { - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|createWorkerPool}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|getWorkerPool}. - * @param error Error, if any - * @param [response] WorkerPool - */ - type GetWorkerPoolCallback = (error: (Error|null), response?: google.cloud.run.v2.WorkerPool) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|listWorkerPools}. - * @param error Error, if any - * @param [response] ListWorkerPoolsResponse - */ - type ListWorkerPoolsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListWorkerPoolsResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|updateWorkerPool}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|deleteWorkerPool}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a CreateWorkerPoolRequest. */ - interface ICreateWorkerPoolRequest { - - /** CreateWorkerPoolRequest parent */ - parent?: (string|null); - - /** CreateWorkerPoolRequest workerPool */ - workerPool?: (google.cloud.run.v2.IWorkerPool|null); - - /** CreateWorkerPoolRequest workerPoolId */ - workerPoolId?: (string|null); - - /** CreateWorkerPoolRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateWorkerPoolRequest. */ - class CreateWorkerPoolRequest implements ICreateWorkerPoolRequest { - - /** - * Constructs a new CreateWorkerPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICreateWorkerPoolRequest); - - /** CreateWorkerPoolRequest parent. */ - public parent: string; - - /** CreateWorkerPoolRequest workerPool. */ - public workerPool?: (google.cloud.run.v2.IWorkerPool|null); - - /** CreateWorkerPoolRequest workerPoolId. */ - public workerPoolId: string; - - /** CreateWorkerPoolRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateWorkerPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateWorkerPoolRequest instance - */ - public static create(properties?: google.cloud.run.v2.ICreateWorkerPoolRequest): google.cloud.run.v2.CreateWorkerPoolRequest; - - /** - * Encodes the specified CreateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. - * @param message CreateWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICreateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. - * @param message CreateWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICreateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateWorkerPoolRequest; - - /** - * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateWorkerPoolRequest; - - /** - * Verifies a CreateWorkerPoolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateWorkerPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateWorkerPoolRequest; - - /** - * Creates a plain object from a CreateWorkerPoolRequest message. Also converts values to other types if specified. - * @param message CreateWorkerPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.CreateWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateWorkerPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateWorkerPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateWorkerPoolRequest. */ - interface IUpdateWorkerPoolRequest { - - /** UpdateWorkerPoolRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateWorkerPoolRequest workerPool */ - workerPool?: (google.cloud.run.v2.IWorkerPool|null); - - /** UpdateWorkerPoolRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateWorkerPoolRequest allowMissing */ - allowMissing?: (boolean|null); - - /** UpdateWorkerPoolRequest forceNewRevision */ - forceNewRevision?: (boolean|null); - } - - /** Represents an UpdateWorkerPoolRequest. */ - class UpdateWorkerPoolRequest implements IUpdateWorkerPoolRequest { - - /** - * Constructs a new UpdateWorkerPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IUpdateWorkerPoolRequest); - - /** UpdateWorkerPoolRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateWorkerPoolRequest workerPool. */ - public workerPool?: (google.cloud.run.v2.IWorkerPool|null); - - /** UpdateWorkerPoolRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateWorkerPoolRequest allowMissing. */ - public allowMissing: boolean; - - /** UpdateWorkerPoolRequest forceNewRevision. */ - public forceNewRevision: boolean; - - /** - * Creates a new UpdateWorkerPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateWorkerPoolRequest instance - */ - public static create(properties?: google.cloud.run.v2.IUpdateWorkerPoolRequest): google.cloud.run.v2.UpdateWorkerPoolRequest; - - /** - * Encodes the specified UpdateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. - * @param message UpdateWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IUpdateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. - * @param message UpdateWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IUpdateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.UpdateWorkerPoolRequest; - - /** - * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.UpdateWorkerPoolRequest; - - /** - * Verifies an UpdateWorkerPoolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateWorkerPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.UpdateWorkerPoolRequest; - - /** - * Creates a plain object from an UpdateWorkerPoolRequest message. Also converts values to other types if specified. - * @param message UpdateWorkerPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.UpdateWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateWorkerPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateWorkerPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListWorkerPoolsRequest. */ - interface IListWorkerPoolsRequest { - - /** ListWorkerPoolsRequest parent */ - parent?: (string|null); - - /** ListWorkerPoolsRequest pageSize */ - pageSize?: (number|null); - - /** ListWorkerPoolsRequest pageToken */ - pageToken?: (string|null); - - /** ListWorkerPoolsRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListWorkerPoolsRequest. */ - class ListWorkerPoolsRequest implements IListWorkerPoolsRequest { - - /** - * Constructs a new ListWorkerPoolsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListWorkerPoolsRequest); - - /** ListWorkerPoolsRequest parent. */ - public parent: string; - - /** ListWorkerPoolsRequest pageSize. */ - public pageSize: number; - - /** ListWorkerPoolsRequest pageToken. */ - public pageToken: string; - - /** ListWorkerPoolsRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListWorkerPoolsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListWorkerPoolsRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListWorkerPoolsRequest): google.cloud.run.v2.ListWorkerPoolsRequest; - - /** - * Encodes the specified ListWorkerPoolsRequest message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. - * @param message ListWorkerPoolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListWorkerPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListWorkerPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. - * @param message ListWorkerPoolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListWorkerPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListWorkerPoolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListWorkerPoolsRequest; - - /** - * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListWorkerPoolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListWorkerPoolsRequest; - - /** - * Verifies a ListWorkerPoolsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListWorkerPoolsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListWorkerPoolsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListWorkerPoolsRequest; - - /** - * Creates a plain object from a ListWorkerPoolsRequest message. Also converts values to other types if specified. - * @param message ListWorkerPoolsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListWorkerPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListWorkerPoolsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListWorkerPoolsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListWorkerPoolsResponse. */ - interface IListWorkerPoolsResponse { - - /** ListWorkerPoolsResponse workerPools */ - workerPools?: (google.cloud.run.v2.IWorkerPool[]|null); - - /** ListWorkerPoolsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListWorkerPoolsResponse. */ - class ListWorkerPoolsResponse implements IListWorkerPoolsResponse { - - /** - * Constructs a new ListWorkerPoolsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListWorkerPoolsResponse); - - /** ListWorkerPoolsResponse workerPools. */ - public workerPools: google.cloud.run.v2.IWorkerPool[]; - - /** ListWorkerPoolsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListWorkerPoolsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListWorkerPoolsResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListWorkerPoolsResponse): google.cloud.run.v2.ListWorkerPoolsResponse; - - /** - * Encodes the specified ListWorkerPoolsResponse message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. - * @param message ListWorkerPoolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListWorkerPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListWorkerPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. - * @param message ListWorkerPoolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListWorkerPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListWorkerPoolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListWorkerPoolsResponse; - - /** - * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListWorkerPoolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListWorkerPoolsResponse; - - /** - * Verifies a ListWorkerPoolsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListWorkerPoolsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListWorkerPoolsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListWorkerPoolsResponse; - - /** - * Creates a plain object from a ListWorkerPoolsResponse message. Also converts values to other types if specified. - * @param message ListWorkerPoolsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListWorkerPoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListWorkerPoolsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListWorkerPoolsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetWorkerPoolRequest. */ - interface IGetWorkerPoolRequest { - - /** GetWorkerPoolRequest name */ - name?: (string|null); - } - - /** Represents a GetWorkerPoolRequest. */ - class GetWorkerPoolRequest implements IGetWorkerPoolRequest { - - /** - * Constructs a new GetWorkerPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGetWorkerPoolRequest); - - /** GetWorkerPoolRequest name. */ - public name: string; - - /** - * Creates a new GetWorkerPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetWorkerPoolRequest instance - */ - public static create(properties?: google.cloud.run.v2.IGetWorkerPoolRequest): google.cloud.run.v2.GetWorkerPoolRequest; - - /** - * Encodes the specified GetWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. - * @param message GetWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGetWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. - * @param message GetWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGetWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetWorkerPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetWorkerPoolRequest; - - /** - * Decodes a GetWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetWorkerPoolRequest; - - /** - * Verifies a GetWorkerPoolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetWorkerPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetWorkerPoolRequest; - - /** - * Creates a plain object from a GetWorkerPoolRequest message. Also converts values to other types if specified. - * @param message GetWorkerPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GetWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetWorkerPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetWorkerPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteWorkerPoolRequest. */ - interface IDeleteWorkerPoolRequest { - - /** DeleteWorkerPoolRequest name */ - name?: (string|null); - - /** DeleteWorkerPoolRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteWorkerPoolRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteWorkerPoolRequest. */ - class DeleteWorkerPoolRequest implements IDeleteWorkerPoolRequest { - - /** - * Constructs a new DeleteWorkerPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteWorkerPoolRequest); - - /** DeleteWorkerPoolRequest name. */ - public name: string; - - /** DeleteWorkerPoolRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteWorkerPoolRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteWorkerPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteWorkerPoolRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteWorkerPoolRequest): google.cloud.run.v2.DeleteWorkerPoolRequest; - - /** - * Encodes the specified DeleteWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. - * @param message DeleteWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IDeleteWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. - * @param message DeleteWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IDeleteWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteWorkerPoolRequest; - - /** - * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteWorkerPoolRequest; - - /** - * Verifies a DeleteWorkerPoolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteWorkerPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteWorkerPoolRequest; - - /** - * Creates a plain object from a DeleteWorkerPoolRequest message. Also converts values to other types if specified. - * @param message DeleteWorkerPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.DeleteWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteWorkerPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteWorkerPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WorkerPool. */ - interface IWorkerPool { - - /** WorkerPool name */ - name?: (string|null); - - /** WorkerPool description */ - description?: (string|null); - - /** WorkerPool uid */ - uid?: (string|null); - - /** WorkerPool generation */ - generation?: (number|Long|string|null); - - /** WorkerPool labels */ - labels?: ({ [k: string]: string }|null); - - /** WorkerPool annotations */ - annotations?: ({ [k: string]: string }|null); - - /** WorkerPool createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool creator */ - creator?: (string|null); - - /** WorkerPool lastModifier */ - lastModifier?: (string|null); - - /** WorkerPool client */ - client?: (string|null); - - /** WorkerPool clientVersion */ - clientVersion?: (string|null); - - /** WorkerPool launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** WorkerPool binaryAuthorization */ - binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** WorkerPool template */ - template?: (google.cloud.run.v2.IWorkerPoolRevisionTemplate|null); - - /** WorkerPool instanceSplits */ - instanceSplits?: (google.cloud.run.v2.IInstanceSplit[]|null); - - /** WorkerPool scaling */ - scaling?: (google.cloud.run.v2.IWorkerPoolScaling|null); - - /** WorkerPool observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** WorkerPool terminalCondition */ - terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** WorkerPool conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** WorkerPool latestReadyRevision */ - latestReadyRevision?: (string|null); - - /** WorkerPool latestCreatedRevision */ - latestCreatedRevision?: (string|null); - - /** WorkerPool instanceSplitStatuses */ - instanceSplitStatuses?: (google.cloud.run.v2.IInstanceSplitStatus[]|null); - - /** WorkerPool threatDetectionEnabled */ - threatDetectionEnabled?: (boolean|null); - - /** WorkerPool customAudiences */ - customAudiences?: (string[]|null); - - /** WorkerPool satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** WorkerPool reconciling */ - reconciling?: (boolean|null); - - /** WorkerPool etag */ - etag?: (string|null); - } - - /** Represents a WorkerPool. */ - class WorkerPool implements IWorkerPool { - - /** - * Constructs a new WorkerPool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IWorkerPool); - - /** WorkerPool name. */ - public name: string; - - /** WorkerPool description. */ - public description: string; - - /** WorkerPool uid. */ - public uid: string; - - /** WorkerPool generation. */ - public generation: (number|Long|string); - - /** WorkerPool labels. */ - public labels: { [k: string]: string }; - - /** WorkerPool annotations. */ - public annotations: { [k: string]: string }; - - /** WorkerPool createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool creator. */ - public creator: string; - - /** WorkerPool lastModifier. */ - public lastModifier: string; - - /** WorkerPool client. */ - public client: string; - - /** WorkerPool clientVersion. */ - public clientVersion: string; - - /** WorkerPool launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** WorkerPool binaryAuthorization. */ - public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** WorkerPool template. */ - public template?: (google.cloud.run.v2.IWorkerPoolRevisionTemplate|null); - - /** WorkerPool instanceSplits. */ - public instanceSplits: google.cloud.run.v2.IInstanceSplit[]; - - /** WorkerPool scaling. */ - public scaling?: (google.cloud.run.v2.IWorkerPoolScaling|null); - - /** WorkerPool observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** WorkerPool terminalCondition. */ - public terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** WorkerPool conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** WorkerPool latestReadyRevision. */ - public latestReadyRevision: string; - - /** WorkerPool latestCreatedRevision. */ - public latestCreatedRevision: string; - - /** WorkerPool instanceSplitStatuses. */ - public instanceSplitStatuses: google.cloud.run.v2.IInstanceSplitStatus[]; - - /** WorkerPool threatDetectionEnabled. */ - public threatDetectionEnabled: boolean; - - /** WorkerPool customAudiences. */ - public customAudiences: string[]; - - /** WorkerPool satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** WorkerPool reconciling. */ - public reconciling: boolean; - - /** WorkerPool etag. */ - public etag: string; - - /** - * Creates a new WorkerPool instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkerPool instance - */ - public static create(properties?: google.cloud.run.v2.IWorkerPool): google.cloud.run.v2.WorkerPool; - - /** - * Encodes the specified WorkerPool message. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. - * @param message WorkerPool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IWorkerPool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkerPool message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. - * @param message WorkerPool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IWorkerPool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkerPool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkerPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.WorkerPool; - - /** - * Decodes a WorkerPool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkerPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.WorkerPool; - - /** - * Verifies a WorkerPool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkerPool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkerPool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.WorkerPool; - - /** - * Creates a plain object from a WorkerPool message. Also converts values to other types if specified. - * @param message WorkerPool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.WorkerPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkerPool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkerPool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WorkerPoolRevisionTemplate. */ - interface IWorkerPoolRevisionTemplate { - - /** WorkerPoolRevisionTemplate revision */ - revision?: (string|null); - - /** WorkerPoolRevisionTemplate labels */ - labels?: ({ [k: string]: string }|null); - - /** WorkerPoolRevisionTemplate annotations */ - annotations?: ({ [k: string]: string }|null); - - /** WorkerPoolRevisionTemplate vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** WorkerPoolRevisionTemplate serviceAccount */ - serviceAccount?: (string|null); - - /** WorkerPoolRevisionTemplate containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** WorkerPoolRevisionTemplate volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** WorkerPoolRevisionTemplate encryptionKey */ - encryptionKey?: (string|null); - - /** WorkerPoolRevisionTemplate serviceMesh */ - serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** WorkerPoolRevisionTemplate encryptionKeyRevocationAction */ - encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); - - /** WorkerPoolRevisionTemplate encryptionKeyShutdownDuration */ - encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** WorkerPoolRevisionTemplate nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - } - - /** Represents a WorkerPoolRevisionTemplate. */ - class WorkerPoolRevisionTemplate implements IWorkerPoolRevisionTemplate { - - /** - * Constructs a new WorkerPoolRevisionTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IWorkerPoolRevisionTemplate); - - /** WorkerPoolRevisionTemplate revision. */ - public revision: string; - - /** WorkerPoolRevisionTemplate labels. */ - public labels: { [k: string]: string }; - - /** WorkerPoolRevisionTemplate annotations. */ - public annotations: { [k: string]: string }; - - /** WorkerPoolRevisionTemplate vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** WorkerPoolRevisionTemplate serviceAccount. */ - public serviceAccount: string; - - /** WorkerPoolRevisionTemplate containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** WorkerPoolRevisionTemplate volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** WorkerPoolRevisionTemplate encryptionKey. */ - public encryptionKey: string; - - /** WorkerPoolRevisionTemplate serviceMesh. */ - public serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** WorkerPoolRevisionTemplate encryptionKeyRevocationAction. */ - public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); - - /** WorkerPoolRevisionTemplate encryptionKeyShutdownDuration. */ - public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** WorkerPoolRevisionTemplate nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** - * Creates a new WorkerPoolRevisionTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkerPoolRevisionTemplate instance - */ - public static create(properties?: google.cloud.run.v2.IWorkerPoolRevisionTemplate): google.cloud.run.v2.WorkerPoolRevisionTemplate; - - /** - * Encodes the specified WorkerPoolRevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. - * @param message WorkerPoolRevisionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IWorkerPoolRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkerPoolRevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. - * @param message WorkerPoolRevisionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IWorkerPoolRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkerPoolRevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.WorkerPoolRevisionTemplate; - - /** - * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkerPoolRevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.WorkerPoolRevisionTemplate; - - /** - * Verifies a WorkerPoolRevisionTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkerPoolRevisionTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkerPoolRevisionTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.WorkerPoolRevisionTemplate; - - /** - * Creates a plain object from a WorkerPoolRevisionTemplate message. Also converts values to other types if specified. - * @param message WorkerPoolRevisionTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.WorkerPoolRevisionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkerPoolRevisionTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkerPoolRevisionTemplate - * @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 ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RoutingRule. */ - interface IRoutingRule { - - /** RoutingRule routingParameters */ - routingParameters?: (google.api.IRoutingParameter[]|null); - } - - /** Represents a RoutingRule. */ - class RoutingRule implements IRoutingRule { - - /** - * Constructs a new RoutingRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRoutingRule); - - /** RoutingRule routingParameters. */ - public routingParameters: google.api.IRoutingParameter[]; - - /** - * Creates a new RoutingRule instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingRule instance - */ - public static create(properties?: google.api.IRoutingRule): google.api.RoutingRule; - - /** - * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @param message RoutingRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @param message RoutingRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RoutingRule; - - /** - * Decodes a RoutingRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RoutingRule; - - /** - * Verifies a RoutingRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingRule - */ - public static fromObject(object: { [k: string]: any }): google.api.RoutingRule; - - /** - * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. - * @param message RoutingRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RoutingRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RoutingParameter. */ - interface IRoutingParameter { - - /** RoutingParameter field */ - field?: (string|null); - - /** RoutingParameter pathTemplate */ - pathTemplate?: (string|null); - } - - /** Represents a RoutingParameter. */ - class RoutingParameter implements IRoutingParameter { - - /** - * Constructs a new RoutingParameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRoutingParameter); - - /** RoutingParameter field. */ - public field: string; - - /** RoutingParameter pathTemplate. */ - public pathTemplate: string; - - /** - * Creates a new RoutingParameter instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingParameter instance - */ - public static create(properties?: google.api.IRoutingParameter): google.api.RoutingParameter; - - /** - * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @param message RoutingParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @param message RoutingParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RoutingParameter; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RoutingParameter; - - /** - * Verifies a RoutingParameter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingParameter - */ - public static fromObject(object: { [k: string]: any }): google.api.RoutingParameter; - - /** - * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. - * @param message RoutingParameter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RoutingParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingParameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingParameter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.api.routing */ - ".google.api.routing"?: (google.api.IRoutingRule|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a 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 longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace iam. */ - namespace iam { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a IAMPolicy */ - class IAMPolicy extends $protobuf.rpc.Service { - - /** - * Constructs a new IAMPolicy service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace IAMPolicy { - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a SetIamPolicyRequest. */ - interface ISetIamPolicyRequest { - - /** SetIamPolicyRequest resource */ - resource?: (string|null); - - /** SetIamPolicyRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a SetIamPolicyRequest. */ - class SetIamPolicyRequest implements ISetIamPolicyRequest { - - /** - * Constructs a new SetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - - /** SetIamPolicyRequest resource. */ - public resource: string; - - /** SetIamPolicyRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; - - /** - * Verifies a SetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @param message SetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetIamPolicyRequest. */ - interface IGetIamPolicyRequest { - - /** GetIamPolicyRequest resource */ - resource?: (string|null); - - /** GetIamPolicyRequest options */ - options?: (google.iam.v1.IGetPolicyOptions|null); - } - - /** Represents a GetIamPolicyRequest. */ - class GetIamPolicyRequest implements IGetIamPolicyRequest { - - /** - * Constructs a new GetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetIamPolicyRequest); - - /** GetIamPolicyRequest resource. */ - public resource: string; - - /** GetIamPolicyRequest options. */ - public options?: (google.iam.v1.IGetPolicyOptions|null); - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; - - /** - * Verifies a GetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @param message GetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsRequest. */ - interface ITestIamPermissionsRequest { - - /** TestIamPermissionsRequest resource */ - resource?: (string|null); - - /** TestIamPermissionsRequest permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsRequest. */ - class TestIamPermissionsRequest implements ITestIamPermissionsRequest { - - /** - * Constructs a new TestIamPermissionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); - - /** TestIamPermissionsRequest resource. */ - public resource: string; - - /** TestIamPermissionsRequest permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsRequest instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; - - /** - * Verifies a TestIamPermissionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @param message TestIamPermissionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsResponse. */ - interface ITestIamPermissionsResponse { - - /** TestIamPermissionsResponse permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsResponse. */ - class TestIamPermissionsResponse implements ITestIamPermissionsResponse { - - /** - * Constructs a new TestIamPermissionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); - - /** TestIamPermissionsResponse permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsResponse instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; - - /** - * Verifies a TestIamPermissionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @param message TestIamPermissionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetPolicyOptions. */ - interface IGetPolicyOptions { - - /** GetPolicyOptions requestedPolicyVersion */ - requestedPolicyVersion?: (number|null); - } - - /** Represents a GetPolicyOptions. */ - class GetPolicyOptions implements IGetPolicyOptions { - - /** - * Constructs a new GetPolicyOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetPolicyOptions); - - /** GetPolicyOptions requestedPolicyVersion. */ - public requestedPolicyVersion: number; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns GetPolicyOptions instance - */ - public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; - - /** - * Verifies a GetPolicyOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetPolicyOptions - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @param message GetPolicyOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetPolicyOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetPolicyOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Policy. */ - interface IPolicy { - - /** Policy version */ - version?: (number|null); - - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); - - /** Policy auditConfigs */ - auditConfigs?: (google.iam.v1.IAuditConfig[]|null); - - /** Policy etag */ - etag?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Policy. */ - class Policy implements IPolicy { - - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicy); - - /** Policy version. */ - public version: number; - - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; - - /** Policy auditConfigs. */ - public auditConfigs: google.iam.v1.IAuditConfig[]; - - /** Policy etag. */ - public etag: (Uint8Array|Buffer|string); - - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; - - /** - * Verifies a Policy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Policy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Binding. */ - interface IBinding { - - /** Binding role */ - role?: (string|null); - - /** Binding members */ - members?: (string[]|null); - - /** Binding condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a Binding. */ - class Binding implements IBinding { - - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBinding); - - /** Binding role. */ - public role: string; - - /** Binding members. */ - public members: string[]; - - /** Binding condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new Binding instance using the specified properties. - * @param [properties] Properties to set - * @returns Binding instance - */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; - - /** - * Verifies a Binding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Binding - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Binding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Binding - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditConfig. */ - interface IAuditConfig { - - /** AuditConfig service */ - service?: (string|null); - - /** AuditConfig auditLogConfigs */ - auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); - } - - /** Represents an AuditConfig. */ - class AuditConfig implements IAuditConfig { - - /** - * Constructs a new AuditConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfig); - - /** AuditConfig service. */ - public service: string; - - /** AuditConfig auditLogConfigs. */ - public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfig instance - */ - public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; - - /** - * Verifies an AuditConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @param message AuditConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditLogConfig. */ - interface IAuditLogConfig { - - /** AuditLogConfig logType */ - logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); - - /** AuditLogConfig exemptedMembers */ - exemptedMembers?: (string[]|null); - } - - /** Represents an AuditLogConfig. */ - class AuditLogConfig implements IAuditLogConfig { - - /** - * Constructs a new AuditLogConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditLogConfig); - - /** AuditLogConfig logType. */ - public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); - - /** AuditLogConfig exemptedMembers. */ - public exemptedMembers: string[]; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditLogConfig instance - */ - public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; - - /** - * Verifies an AuditLogConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditLogConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @param message AuditLogConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditLogConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditLogConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditLogConfig { - - /** LogType enum. */ - enum LogType { - LOG_TYPE_UNSPECIFIED = 0, - ADMIN_READ = 1, - DATA_WRITE = 2, - DATA_READ = 3 - } - } - - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { - - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); - - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); - } - - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { - - /** - * Constructs a new PolicyDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicyDelta); - - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; - - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDelta instance - */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; - - /** - * Verifies a PolicyDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolicyDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BindingDelta. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); - - /** BindingDelta role */ - role?: (string|null); - - /** BindingDelta member */ - member?: (string|null); - - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { - - /** - * Constructs a new BindingDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBindingDelta); - - /** BindingDelta action. */ - public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); - - /** BindingDelta role. */ - public role: string; - - /** BindingDelta member. */ - public member: string; - - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new BindingDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns BindingDelta instance - */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; - - /** - * Verifies a BindingDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BindingDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BindingDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BindingDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BindingDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { - - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); - - /** AuditConfigDelta service */ - service?: (string|null); - - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); - - /** AuditConfigDelta logType */ - logType?: (string|null); - } - - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { - - /** - * Constructs a new AuditConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); - - /** AuditConfigDelta action. */ - public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); - - /** AuditConfigDelta service. */ - public service: string; - - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; - - /** AuditConfigDelta logType. */ - public logType: string; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfigDelta instance - */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; - - /** - * Verifies an AuditConfigDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfigDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditConfigDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Expr. */ - interface IExpr { - - /** Expr expression */ - expression?: (string|null); - - /** Expr title */ - title?: (string|null); - - /** Expr description */ - description?: (string|null); - - /** Expr location */ - location?: (string|null); - } - - /** Represents an Expr. */ - class Expr implements IExpr { - - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); - - /** Expr expression. */ - public expression: string; - - /** Expr title. */ - public title: string; - - /** Expr description. */ - public description: string; - - /** Expr location. */ - public location: string; - - /** - * Creates a new Expr instance using the specified properties. - * @param [properties] Properties to set - * @returns Expr instance - */ - public static create(properties?: google.type.IExpr): google.type.Expr; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; - - /** - * Verifies an Expr message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Expr - */ - public static fromObject(object: { [k: string]: any }): google.type.Expr; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @param message Expr - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Expr to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Expr - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-cloud-run/protos/protos.js b/owl-bot-staging/google-cloud-run/protos/protos.js deleted file mode 100644 index c7edd21ba6b..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/protos.js +++ /dev/null @@ -1,61975 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_run_protos || ($protobuf.roots._google_cloud_run_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.run = (function() { - - /** - * Namespace run. - * @memberof google.cloud - * @namespace - */ - var run = {}; - - run.v2 = (function() { - - /** - * Namespace v2. - * @memberof google.cloud.run - * @namespace - */ - var v2 = {}; - - v2.Builds = (function() { - - /** - * Constructs a new Builds service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Builds - * @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 Builds(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Builds.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Builds; - - /** - * Creates new Builds service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Builds - * @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 {Builds} RPC service. Useful where requests and/or responses are streamed. - */ - Builds.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Builds|submitBuild}. - * @memberof google.cloud.run.v2.Builds - * @typedef SubmitBuildCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.SubmitBuildResponse} [response] SubmitBuildResponse - */ - - /** - * Calls SubmitBuild. - * @function submitBuild - * @memberof google.cloud.run.v2.Builds - * @instance - * @param {google.cloud.run.v2.ISubmitBuildRequest} request SubmitBuildRequest message or plain object - * @param {google.cloud.run.v2.Builds.SubmitBuildCallback} callback Node-style callback called with the error, if any, and SubmitBuildResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Builds.prototype.submitBuild = function submitBuild(request, callback) { - return this.rpcCall(submitBuild, $root.google.cloud.run.v2.SubmitBuildRequest, $root.google.cloud.run.v2.SubmitBuildResponse, request, callback); - }, "name", { value: "SubmitBuild" }); - - /** - * Calls SubmitBuild. - * @function submitBuild - * @memberof google.cloud.run.v2.Builds - * @instance - * @param {google.cloud.run.v2.ISubmitBuildRequest} request SubmitBuildRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Builds; - })(); - - v2.SubmitBuildRequest = (function() { - - /** - * Properties of a SubmitBuildRequest. - * @memberof google.cloud.run.v2 - * @interface ISubmitBuildRequest - * @property {string|null} [parent] SubmitBuildRequest parent - * @property {google.cloud.run.v2.IStorageSource|null} [storageSource] SubmitBuildRequest storageSource - * @property {string|null} [imageUri] SubmitBuildRequest imageUri - * @property {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null} [buildpackBuild] SubmitBuildRequest buildpackBuild - * @property {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null} [dockerBuild] SubmitBuildRequest dockerBuild - * @property {string|null} [serviceAccount] SubmitBuildRequest serviceAccount - * @property {string|null} [workerPool] SubmitBuildRequest workerPool - * @property {Array.|null} [tags] SubmitBuildRequest tags - * @property {string|null} [machineType] SubmitBuildRequest machineType - * @property {google.api.LaunchStage|null} [releaseTrack] SubmitBuildRequest releaseTrack - * @property {string|null} [client] SubmitBuildRequest client - */ - - /** - * Constructs a new SubmitBuildRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a SubmitBuildRequest. - * @implements ISubmitBuildRequest - * @constructor - * @param {google.cloud.run.v2.ISubmitBuildRequest=} [properties] Properties to set - */ - function SubmitBuildRequest(properties) { - 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]]; - } - - /** - * SubmitBuildRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.parent = ""; - - /** - * SubmitBuildRequest storageSource. - * @member {google.cloud.run.v2.IStorageSource|null|undefined} storageSource - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.storageSource = null; - - /** - * SubmitBuildRequest imageUri. - * @member {string} imageUri - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.imageUri = ""; - - /** - * SubmitBuildRequest buildpackBuild. - * @member {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null|undefined} buildpackBuild - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.buildpackBuild = null; - - /** - * SubmitBuildRequest dockerBuild. - * @member {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null|undefined} dockerBuild - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.dockerBuild = null; - - /** - * SubmitBuildRequest serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.serviceAccount = ""; - - /** - * SubmitBuildRequest workerPool. - * @member {string} workerPool - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.workerPool = ""; - - /** - * SubmitBuildRequest tags. - * @member {Array.} tags - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.tags = $util.emptyArray; - - /** - * SubmitBuildRequest machineType. - * @member {string} machineType - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.machineType = ""; - - /** - * SubmitBuildRequest releaseTrack. - * @member {google.api.LaunchStage} releaseTrack - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.releaseTrack = 0; - - /** - * SubmitBuildRequest client. - * @member {string} client - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.client = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SubmitBuildRequest source. - * @member {"storageSource"|undefined} source - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - Object.defineProperty(SubmitBuildRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["storageSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * SubmitBuildRequest buildType. - * @member {"buildpackBuild"|"dockerBuild"|undefined} buildType - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - Object.defineProperty(SubmitBuildRequest.prototype, "buildType", { - get: $util.oneOfGetter($oneOfFields = ["buildpackBuild", "dockerBuild"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SubmitBuildRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {google.cloud.run.v2.ISubmitBuildRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest instance - */ - SubmitBuildRequest.create = function create(properties) { - return new SubmitBuildRequest(properties); - }; - - /** - * Encodes the specified SubmitBuildRequest message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {google.cloud.run.v2.ISubmitBuildRequest} message SubmitBuildRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubmitBuildRequest.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.storageSource != null && Object.hasOwnProperty.call(message, "storageSource")) - $root.google.cloud.run.v2.StorageSource.encode(message.storageSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); - if (message.buildpackBuild != null && Object.hasOwnProperty.call(message, "buildpackBuild")) - $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.encode(message.buildpackBuild, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.dockerBuild != null && Object.hasOwnProperty.call(message, "dockerBuild")) - $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.encode(message.dockerBuild, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceAccount); - if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.workerPool); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.machineType); - if (message.releaseTrack != null && Object.hasOwnProperty.call(message, "releaseTrack")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.releaseTrack); - if (message.client != null && Object.hasOwnProperty.call(message, "client")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.client); - return writer; - }; - - /** - * Encodes the specified SubmitBuildRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {google.cloud.run.v2.ISubmitBuildRequest} message SubmitBuildRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubmitBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubmitBuildRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubmitBuildRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.storageSource = $root.google.cloud.run.v2.StorageSource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.imageUri = reader.string(); - break; - } - case 4: { - message.buildpackBuild = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.decode(reader, reader.uint32()); - break; - } - case 5: { - message.dockerBuild = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.decode(reader, reader.uint32()); - break; - } - case 6: { - message.serviceAccount = reader.string(); - break; - } - case 7: { - message.workerPool = reader.string(); - break; - } - case 8: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - case 9: { - message.machineType = reader.string(); - break; - } - case 10: { - message.releaseTrack = reader.int32(); - break; - } - case 11: { - message.client = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubmitBuildRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubmitBuildRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubmitBuildRequest message. - * @function verify - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubmitBuildRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.storageSource != null && message.hasOwnProperty("storageSource")) { - properties.source = 1; - { - var error = $root.google.cloud.run.v2.StorageSource.verify(message.storageSource); - if (error) - return "storageSource." + error; - } - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.buildpackBuild != null && message.hasOwnProperty("buildpackBuild")) { - properties.buildType = 1; - { - var error = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify(message.buildpackBuild); - if (error) - return "buildpackBuild." + error; - } - } - if (message.dockerBuild != null && message.hasOwnProperty("dockerBuild")) { - if (properties.buildType === 1) - return "buildType: multiple values"; - properties.buildType = 1; - { - var error = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify(message.dockerBuild); - if (error) - return "dockerBuild." + error; - } - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - if (!$util.isString(message.workerPool)) - return "workerPool: string expected"; - 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"; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.releaseTrack != null && message.hasOwnProperty("releaseTrack")) - switch (message.releaseTrack) { - default: - return "releaseTrack: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.client != null && message.hasOwnProperty("client")) - if (!$util.isString(message.client)) - return "client: string expected"; - return null; - }; - - /** - * Creates a SubmitBuildRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest - */ - SubmitBuildRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SubmitBuildRequest) - return object; - var message = new $root.google.cloud.run.v2.SubmitBuildRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.storageSource != null) { - if (typeof object.storageSource !== "object") - throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.storageSource: object expected"); - message.storageSource = $root.google.cloud.run.v2.StorageSource.fromObject(object.storageSource); - } - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.buildpackBuild != null) { - if (typeof object.buildpackBuild !== "object") - throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.buildpackBuild: object expected"); - message.buildpackBuild = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.fromObject(object.buildpackBuild); - } - if (object.dockerBuild != null) { - if (typeof object.dockerBuild !== "object") - throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.dockerBuild: object expected"); - message.dockerBuild = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.fromObject(object.dockerBuild); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.workerPool != null) - message.workerPool = String(object.workerPool); - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.machineType != null) - message.machineType = String(object.machineType); - switch (object.releaseTrack) { - default: - if (typeof object.releaseTrack === "number") { - message.releaseTrack = object.releaseTrack; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.releaseTrack = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.releaseTrack = 6; - break; - case "PRELAUNCH": - case 7: - message.releaseTrack = 7; - break; - case "EARLY_ACCESS": - case 1: - message.releaseTrack = 1; - break; - case "ALPHA": - case 2: - message.releaseTrack = 2; - break; - case "BETA": - case 3: - message.releaseTrack = 3; - break; - case "GA": - case 4: - message.releaseTrack = 4; - break; - case "DEPRECATED": - case 5: - message.releaseTrack = 5; - break; - } - if (object.client != null) - message.client = String(object.client); - return message; - }; - - /** - * Creates a plain object from a SubmitBuildRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest} message SubmitBuildRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubmitBuildRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tags = []; - if (options.defaults) { - object.parent = ""; - object.imageUri = ""; - object.serviceAccount = ""; - object.workerPool = ""; - object.machineType = ""; - object.releaseTrack = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.client = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.storageSource != null && message.hasOwnProperty("storageSource")) { - object.storageSource = $root.google.cloud.run.v2.StorageSource.toObject(message.storageSource, options); - if (options.oneofs) - object.source = "storageSource"; - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.buildpackBuild != null && message.hasOwnProperty("buildpackBuild")) { - object.buildpackBuild = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.toObject(message.buildpackBuild, options); - if (options.oneofs) - object.buildType = "buildpackBuild"; - } - if (message.dockerBuild != null && message.hasOwnProperty("dockerBuild")) { - object.dockerBuild = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.toObject(message.dockerBuild, options); - if (options.oneofs) - object.buildType = "dockerBuild"; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - object.workerPool = message.workerPool; - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.releaseTrack != null && message.hasOwnProperty("releaseTrack")) - object.releaseTrack = options.enums === String ? $root.google.api.LaunchStage[message.releaseTrack] === undefined ? message.releaseTrack : $root.google.api.LaunchStage[message.releaseTrack] : message.releaseTrack; - if (message.client != null && message.hasOwnProperty("client")) - object.client = message.client; - return object; - }; - - /** - * Converts this SubmitBuildRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - * @returns {Object.} JSON object - */ - SubmitBuildRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubmitBuildRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubmitBuildRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildRequest"; - }; - - SubmitBuildRequest.DockerBuild = (function() { - - /** - * Properties of a DockerBuild. - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @interface IDockerBuild - */ - - /** - * Constructs a new DockerBuild. - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @classdesc Represents a DockerBuild. - * @implements IDockerBuild - * @constructor - * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild=} [properties] Properties to set - */ - function DockerBuild(properties) { - if (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 DockerBuild instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild=} [properties] Properties to set - * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild instance - */ - DockerBuild.create = function create(properties) { - return new DockerBuild(properties); - }; - - /** - * Encodes the specified DockerBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild} message DockerBuild message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DockerBuild.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified DockerBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild} message DockerBuild message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DockerBuild.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DockerBuild message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DockerBuild.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DockerBuild message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DockerBuild.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DockerBuild message. - * @function verify - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DockerBuild.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a DockerBuild message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild - */ - DockerBuild.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild) - return object; - return new $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild(); - }; - - /** - * Creates a plain object from a DockerBuild message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} message DockerBuild - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DockerBuild.toObject = function toObject() { - return {}; - }; - - /** - * Converts this DockerBuild to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @instance - * @returns {Object.} JSON object - */ - DockerBuild.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DockerBuild - * @function getTypeUrl - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DockerBuild.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildRequest.DockerBuild"; - }; - - return DockerBuild; - })(); - - SubmitBuildRequest.BuildpacksBuild = (function() { - - /** - * Properties of a BuildpacksBuild. - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @interface IBuildpacksBuild - * @property {string|null} [runtime] BuildpacksBuild runtime - * @property {string|null} [functionTarget] BuildpacksBuild functionTarget - * @property {string|null} [cacheImageUri] BuildpacksBuild cacheImageUri - * @property {string|null} [baseImage] BuildpacksBuild baseImage - * @property {Object.|null} [environmentVariables] BuildpacksBuild environmentVariables - * @property {boolean|null} [enableAutomaticUpdates] BuildpacksBuild enableAutomaticUpdates - * @property {string|null} [projectDescriptor] BuildpacksBuild projectDescriptor - */ - - /** - * Constructs a new BuildpacksBuild. - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @classdesc Represents a BuildpacksBuild. - * @implements IBuildpacksBuild - * @constructor - * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild=} [properties] Properties to set - */ - function BuildpacksBuild(properties) { - this.environmentVariables = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BuildpacksBuild runtime. - * @member {string} runtime - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.runtime = ""; - - /** - * BuildpacksBuild functionTarget. - * @member {string} functionTarget - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.functionTarget = ""; - - /** - * BuildpacksBuild cacheImageUri. - * @member {string} cacheImageUri - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.cacheImageUri = ""; - - /** - * BuildpacksBuild baseImage. - * @member {string} baseImage - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.baseImage = ""; - - /** - * BuildpacksBuild environmentVariables. - * @member {Object.} environmentVariables - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.environmentVariables = $util.emptyObject; - - /** - * BuildpacksBuild enableAutomaticUpdates. - * @member {boolean} enableAutomaticUpdates - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.enableAutomaticUpdates = false; - - /** - * BuildpacksBuild projectDescriptor. - * @member {string} projectDescriptor - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.projectDescriptor = ""; - - /** - * Creates a new BuildpacksBuild instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild=} [properties] Properties to set - * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild instance - */ - BuildpacksBuild.create = function create(properties) { - return new BuildpacksBuild(properties); - }; - - /** - * Encodes the specified BuildpacksBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild} message BuildpacksBuild message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildpacksBuild.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.runtime != null && Object.hasOwnProperty.call(message, "runtime")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.runtime); - if (message.functionTarget != null && Object.hasOwnProperty.call(message, "functionTarget")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.functionTarget); - if (message.cacheImageUri != null && Object.hasOwnProperty.call(message, "cacheImageUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.cacheImageUri); - if (message.baseImage != null && Object.hasOwnProperty.call(message, "baseImage")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.baseImage); - if (message.environmentVariables != null && Object.hasOwnProperty.call(message, "environmentVariables")) - for (var keys = Object.keys(message.environmentVariables), 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.environmentVariables[keys[i]]).ldelim(); - if (message.enableAutomaticUpdates != null && Object.hasOwnProperty.call(message, "enableAutomaticUpdates")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableAutomaticUpdates); - if (message.projectDescriptor != null && Object.hasOwnProperty.call(message, "projectDescriptor")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.projectDescriptor); - return writer; - }; - - /** - * Encodes the specified BuildpacksBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild} message BuildpacksBuild message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildpacksBuild.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BuildpacksBuild message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildpacksBuild.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.runtime = reader.string(); - break; - } - case 2: { - message.functionTarget = reader.string(); - break; - } - case 3: { - message.cacheImageUri = reader.string(); - break; - } - case 4: { - message.baseImage = reader.string(); - break; - } - case 5: { - if (message.environmentVariables === $util.emptyObject) - message.environmentVariables = {}; - 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.environmentVariables[key] = value; - break; - } - case 6: { - message.enableAutomaticUpdates = reader.bool(); - break; - } - case 7: { - message.projectDescriptor = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BuildpacksBuild message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildpacksBuild.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BuildpacksBuild message. - * @function verify - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BuildpacksBuild.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.runtime != null && message.hasOwnProperty("runtime")) - if (!$util.isString(message.runtime)) - return "runtime: string expected"; - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - if (!$util.isString(message.functionTarget)) - return "functionTarget: string expected"; - if (message.cacheImageUri != null && message.hasOwnProperty("cacheImageUri")) - if (!$util.isString(message.cacheImageUri)) - return "cacheImageUri: string expected"; - if (message.baseImage != null && message.hasOwnProperty("baseImage")) - if (!$util.isString(message.baseImage)) - return "baseImage: string expected"; - if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) { - if (!$util.isObject(message.environmentVariables)) - return "environmentVariables: object expected"; - var key = Object.keys(message.environmentVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.environmentVariables[key[i]])) - return "environmentVariables: string{k:string} expected"; - } - if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) - if (typeof message.enableAutomaticUpdates !== "boolean") - return "enableAutomaticUpdates: boolean expected"; - if (message.projectDescriptor != null && message.hasOwnProperty("projectDescriptor")) - if (!$util.isString(message.projectDescriptor)) - return "projectDescriptor: string expected"; - return null; - }; - - /** - * Creates a BuildpacksBuild message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild - */ - BuildpacksBuild.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild) - return object; - var message = new $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild(); - if (object.runtime != null) - message.runtime = String(object.runtime); - if (object.functionTarget != null) - message.functionTarget = String(object.functionTarget); - if (object.cacheImageUri != null) - message.cacheImageUri = String(object.cacheImageUri); - if (object.baseImage != null) - message.baseImage = String(object.baseImage); - if (object.environmentVariables) { - if (typeof object.environmentVariables !== "object") - throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.environmentVariables: object expected"); - message.environmentVariables = {}; - for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i) - message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]); - } - if (object.enableAutomaticUpdates != null) - message.enableAutomaticUpdates = Boolean(object.enableAutomaticUpdates); - if (object.projectDescriptor != null) - message.projectDescriptor = String(object.projectDescriptor); - return message; - }; - - /** - * Creates a plain object from a BuildpacksBuild message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} message BuildpacksBuild - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BuildpacksBuild.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.environmentVariables = {}; - if (options.defaults) { - object.runtime = ""; - object.functionTarget = ""; - object.cacheImageUri = ""; - object.baseImage = ""; - object.enableAutomaticUpdates = false; - object.projectDescriptor = ""; - } - if (message.runtime != null && message.hasOwnProperty("runtime")) - object.runtime = message.runtime; - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - object.functionTarget = message.functionTarget; - if (message.cacheImageUri != null && message.hasOwnProperty("cacheImageUri")) - object.cacheImageUri = message.cacheImageUri; - if (message.baseImage != null && message.hasOwnProperty("baseImage")) - object.baseImage = message.baseImage; - var keys2; - if (message.environmentVariables && (keys2 = Object.keys(message.environmentVariables)).length) { - object.environmentVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.environmentVariables[keys2[j]] = message.environmentVariables[keys2[j]]; - } - if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) - object.enableAutomaticUpdates = message.enableAutomaticUpdates; - if (message.projectDescriptor != null && message.hasOwnProperty("projectDescriptor")) - object.projectDescriptor = message.projectDescriptor; - return object; - }; - - /** - * Converts this BuildpacksBuild to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - * @returns {Object.} JSON object - */ - BuildpacksBuild.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BuildpacksBuild - * @function getTypeUrl - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BuildpacksBuild.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild"; - }; - - return BuildpacksBuild; - })(); - - return SubmitBuildRequest; - })(); - - v2.SubmitBuildResponse = (function() { - - /** - * Properties of a SubmitBuildResponse. - * @memberof google.cloud.run.v2 - * @interface ISubmitBuildResponse - * @property {google.longrunning.IOperation|null} [buildOperation] SubmitBuildResponse buildOperation - * @property {string|null} [baseImageUri] SubmitBuildResponse baseImageUri - * @property {string|null} [baseImageWarning] SubmitBuildResponse baseImageWarning - */ - - /** - * Constructs a new SubmitBuildResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a SubmitBuildResponse. - * @implements ISubmitBuildResponse - * @constructor - * @param {google.cloud.run.v2.ISubmitBuildResponse=} [properties] Properties to set - */ - function SubmitBuildResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SubmitBuildResponse buildOperation. - * @member {google.longrunning.IOperation|null|undefined} buildOperation - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @instance - */ - SubmitBuildResponse.prototype.buildOperation = null; - - /** - * SubmitBuildResponse baseImageUri. - * @member {string} baseImageUri - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @instance - */ - SubmitBuildResponse.prototype.baseImageUri = ""; - - /** - * SubmitBuildResponse baseImageWarning. - * @member {string} baseImageWarning - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @instance - */ - SubmitBuildResponse.prototype.baseImageWarning = ""; - - /** - * Creates a new SubmitBuildResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {google.cloud.run.v2.ISubmitBuildResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse instance - */ - SubmitBuildResponse.create = function create(properties) { - return new SubmitBuildResponse(properties); - }; - - /** - * Encodes the specified SubmitBuildResponse message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {google.cloud.run.v2.ISubmitBuildResponse} message SubmitBuildResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubmitBuildResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.buildOperation != null && Object.hasOwnProperty.call(message, "buildOperation")) - $root.google.longrunning.Operation.encode(message.buildOperation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.baseImageUri != null && Object.hasOwnProperty.call(message, "baseImageUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseImageUri); - if (message.baseImageWarning != null && Object.hasOwnProperty.call(message, "baseImageWarning")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.baseImageWarning); - return writer; - }; - - /** - * Encodes the specified SubmitBuildResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {google.cloud.run.v2.ISubmitBuildResponse} message SubmitBuildResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubmitBuildResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubmitBuildResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubmitBuildResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.buildOperation = $root.google.longrunning.Operation.decode(reader, reader.uint32()); - break; - } - case 2: { - message.baseImageUri = reader.string(); - break; - } - case 3: { - message.baseImageWarning = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubmitBuildResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubmitBuildResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubmitBuildResponse message. - * @function verify - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubmitBuildResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.buildOperation != null && message.hasOwnProperty("buildOperation")) { - var error = $root.google.longrunning.Operation.verify(message.buildOperation); - if (error) - return "buildOperation." + error; - } - if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) - if (!$util.isString(message.baseImageUri)) - return "baseImageUri: string expected"; - if (message.baseImageWarning != null && message.hasOwnProperty("baseImageWarning")) - if (!$util.isString(message.baseImageWarning)) - return "baseImageWarning: string expected"; - return null; - }; - - /** - * Creates a SubmitBuildResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse - */ - SubmitBuildResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SubmitBuildResponse) - return object; - var message = new $root.google.cloud.run.v2.SubmitBuildResponse(); - if (object.buildOperation != null) { - if (typeof object.buildOperation !== "object") - throw TypeError(".google.cloud.run.v2.SubmitBuildResponse.buildOperation: object expected"); - message.buildOperation = $root.google.longrunning.Operation.fromObject(object.buildOperation); - } - if (object.baseImageUri != null) - message.baseImageUri = String(object.baseImageUri); - if (object.baseImageWarning != null) - message.baseImageWarning = String(object.baseImageWarning); - return message; - }; - - /** - * Creates a plain object from a SubmitBuildResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {google.cloud.run.v2.SubmitBuildResponse} message SubmitBuildResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubmitBuildResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.buildOperation = null; - object.baseImageUri = ""; - object.baseImageWarning = ""; - } - if (message.buildOperation != null && message.hasOwnProperty("buildOperation")) - object.buildOperation = $root.google.longrunning.Operation.toObject(message.buildOperation, options); - if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) - object.baseImageUri = message.baseImageUri; - if (message.baseImageWarning != null && message.hasOwnProperty("baseImageWarning")) - object.baseImageWarning = message.baseImageWarning; - return object; - }; - - /** - * Converts this SubmitBuildResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @instance - * @returns {Object.} JSON object - */ - SubmitBuildResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubmitBuildResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubmitBuildResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildResponse"; - }; - - return SubmitBuildResponse; - })(); - - v2.StorageSource = (function() { - - /** - * Properties of a StorageSource. - * @memberof google.cloud.run.v2 - * @interface IStorageSource - * @property {string|null} [bucket] StorageSource bucket - * @property {string|null} [object] StorageSource object - * @property {number|Long|null} [generation] StorageSource generation - */ - - /** - * Constructs a new StorageSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents a StorageSource. - * @implements IStorageSource - * @constructor - * @param {google.cloud.run.v2.IStorageSource=} [properties] Properties to set - */ - function StorageSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StorageSource bucket. - * @member {string} bucket - * @memberof google.cloud.run.v2.StorageSource - * @instance - */ - StorageSource.prototype.bucket = ""; - - /** - * StorageSource object. - * @member {string} object - * @memberof google.cloud.run.v2.StorageSource - * @instance - */ - StorageSource.prototype.object = ""; - - /** - * StorageSource generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.StorageSource - * @instance - */ - StorageSource.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new StorageSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {google.cloud.run.v2.IStorageSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.StorageSource} StorageSource instance - */ - StorageSource.create = function create(properties) { - return new StorageSource(properties); - }; - - /** - * Encodes the specified StorageSource message. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {google.cloud.run.v2.IStorageSource} message StorageSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StorageSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); - if (message.object != null && Object.hasOwnProperty.call(message, "object")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - return writer; - }; - - /** - * Encodes the specified StorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {google.cloud.run.v2.IStorageSource} message StorageSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StorageSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StorageSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.StorageSource} StorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StorageSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StorageSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bucket = reader.string(); - break; - } - case 2: { - message.object = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StorageSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.StorageSource} StorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StorageSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StorageSource message. - * @function verify - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StorageSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bucket != null && message.hasOwnProperty("bucket")) - if (!$util.isString(message.bucket)) - return "bucket: string expected"; - if (message.object != null && message.hasOwnProperty("object")) - if (!$util.isString(message.object)) - return "object: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - return null; - }; - - /** - * Creates a StorageSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.StorageSource} StorageSource - */ - StorageSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.StorageSource) - return object; - var message = new $root.google.cloud.run.v2.StorageSource(); - if (object.bucket != null) - message.bucket = String(object.bucket); - if (object.object != null) - message.object = String(object.object); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a StorageSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {google.cloud.run.v2.StorageSource} message StorageSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StorageSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.bucket = ""; - object.object = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - } - if (message.bucket != null && message.hasOwnProperty("bucket")) - object.bucket = message.bucket; - if (message.object != null && message.hasOwnProperty("object")) - object.object = message.object; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - return object; - }; - - /** - * Converts this StorageSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.StorageSource - * @instance - * @returns {Object.} JSON object - */ - StorageSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StorageSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StorageSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.StorageSource"; - }; - - return StorageSource; - })(); - - v2.Condition = (function() { - - /** - * Properties of a Condition. - * @memberof google.cloud.run.v2 - * @interface ICondition - * @property {string|null} [type] Condition type - * @property {google.cloud.run.v2.Condition.State|null} [state] Condition state - * @property {string|null} [message] Condition message - * @property {google.protobuf.ITimestamp|null} [lastTransitionTime] Condition lastTransitionTime - * @property {google.cloud.run.v2.Condition.Severity|null} [severity] Condition severity - * @property {google.cloud.run.v2.Condition.CommonReason|null} [reason] Condition reason - * @property {google.cloud.run.v2.Condition.RevisionReason|null} [revisionReason] Condition revisionReason - * @property {google.cloud.run.v2.Condition.ExecutionReason|null} [executionReason] Condition executionReason - */ - - /** - * Constructs a new Condition. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Condition. - * @implements ICondition - * @constructor - * @param {google.cloud.run.v2.ICondition=} [properties] Properties to set - */ - function Condition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Condition type. - * @member {string} type - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.type = ""; - - /** - * Condition state. - * @member {google.cloud.run.v2.Condition.State} state - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.state = 0; - - /** - * Condition message. - * @member {string} message - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.message = ""; - - /** - * Condition lastTransitionTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastTransitionTime - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.lastTransitionTime = null; - - /** - * Condition severity. - * @member {google.cloud.run.v2.Condition.Severity} severity - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.severity = 0; - - /** - * Condition reason. - * @member {google.cloud.run.v2.Condition.CommonReason|null|undefined} reason - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.reason = null; - - /** - * Condition revisionReason. - * @member {google.cloud.run.v2.Condition.RevisionReason|null|undefined} revisionReason - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.revisionReason = null; - - /** - * Condition executionReason. - * @member {google.cloud.run.v2.Condition.ExecutionReason|null|undefined} executionReason - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.executionReason = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Condition reasons. - * @member {"reason"|"revisionReason"|"executionReason"|undefined} reasons - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Object.defineProperty(Condition.prototype, "reasons", { - get: $util.oneOfGetter($oneOfFields = ["reason", "revisionReason", "executionReason"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Condition instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Condition - * @static - * @param {google.cloud.run.v2.ICondition=} [properties] Properties to set - * @returns {google.cloud.run.v2.Condition} Condition instance - */ - Condition.create = function create(properties) { - return new Condition(properties); - }; - - /** - * Encodes the specified Condition message. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Condition - * @static - * @param {google.cloud.run.v2.ICondition} message Condition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Condition.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.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); - if (message.lastTransitionTime != null && Object.hasOwnProperty.call(message, "lastTransitionTime")) - $root.google.protobuf.Timestamp.encode(message.lastTransitionTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.severity); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.reason); - if (message.revisionReason != null && Object.hasOwnProperty.call(message, "revisionReason")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.revisionReason); - if (message.executionReason != null && Object.hasOwnProperty.call(message, "executionReason")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.executionReason); - return writer; - }; - - /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Condition - * @static - * @param {google.cloud.run.v2.ICondition} message Condition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Condition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Condition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Condition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Condition} Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Condition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Condition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.message = reader.string(); - break; - } - case 4: { - message.lastTransitionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.severity = reader.int32(); - break; - } - case 6: { - message.reason = reader.int32(); - break; - } - case 9: { - message.revisionReason = reader.int32(); - break; - } - case 11: { - message.executionReason = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Condition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Condition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Condition} Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Condition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Condition message. - * @function verify - * @memberof google.cloud.run.v2.Condition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Condition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.lastTransitionTime != null && message.hasOwnProperty("lastTransitionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastTransitionTime); - if (error) - return "lastTransitionTime." + error; - } - if (message.severity != null && message.hasOwnProperty("severity")) - switch (message.severity) { - default: - return "severity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.reason != null && message.hasOwnProperty("reason")) { - properties.reasons = 1; - switch (message.reason) { - default: - return "reason: enum value expected"; - case 0: - case 1: - case 3: - case 4: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - break; - } - } - if (message.revisionReason != null && message.hasOwnProperty("revisionReason")) { - if (properties.reasons === 1) - return "reasons: multiple values"; - properties.reasons = 1; - switch (message.revisionReason) { - default: - return "revisionReason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - break; - } - } - if (message.executionReason != null && message.hasOwnProperty("executionReason")) { - if (properties.reasons === 1) - return "reasons: multiple values"; - properties.reasons = 1; - switch (message.executionReason) { - default: - return "executionReason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - } - return null; - }; - - /** - * Creates a Condition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Condition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Condition} Condition - */ - Condition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Condition) - return object; - var message = new $root.google.cloud.run.v2.Condition(); - if (object.type != null) - message.type = String(object.type); - 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 "CONDITION_PENDING": - case 1: - message.state = 1; - break; - case "CONDITION_RECONCILING": - case 2: - message.state = 2; - break; - case "CONDITION_FAILED": - case 3: - message.state = 3; - break; - case "CONDITION_SUCCEEDED": - case 4: - message.state = 4; - break; - } - if (object.message != null) - message.message = String(object.message); - if (object.lastTransitionTime != null) { - if (typeof object.lastTransitionTime !== "object") - throw TypeError(".google.cloud.run.v2.Condition.lastTransitionTime: object expected"); - message.lastTransitionTime = $root.google.protobuf.Timestamp.fromObject(object.lastTransitionTime); - } - switch (object.severity) { - default: - if (typeof object.severity === "number") { - message.severity = object.severity; - break; - } - break; - case "SEVERITY_UNSPECIFIED": - case 0: - message.severity = 0; - break; - case "ERROR": - case 1: - message.severity = 1; - break; - case "WARNING": - case 2: - message.severity = 2; - break; - case "INFO": - case 3: - message.severity = 3; - break; - } - switch (object.reason) { - default: - if (typeof object.reason === "number") { - message.reason = object.reason; - break; - } - break; - case "COMMON_REASON_UNDEFINED": - case 0: - message.reason = 0; - break; - case "UNKNOWN": - case 1: - message.reason = 1; - break; - case "REVISION_FAILED": - case 3: - message.reason = 3; - break; - case "PROGRESS_DEADLINE_EXCEEDED": - case 4: - message.reason = 4; - break; - case "CONTAINER_MISSING": - case 6: - message.reason = 6; - break; - case "CONTAINER_PERMISSION_DENIED": - case 7: - message.reason = 7; - break; - case "CONTAINER_IMAGE_UNAUTHORIZED": - case 8: - message.reason = 8; - break; - case "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED": - case 9: - message.reason = 9; - break; - case "ENCRYPTION_KEY_PERMISSION_DENIED": - case 10: - message.reason = 10; - break; - case "ENCRYPTION_KEY_CHECK_FAILED": - case 11: - message.reason = 11; - break; - case "SECRETS_ACCESS_CHECK_FAILED": - case 12: - message.reason = 12; - break; - case "WAITING_FOR_OPERATION": - case 13: - message.reason = 13; - break; - case "IMMEDIATE_RETRY": - case 14: - message.reason = 14; - break; - case "POSTPONED_RETRY": - case 15: - message.reason = 15; - break; - case "INTERNAL": - case 16: - message.reason = 16; - break; - case "VPC_NETWORK_NOT_FOUND": - case 17: - message.reason = 17; - break; - } - switch (object.revisionReason) { - default: - if (typeof object.revisionReason === "number") { - message.revisionReason = object.revisionReason; - break; - } - break; - case "REVISION_REASON_UNDEFINED": - case 0: - message.revisionReason = 0; - break; - case "PENDING": - case 1: - message.revisionReason = 1; - break; - case "RESERVE": - case 2: - message.revisionReason = 2; - break; - case "RETIRED": - case 3: - message.revisionReason = 3; - break; - case "RETIRING": - case 4: - message.revisionReason = 4; - break; - case "RECREATING": - case 5: - message.revisionReason = 5; - break; - case "HEALTH_CHECK_CONTAINER_ERROR": - case 6: - message.revisionReason = 6; - break; - case "CUSTOMIZED_PATH_RESPONSE_PENDING": - case 7: - message.revisionReason = 7; - break; - case "MIN_INSTANCES_NOT_PROVISIONED": - case 8: - message.revisionReason = 8; - break; - case "ACTIVE_REVISION_LIMIT_REACHED": - case 9: - message.revisionReason = 9; - break; - case "NO_DEPLOYMENT": - case 10: - message.revisionReason = 10; - break; - case "HEALTH_CHECK_SKIPPED": - case 11: - message.revisionReason = 11; - break; - case "MIN_INSTANCES_WARMING": - case 12: - message.revisionReason = 12; - break; - } - switch (object.executionReason) { - default: - if (typeof object.executionReason === "number") { - message.executionReason = object.executionReason; - break; - } - break; - case "EXECUTION_REASON_UNDEFINED": - case 0: - message.executionReason = 0; - break; - case "JOB_STATUS_SERVICE_POLLING_ERROR": - case 1: - message.executionReason = 1; - break; - case "NON_ZERO_EXIT_CODE": - case 2: - message.executionReason = 2; - break; - case "CANCELLED": - case 3: - message.executionReason = 3; - break; - case "CANCELLING": - case 4: - message.executionReason = 4; - break; - case "DELETED": - case 5: - message.executionReason = 5; - break; - case "DELAYED_START_PENDING": - case 6: - message.executionReason = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Condition - * @static - * @param {google.cloud.run.v2.Condition} message Condition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Condition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.message = ""; - object.lastTransitionTime = null; - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.run.v2.Condition.State[message.state] === undefined ? message.state : $root.google.cloud.run.v2.Condition.State[message.state] : message.state; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.lastTransitionTime != null && message.hasOwnProperty("lastTransitionTime")) - object.lastTransitionTime = $root.google.protobuf.Timestamp.toObject(message.lastTransitionTime, options); - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.run.v2.Condition.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.run.v2.Condition.Severity[message.severity] : message.severity; - if (message.reason != null && message.hasOwnProperty("reason")) { - object.reason = options.enums === String ? $root.google.cloud.run.v2.Condition.CommonReason[message.reason] === undefined ? message.reason : $root.google.cloud.run.v2.Condition.CommonReason[message.reason] : message.reason; - if (options.oneofs) - object.reasons = "reason"; - } - if (message.revisionReason != null && message.hasOwnProperty("revisionReason")) { - object.revisionReason = options.enums === String ? $root.google.cloud.run.v2.Condition.RevisionReason[message.revisionReason] === undefined ? message.revisionReason : $root.google.cloud.run.v2.Condition.RevisionReason[message.revisionReason] : message.revisionReason; - if (options.oneofs) - object.reasons = "revisionReason"; - } - if (message.executionReason != null && message.hasOwnProperty("executionReason")) { - object.executionReason = options.enums === String ? $root.google.cloud.run.v2.Condition.ExecutionReason[message.executionReason] === undefined ? message.executionReason : $root.google.cloud.run.v2.Condition.ExecutionReason[message.executionReason] : message.executionReason; - if (options.oneofs) - object.reasons = "executionReason"; - } - return object; - }; - - /** - * Converts this Condition to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Condition - * @instance - * @returns {Object.} JSON object - */ - Condition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Condition - * @function getTypeUrl - * @memberof google.cloud.run.v2.Condition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Condition"; - }; - - /** - * State enum. - * @name google.cloud.run.v2.Condition.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CONDITION_PENDING=1 CONDITION_PENDING value - * @property {number} CONDITION_RECONCILING=2 CONDITION_RECONCILING value - * @property {number} CONDITION_FAILED=3 CONDITION_FAILED value - * @property {number} CONDITION_SUCCEEDED=4 CONDITION_SUCCEEDED value - */ - Condition.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CONDITION_PENDING"] = 1; - values[valuesById[2] = "CONDITION_RECONCILING"] = 2; - values[valuesById[3] = "CONDITION_FAILED"] = 3; - values[valuesById[4] = "CONDITION_SUCCEEDED"] = 4; - return values; - })(); - - /** - * Severity enum. - * @name google.cloud.run.v2.Condition.Severity - * @enum {number} - * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value - * @property {number} ERROR=1 ERROR value - * @property {number} WARNING=2 WARNING value - * @property {number} INFO=3 INFO value - */ - Condition.Severity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ERROR"] = 1; - values[valuesById[2] = "WARNING"] = 2; - values[valuesById[3] = "INFO"] = 3; - return values; - })(); - - /** - * CommonReason enum. - * @name google.cloud.run.v2.Condition.CommonReason - * @enum {number} - * @property {number} COMMON_REASON_UNDEFINED=0 COMMON_REASON_UNDEFINED value - * @property {number} UNKNOWN=1 UNKNOWN value - * @property {number} REVISION_FAILED=3 REVISION_FAILED value - * @property {number} PROGRESS_DEADLINE_EXCEEDED=4 PROGRESS_DEADLINE_EXCEEDED value - * @property {number} CONTAINER_MISSING=6 CONTAINER_MISSING value - * @property {number} CONTAINER_PERMISSION_DENIED=7 CONTAINER_PERMISSION_DENIED value - * @property {number} CONTAINER_IMAGE_UNAUTHORIZED=8 CONTAINER_IMAGE_UNAUTHORIZED value - * @property {number} CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED=9 CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED value - * @property {number} ENCRYPTION_KEY_PERMISSION_DENIED=10 ENCRYPTION_KEY_PERMISSION_DENIED value - * @property {number} ENCRYPTION_KEY_CHECK_FAILED=11 ENCRYPTION_KEY_CHECK_FAILED value - * @property {number} SECRETS_ACCESS_CHECK_FAILED=12 SECRETS_ACCESS_CHECK_FAILED value - * @property {number} WAITING_FOR_OPERATION=13 WAITING_FOR_OPERATION value - * @property {number} IMMEDIATE_RETRY=14 IMMEDIATE_RETRY value - * @property {number} POSTPONED_RETRY=15 POSTPONED_RETRY value - * @property {number} INTERNAL=16 INTERNAL value - * @property {number} VPC_NETWORK_NOT_FOUND=17 VPC_NETWORK_NOT_FOUND value - */ - Condition.CommonReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMMON_REASON_UNDEFINED"] = 0; - values[valuesById[1] = "UNKNOWN"] = 1; - values[valuesById[3] = "REVISION_FAILED"] = 3; - values[valuesById[4] = "PROGRESS_DEADLINE_EXCEEDED"] = 4; - values[valuesById[6] = "CONTAINER_MISSING"] = 6; - values[valuesById[7] = "CONTAINER_PERMISSION_DENIED"] = 7; - values[valuesById[8] = "CONTAINER_IMAGE_UNAUTHORIZED"] = 8; - values[valuesById[9] = "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED"] = 9; - values[valuesById[10] = "ENCRYPTION_KEY_PERMISSION_DENIED"] = 10; - values[valuesById[11] = "ENCRYPTION_KEY_CHECK_FAILED"] = 11; - values[valuesById[12] = "SECRETS_ACCESS_CHECK_FAILED"] = 12; - values[valuesById[13] = "WAITING_FOR_OPERATION"] = 13; - values[valuesById[14] = "IMMEDIATE_RETRY"] = 14; - values[valuesById[15] = "POSTPONED_RETRY"] = 15; - values[valuesById[16] = "INTERNAL"] = 16; - values[valuesById[17] = "VPC_NETWORK_NOT_FOUND"] = 17; - return values; - })(); - - /** - * RevisionReason enum. - * @name google.cloud.run.v2.Condition.RevisionReason - * @enum {number} - * @property {number} REVISION_REASON_UNDEFINED=0 REVISION_REASON_UNDEFINED value - * @property {number} PENDING=1 PENDING value - * @property {number} RESERVE=2 RESERVE value - * @property {number} RETIRED=3 RETIRED value - * @property {number} RETIRING=4 RETIRING value - * @property {number} RECREATING=5 RECREATING value - * @property {number} HEALTH_CHECK_CONTAINER_ERROR=6 HEALTH_CHECK_CONTAINER_ERROR value - * @property {number} CUSTOMIZED_PATH_RESPONSE_PENDING=7 CUSTOMIZED_PATH_RESPONSE_PENDING value - * @property {number} MIN_INSTANCES_NOT_PROVISIONED=8 MIN_INSTANCES_NOT_PROVISIONED value - * @property {number} ACTIVE_REVISION_LIMIT_REACHED=9 ACTIVE_REVISION_LIMIT_REACHED value - * @property {number} NO_DEPLOYMENT=10 NO_DEPLOYMENT value - * @property {number} HEALTH_CHECK_SKIPPED=11 HEALTH_CHECK_SKIPPED value - * @property {number} MIN_INSTANCES_WARMING=12 MIN_INSTANCES_WARMING value - */ - Condition.RevisionReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REVISION_REASON_UNDEFINED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "RESERVE"] = 2; - values[valuesById[3] = "RETIRED"] = 3; - values[valuesById[4] = "RETIRING"] = 4; - values[valuesById[5] = "RECREATING"] = 5; - values[valuesById[6] = "HEALTH_CHECK_CONTAINER_ERROR"] = 6; - values[valuesById[7] = "CUSTOMIZED_PATH_RESPONSE_PENDING"] = 7; - values[valuesById[8] = "MIN_INSTANCES_NOT_PROVISIONED"] = 8; - values[valuesById[9] = "ACTIVE_REVISION_LIMIT_REACHED"] = 9; - values[valuesById[10] = "NO_DEPLOYMENT"] = 10; - values[valuesById[11] = "HEALTH_CHECK_SKIPPED"] = 11; - values[valuesById[12] = "MIN_INSTANCES_WARMING"] = 12; - return values; - })(); - - /** - * ExecutionReason enum. - * @name google.cloud.run.v2.Condition.ExecutionReason - * @enum {number} - * @property {number} EXECUTION_REASON_UNDEFINED=0 EXECUTION_REASON_UNDEFINED value - * @property {number} JOB_STATUS_SERVICE_POLLING_ERROR=1 JOB_STATUS_SERVICE_POLLING_ERROR value - * @property {number} NON_ZERO_EXIT_CODE=2 NON_ZERO_EXIT_CODE value - * @property {number} CANCELLED=3 CANCELLED value - * @property {number} CANCELLING=4 CANCELLING value - * @property {number} DELETED=5 DELETED value - * @property {number} DELAYED_START_PENDING=6 DELAYED_START_PENDING value - */ - Condition.ExecutionReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXECUTION_REASON_UNDEFINED"] = 0; - values[valuesById[1] = "JOB_STATUS_SERVICE_POLLING_ERROR"] = 1; - values[valuesById[2] = "NON_ZERO_EXIT_CODE"] = 2; - values[valuesById[3] = "CANCELLED"] = 3; - values[valuesById[4] = "CANCELLING"] = 4; - values[valuesById[5] = "DELETED"] = 5; - values[valuesById[6] = "DELAYED_START_PENDING"] = 6; - return values; - })(); - - return Condition; - })(); - - v2.ContainerStatus = (function() { - - /** - * Properties of a ContainerStatus. - * @memberof google.cloud.run.v2 - * @interface IContainerStatus - * @property {string|null} [name] ContainerStatus name - * @property {string|null} [imageDigest] ContainerStatus imageDigest - */ - - /** - * Constructs a new ContainerStatus. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ContainerStatus. - * @implements IContainerStatus - * @constructor - * @param {google.cloud.run.v2.IContainerStatus=} [properties] Properties to set - */ - function ContainerStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContainerStatus name. - * @member {string} name - * @memberof google.cloud.run.v2.ContainerStatus - * @instance - */ - ContainerStatus.prototype.name = ""; - - /** - * ContainerStatus imageDigest. - * @member {string} imageDigest - * @memberof google.cloud.run.v2.ContainerStatus - * @instance - */ - ContainerStatus.prototype.imageDigest = ""; - - /** - * Creates a new ContainerStatus instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {google.cloud.run.v2.IContainerStatus=} [properties] Properties to set - * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus instance - */ - ContainerStatus.create = function create(properties) { - return new ContainerStatus(properties); - }; - - /** - * Encodes the specified ContainerStatus message. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {google.cloud.run.v2.IContainerStatus} message ContainerStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.imageDigest != null && Object.hasOwnProperty.call(message, "imageDigest")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageDigest); - return writer; - }; - - /** - * Encodes the specified ContainerStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {google.cloud.run.v2.IContainerStatus} message ContainerStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContainerStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ContainerStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.imageDigest = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContainerStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContainerStatus message. - * @function verify - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContainerStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.imageDigest != null && message.hasOwnProperty("imageDigest")) - if (!$util.isString(message.imageDigest)) - return "imageDigest: string expected"; - return null; - }; - - /** - * Creates a ContainerStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus - */ - ContainerStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ContainerStatus) - return object; - var message = new $root.google.cloud.run.v2.ContainerStatus(); - if (object.name != null) - message.name = String(object.name); - if (object.imageDigest != null) - message.imageDigest = String(object.imageDigest); - return message; - }; - - /** - * Creates a plain object from a ContainerStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {google.cloud.run.v2.ContainerStatus} message ContainerStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContainerStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.imageDigest = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.imageDigest != null && message.hasOwnProperty("imageDigest")) - object.imageDigest = message.imageDigest; - return object; - }; - - /** - * Converts this ContainerStatus to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ContainerStatus - * @instance - * @returns {Object.} JSON object - */ - ContainerStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContainerStatus - * @function getTypeUrl - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContainerStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ContainerStatus"; - }; - - return ContainerStatus; - })(); - - v2.Executions = (function() { - - /** - * Constructs a new Executions service. - * @memberof google.cloud.run.v2 - * @classdesc Represents an Executions - * @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 Executions(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Executions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Executions; - - /** - * Creates new Executions service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Executions - * @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 {Executions} RPC service. Useful where requests and/or responses are streamed. - */ - Executions.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|getExecution}. - * @memberof google.cloud.run.v2.Executions - * @typedef GetExecutionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Execution} [response] Execution - */ - - /** - * Calls GetExecution. - * @function getExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IGetExecutionRequest} request GetExecutionRequest message or plain object - * @param {google.cloud.run.v2.Executions.GetExecutionCallback} callback Node-style callback called with the error, if any, and Execution - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Executions.prototype.getExecution = function getExecution(request, callback) { - return this.rpcCall(getExecution, $root.google.cloud.run.v2.GetExecutionRequest, $root.google.cloud.run.v2.Execution, request, callback); - }, "name", { value: "GetExecution" }); - - /** - * Calls GetExecution. - * @function getExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IGetExecutionRequest} request GetExecutionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|listExecutions}. - * @memberof google.cloud.run.v2.Executions - * @typedef ListExecutionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListExecutionsResponse} [response] ListExecutionsResponse - */ - - /** - * Calls ListExecutions. - * @function listExecutions - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IListExecutionsRequest} request ListExecutionsRequest message or plain object - * @param {google.cloud.run.v2.Executions.ListExecutionsCallback} callback Node-style callback called with the error, if any, and ListExecutionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Executions.prototype.listExecutions = function listExecutions(request, callback) { - return this.rpcCall(listExecutions, $root.google.cloud.run.v2.ListExecutionsRequest, $root.google.cloud.run.v2.ListExecutionsResponse, request, callback); - }, "name", { value: "ListExecutions" }); - - /** - * Calls ListExecutions. - * @function listExecutions - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IListExecutionsRequest} request ListExecutionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|deleteExecution}. - * @memberof google.cloud.run.v2.Executions - * @typedef DeleteExecutionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteExecution. - * @function deleteExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IDeleteExecutionRequest} request DeleteExecutionRequest message or plain object - * @param {google.cloud.run.v2.Executions.DeleteExecutionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Executions.prototype.deleteExecution = function deleteExecution(request, callback) { - return this.rpcCall(deleteExecution, $root.google.cloud.run.v2.DeleteExecutionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteExecution" }); - - /** - * Calls DeleteExecution. - * @function deleteExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IDeleteExecutionRequest} request DeleteExecutionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|cancelExecution}. - * @memberof google.cloud.run.v2.Executions - * @typedef CancelExecutionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CancelExecution. - * @function cancelExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.ICancelExecutionRequest} request CancelExecutionRequest message or plain object - * @param {google.cloud.run.v2.Executions.CancelExecutionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Executions.prototype.cancelExecution = function cancelExecution(request, callback) { - return this.rpcCall(cancelExecution, $root.google.cloud.run.v2.CancelExecutionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CancelExecution" }); - - /** - * Calls CancelExecution. - * @function cancelExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.ICancelExecutionRequest} request CancelExecutionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Executions; - })(); - - v2.GetExecutionRequest = (function() { - - /** - * Properties of a GetExecutionRequest. - * @memberof google.cloud.run.v2 - * @interface IGetExecutionRequest - * @property {string|null} [name] GetExecutionRequest name - */ - - /** - * Constructs a new GetExecutionRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetExecutionRequest. - * @implements IGetExecutionRequest - * @constructor - * @param {google.cloud.run.v2.IGetExecutionRequest=} [properties] Properties to set - */ - function GetExecutionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetExecutionRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.GetExecutionRequest - * @instance - */ - GetExecutionRequest.prototype.name = ""; - - /** - * Creates a new GetExecutionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {google.cloud.run.v2.IGetExecutionRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest instance - */ - GetExecutionRequest.create = function create(properties) { - return new GetExecutionRequest(properties); - }; - - /** - * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {google.cloud.run.v2.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetExecutionRequest.encode = function encode(message, writer) { - 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 GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {google.cloud.run.v2.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetExecutionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetExecutionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetExecutionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetExecutionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetExecutionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetExecutionRequest message. - * @function verify - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetExecutionRequest.verify = function verify(message) { - if (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 GetExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest - */ - GetExecutionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetExecutionRequest) - return object; - var message = new $root.google.cloud.run.v2.GetExecutionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetExecutionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {google.cloud.run.v2.GetExecutionRequest} message GetExecutionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetExecutionRequest.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 GetExecutionRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GetExecutionRequest - * @instance - * @returns {Object.} JSON object - */ - GetExecutionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetExecutionRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetExecutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GetExecutionRequest"; - }; - - return GetExecutionRequest; - })(); - - v2.ListExecutionsRequest = (function() { - - /** - * Properties of a ListExecutionsRequest. - * @memberof google.cloud.run.v2 - * @interface IListExecutionsRequest - * @property {string|null} [parent] ListExecutionsRequest parent - * @property {number|null} [pageSize] ListExecutionsRequest pageSize - * @property {string|null} [pageToken] ListExecutionsRequest pageToken - * @property {boolean|null} [showDeleted] ListExecutionsRequest showDeleted - */ - - /** - * Constructs a new ListExecutionsRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListExecutionsRequest. - * @implements IListExecutionsRequest - * @constructor - * @param {google.cloud.run.v2.IListExecutionsRequest=} [properties] Properties to set - */ - function ListExecutionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListExecutionsRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @instance - */ - ListExecutionsRequest.prototype.parent = ""; - - /** - * ListExecutionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @instance - */ - ListExecutionsRequest.prototype.pageSize = 0; - - /** - * ListExecutionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @instance - */ - ListExecutionsRequest.prototype.pageToken = ""; - - /** - * ListExecutionsRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @instance - */ - ListExecutionsRequest.prototype.showDeleted = false; - - /** - * Creates a new ListExecutionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {google.cloud.run.v2.IListExecutionsRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest instance - */ - ListExecutionsRequest.create = function create(properties) { - return new ListExecutionsRequest(properties); - }; - - /** - * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {google.cloud.run.v2.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExecutionsRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {google.cloud.run.v2.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExecutionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListExecutionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExecutionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListExecutionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListExecutionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExecutionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListExecutionsRequest message. - * @function verify - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListExecutionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListExecutionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest - */ - ListExecutionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListExecutionsRequest) - return object; - var message = new $root.google.cloud.run.v2.ListExecutionsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListExecutionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {google.cloud.run.v2.ListExecutionsRequest} message ListExecutionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListExecutionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListExecutionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListExecutionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListExecutionsRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListExecutionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListExecutionsRequest"; - }; - - return ListExecutionsRequest; - })(); - - v2.ListExecutionsResponse = (function() { - - /** - * Properties of a ListExecutionsResponse. - * @memberof google.cloud.run.v2 - * @interface IListExecutionsResponse - * @property {Array.|null} [executions] ListExecutionsResponse executions - * @property {string|null} [nextPageToken] ListExecutionsResponse nextPageToken - */ - - /** - * Constructs a new ListExecutionsResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListExecutionsResponse. - * @implements IListExecutionsResponse - * @constructor - * @param {google.cloud.run.v2.IListExecutionsResponse=} [properties] Properties to set - */ - function ListExecutionsResponse(properties) { - this.executions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListExecutionsResponse executions. - * @member {Array.} executions - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @instance - */ - ListExecutionsResponse.prototype.executions = $util.emptyArray; - - /** - * ListExecutionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @instance - */ - ListExecutionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListExecutionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {google.cloud.run.v2.IListExecutionsResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse instance - */ - ListExecutionsResponse.create = function create(properties) { - return new ListExecutionsResponse(properties); - }; - - /** - * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {google.cloud.run.v2.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExecutionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.executions != null && message.executions.length) - for (var i = 0; i < message.executions.length; ++i) - $root.google.cloud.run.v2.Execution.encode(message.executions[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 ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {google.cloud.run.v2.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExecutionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListExecutionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExecutionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListExecutionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.executions && message.executions.length)) - message.executions = []; - message.executions.push($root.google.cloud.run.v2.Execution.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListExecutionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExecutionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListExecutionsResponse message. - * @function verify - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListExecutionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.executions != null && message.hasOwnProperty("executions")) { - if (!Array.isArray(message.executions)) - return "executions: array expected"; - for (var i = 0; i < message.executions.length; ++i) { - var error = $root.google.cloud.run.v2.Execution.verify(message.executions[i]); - if (error) - return "executions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListExecutionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse - */ - ListExecutionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListExecutionsResponse) - return object; - var message = new $root.google.cloud.run.v2.ListExecutionsResponse(); - if (object.executions) { - if (!Array.isArray(object.executions)) - throw TypeError(".google.cloud.run.v2.ListExecutionsResponse.executions: array expected"); - message.executions = []; - for (var i = 0; i < object.executions.length; ++i) { - if (typeof object.executions[i] !== "object") - throw TypeError(".google.cloud.run.v2.ListExecutionsResponse.executions: object expected"); - message.executions[i] = $root.google.cloud.run.v2.Execution.fromObject(object.executions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListExecutionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {google.cloud.run.v2.ListExecutionsResponse} message ListExecutionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListExecutionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.executions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.executions && message.executions.length) { - object.executions = []; - for (var j = 0; j < message.executions.length; ++j) - object.executions[j] = $root.google.cloud.run.v2.Execution.toObject(message.executions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListExecutionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListExecutionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListExecutionsResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListExecutionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListExecutionsResponse"; - }; - - return ListExecutionsResponse; - })(); - - v2.DeleteExecutionRequest = (function() { - - /** - * Properties of a DeleteExecutionRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteExecutionRequest - * @property {string|null} [name] DeleteExecutionRequest name - * @property {boolean|null} [validateOnly] DeleteExecutionRequest validateOnly - * @property {string|null} [etag] DeleteExecutionRequest etag - */ - - /** - * Constructs a new DeleteExecutionRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteExecutionRequest. - * @implements IDeleteExecutionRequest - * @constructor - * @param {google.cloud.run.v2.IDeleteExecutionRequest=} [properties] Properties to set - */ - function DeleteExecutionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteExecutionRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @instance - */ - DeleteExecutionRequest.prototype.name = ""; - - /** - * DeleteExecutionRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @instance - */ - DeleteExecutionRequest.prototype.validateOnly = false; - - /** - * DeleteExecutionRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @instance - */ - DeleteExecutionRequest.prototype.etag = ""; - - /** - * Creates a new DeleteExecutionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {google.cloud.run.v2.IDeleteExecutionRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest instance - */ - DeleteExecutionRequest.create = function create(properties) { - return new DeleteExecutionRequest(properties); - }; - - /** - * Encodes the specified DeleteExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {google.cloud.run.v2.IDeleteExecutionRequest} message DeleteExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteExecutionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {google.cloud.run.v2.IDeleteExecutionRequest} message DeleteExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteExecutionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteExecutionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteExecutionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteExecutionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteExecutionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteExecutionRequest message. - * @function verify - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteExecutionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest - */ - DeleteExecutionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteExecutionRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteExecutionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteExecutionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {google.cloud.run.v2.DeleteExecutionRequest} message DeleteExecutionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteExecutionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteExecutionRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteExecutionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteExecutionRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteExecutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.DeleteExecutionRequest"; - }; - - return DeleteExecutionRequest; - })(); - - v2.CancelExecutionRequest = (function() { - - /** - * Properties of a CancelExecutionRequest. - * @memberof google.cloud.run.v2 - * @interface ICancelExecutionRequest - * @property {string|null} [name] CancelExecutionRequest name - * @property {boolean|null} [validateOnly] CancelExecutionRequest validateOnly - * @property {string|null} [etag] CancelExecutionRequest etag - */ - - /** - * Constructs a new CancelExecutionRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CancelExecutionRequest. - * @implements ICancelExecutionRequest - * @constructor - * @param {google.cloud.run.v2.ICancelExecutionRequest=} [properties] Properties to set - */ - function CancelExecutionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelExecutionRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @instance - */ - CancelExecutionRequest.prototype.name = ""; - - /** - * CancelExecutionRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @instance - */ - CancelExecutionRequest.prototype.validateOnly = false; - - /** - * CancelExecutionRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @instance - */ - CancelExecutionRequest.prototype.etag = ""; - - /** - * Creates a new CancelExecutionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {google.cloud.run.v2.ICancelExecutionRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest instance - */ - CancelExecutionRequest.create = function create(properties) { - return new CancelExecutionRequest(properties); - }; - - /** - * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {google.cloud.run.v2.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelExecutionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {google.cloud.run.v2.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelExecutionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelExecutionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CancelExecutionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelExecutionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelExecutionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelExecutionRequest message. - * @function verify - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelExecutionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a CancelExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest - */ - CancelExecutionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CancelExecutionRequest) - return object; - var message = new $root.google.cloud.run.v2.CancelExecutionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {google.cloud.run.v2.CancelExecutionRequest} message CancelExecutionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelExecutionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this CancelExecutionRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @instance - * @returns {Object.} JSON object - */ - CancelExecutionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelExecutionRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelExecutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.CancelExecutionRequest"; - }; - - return CancelExecutionRequest; - })(); - - v2.Execution = (function() { - - /** - * Properties of an Execution. - * @memberof google.cloud.run.v2 - * @interface IExecution - * @property {string|null} [name] Execution name - * @property {string|null} [uid] Execution uid - * @property {string|null} [creator] Execution creator - * @property {number|Long|null} [generation] Execution generation - * @property {Object.|null} [labels] Execution labels - * @property {Object.|null} [annotations] Execution annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Execution createTime - * @property {google.protobuf.ITimestamp|null} [startTime] Execution startTime - * @property {google.protobuf.ITimestamp|null} [completionTime] Execution completionTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Execution updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Execution deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Execution expireTime - * @property {google.api.LaunchStage|null} [launchStage] Execution launchStage - * @property {string|null} [job] Execution job - * @property {number|null} [parallelism] Execution parallelism - * @property {number|null} [taskCount] Execution taskCount - * @property {google.cloud.run.v2.ITaskTemplate|null} [template] Execution template - * @property {boolean|null} [reconciling] Execution reconciling - * @property {Array.|null} [conditions] Execution conditions - * @property {number|Long|null} [observedGeneration] Execution observedGeneration - * @property {number|null} [runningCount] Execution runningCount - * @property {number|null} [succeededCount] Execution succeededCount - * @property {number|null} [failedCount] Execution failedCount - * @property {number|null} [cancelledCount] Execution cancelledCount - * @property {number|null} [retriedCount] Execution retriedCount - * @property {string|null} [logUri] Execution logUri - * @property {boolean|null} [satisfiesPzs] Execution satisfiesPzs - * @property {string|null} [etag] Execution etag - */ - - /** - * Constructs a new Execution. - * @memberof google.cloud.run.v2 - * @classdesc Represents an Execution. - * @implements IExecution - * @constructor - * @param {google.cloud.run.v2.IExecution=} [properties] Properties to set - */ - function Execution(properties) { - this.labels = {}; - this.annotations = {}; - this.conditions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Execution name. - * @member {string} name - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.name = ""; - - /** - * Execution uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.uid = ""; - - /** - * Execution creator. - * @member {string} creator - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.creator = ""; - - /** - * Execution generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Execution labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.labels = $util.emptyObject; - - /** - * Execution annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.annotations = $util.emptyObject; - - /** - * Execution createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.createTime = null; - - /** - * Execution startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.startTime = null; - - /** - * Execution completionTime. - * @member {google.protobuf.ITimestamp|null|undefined} completionTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.completionTime = null; - - /** - * Execution updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.updateTime = null; - - /** - * Execution deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.deleteTime = null; - - /** - * Execution expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.expireTime = null; - - /** - * Execution launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.launchStage = 0; - - /** - * Execution job. - * @member {string} job - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.job = ""; - - /** - * Execution parallelism. - * @member {number} parallelism - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.parallelism = 0; - - /** - * Execution taskCount. - * @member {number} taskCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.taskCount = 0; - - /** - * Execution template. - * @member {google.cloud.run.v2.ITaskTemplate|null|undefined} template - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.template = null; - - /** - * Execution reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.reconciling = false; - - /** - * Execution conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.conditions = $util.emptyArray; - - /** - * Execution observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Execution runningCount. - * @member {number} runningCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.runningCount = 0; - - /** - * Execution succeededCount. - * @member {number} succeededCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.succeededCount = 0; - - /** - * Execution failedCount. - * @member {number} failedCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.failedCount = 0; - - /** - * Execution cancelledCount. - * @member {number} cancelledCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.cancelledCount = 0; - - /** - * Execution retriedCount. - * @member {number} retriedCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.retriedCount = 0; - - /** - * Execution logUri. - * @member {string} logUri - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.logUri = ""; - - /** - * Execution satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.satisfiesPzs = false; - - /** - * Execution etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.etag = ""; - - /** - * Creates a new Execution instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Execution - * @static - * @param {google.cloud.run.v2.IExecution=} [properties] Properties to set - * @returns {google.cloud.run.v2.Execution} Execution instance - */ - Execution.create = function create(properties) { - return new Execution(properties); - }; - - /** - * Encodes the specified Execution message. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Execution - * @static - * @param {google.cloud.run.v2.IExecution} message Execution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Execution.encode = function encode(message, writer) { - if (!writer) - 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.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) - $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.launchStage); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.job); - if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.parallelism); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.taskCount); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.run.v2.TaskTemplate.encode(message.template, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 18, wireType 0 =*/144).int64(message.observedGeneration); - if (message.runningCount != null && Object.hasOwnProperty.call(message, "runningCount")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.runningCount); - if (message.succeededCount != null && Object.hasOwnProperty.call(message, "succeededCount")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.succeededCount); - if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount")) - writer.uint32(/* id 21, wireType 0 =*/168).int32(message.failedCount); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.cancelledCount != null && Object.hasOwnProperty.call(message, "cancelledCount")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.cancelledCount); - if (message.retriedCount != null && Object.hasOwnProperty.call(message, "retriedCount")) - writer.uint32(/* id 25, wireType 0 =*/200).int32(message.retriedCount); - if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) - writer.uint32(/* id 26, wireType 2 =*/210).string(message.logUri); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.satisfiesPzs); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 32, wireType 2 =*/258).string(message.creator); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Execution - * @static - * @param {google.cloud.run.v2.IExecution} message Execution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Execution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Execution message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Execution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Execution} Execution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Execution.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Execution(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 32: { - message.creator = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 5: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 22: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.launchStage = reader.int32(); - break; - } - case 12: { - message.job = reader.string(); - break; - } - case 13: { - message.parallelism = reader.int32(); - break; - } - case 14: { - message.taskCount = reader.int32(); - break; - } - case 15: { - message.template = $root.google.cloud.run.v2.TaskTemplate.decode(reader, reader.uint32()); - break; - } - case 16: { - message.reconciling = reader.bool(); - break; - } - case 17: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 18: { - message.observedGeneration = reader.int64(); - break; - } - case 19: { - message.runningCount = reader.int32(); - break; - } - case 20: { - message.succeededCount = reader.int32(); - break; - } - case 21: { - message.failedCount = reader.int32(); - break; - } - case 24: { - message.cancelledCount = reader.int32(); - break; - } - case 25: { - message.retriedCount = reader.int32(); - break; - } - case 26: { - message.logUri = reader.string(); - break; - } - case 27: { - message.satisfiesPzs = reader.bool(); - break; - } - case 99: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Execution message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Execution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Execution} Execution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Execution.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Execution message. - * @function verify - * @memberof google.cloud.run.v2.Execution - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Execution.verify = function verify(message) { - if (typeof message !== "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.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.completionTime != null && message.hasOwnProperty("completionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.completionTime); - if (error) - return "completionTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - 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.job != null && message.hasOwnProperty("job")) - if (!$util.isString(message.job)) - return "job: string expected"; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (!$util.isInteger(message.parallelism)) - return "parallelism: integer expected"; - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount)) - return "taskCount: integer expected"; - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.run.v2.TaskTemplate.verify(message.template); - if (error) - return "template." + error; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.runningCount != null && message.hasOwnProperty("runningCount")) - if (!$util.isInteger(message.runningCount)) - return "runningCount: integer expected"; - if (message.succeededCount != null && message.hasOwnProperty("succeededCount")) - if (!$util.isInteger(message.succeededCount)) - return "succeededCount: integer expected"; - if (message.failedCount != null && message.hasOwnProperty("failedCount")) - if (!$util.isInteger(message.failedCount)) - return "failedCount: integer expected"; - if (message.cancelledCount != null && message.hasOwnProperty("cancelledCount")) - if (!$util.isInteger(message.cancelledCount)) - return "cancelledCount: integer expected"; - if (message.retriedCount != null && message.hasOwnProperty("retriedCount")) - if (!$util.isInteger(message.retriedCount)) - return "retriedCount: integer expected"; - if (message.logUri != null && message.hasOwnProperty("logUri")) - if (!$util.isString(message.logUri)) - return "logUri: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an Execution message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Execution - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Execution} Execution - */ - Execution.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Execution) - return object; - var message = new $root.google.cloud.run.v2.Execution(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.creator != null) - message.creator = String(object.creator); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.Execution.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Execution.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.completionTime != null) { - if (typeof object.completionTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.completionTime: object expected"); - message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - 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.job != null) - message.job = String(object.job); - if (object.parallelism != null) - message.parallelism = object.parallelism | 0; - if (object.taskCount != null) - message.taskCount = object.taskCount | 0; - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.run.v2.Execution.template: object expected"); - message.template = $root.google.cloud.run.v2.TaskTemplate.fromObject(object.template); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Execution.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Execution.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.runningCount != null) - message.runningCount = object.runningCount | 0; - if (object.succeededCount != null) - message.succeededCount = object.succeededCount | 0; - if (object.failedCount != null) - message.failedCount = object.failedCount | 0; - if (object.cancelledCount != null) - message.cancelledCount = object.cancelledCount | 0; - if (object.retriedCount != null) - message.retriedCount = object.retriedCount | 0; - if (object.logUri != null) - message.logUri = String(object.logUri); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an Execution message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Execution - * @static - * @param {google.cloud.run.v2.Execution} message Execution - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Execution.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conditions = []; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.completionTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.job = ""; - object.parallelism = 0; - object.taskCount = 0; - object.template = null; - object.reconciling = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.runningCount = 0; - object.succeededCount = 0; - object.failedCount = 0; - object.startTime = null; - object.cancelledCount = 0; - object.retriedCount = 0; - object.logUri = ""; - object.satisfiesPzs = false; - object.creator = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.completionTime != null && message.hasOwnProperty("completionTime")) - object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - 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.job != null && message.hasOwnProperty("job")) - object.job = message.job; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - object.parallelism = message.parallelism; - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - object.taskCount = message.taskCount; - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.run.v2.TaskTemplate.toObject(message.template, options); - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.runningCount != null && message.hasOwnProperty("runningCount")) - object.runningCount = message.runningCount; - if (message.succeededCount != null && message.hasOwnProperty("succeededCount")) - object.succeededCount = message.succeededCount; - if (message.failedCount != null && message.hasOwnProperty("failedCount")) - object.failedCount = message.failedCount; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelledCount != null && message.hasOwnProperty("cancelledCount")) - object.cancelledCount = message.cancelledCount; - if (message.retriedCount != null && message.hasOwnProperty("retriedCount")) - object.retriedCount = message.retriedCount; - if (message.logUri != null && message.hasOwnProperty("logUri")) - object.logUri = message.logUri; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Execution to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Execution - * @instance - * @returns {Object.} JSON object - */ - Execution.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Execution - * @function getTypeUrl - * @memberof google.cloud.run.v2.Execution - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Execution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Execution"; - }; - - return Execution; - })(); - - v2.TaskTemplate = (function() { - - /** - * Properties of a TaskTemplate. - * @memberof google.cloud.run.v2 - * @interface ITaskTemplate - * @property {Array.|null} [containers] TaskTemplate containers - * @property {Array.|null} [volumes] TaskTemplate volumes - * @property {number|null} [maxRetries] TaskTemplate maxRetries - * @property {google.protobuf.IDuration|null} [timeout] TaskTemplate timeout - * @property {string|null} [serviceAccount] TaskTemplate serviceAccount - * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] TaskTemplate executionEnvironment - * @property {string|null} [encryptionKey] TaskTemplate encryptionKey - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] TaskTemplate vpcAccess - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] TaskTemplate nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] TaskTemplate gpuZonalRedundancyDisabled - */ - - /** - * Constructs a new TaskTemplate. - * @memberof google.cloud.run.v2 - * @classdesc Represents a TaskTemplate. - * @implements ITaskTemplate - * @constructor - * @param {google.cloud.run.v2.ITaskTemplate=} [properties] Properties to set - */ - function TaskTemplate(properties) { - this.containers = []; - 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]]; - } - - /** - * TaskTemplate containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.containers = $util.emptyArray; - - /** - * TaskTemplate volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.volumes = $util.emptyArray; - - /** - * TaskTemplate maxRetries. - * @member {number|null|undefined} maxRetries - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.maxRetries = null; - - /** - * TaskTemplate timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.timeout = null; - - /** - * TaskTemplate serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.serviceAccount = ""; - - /** - * TaskTemplate executionEnvironment. - * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.executionEnvironment = 0; - - /** - * TaskTemplate encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.encryptionKey = ""; - - /** - * TaskTemplate vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.vpcAccess = null; - - /** - * TaskTemplate nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.nodeSelector = null; - - /** - * TaskTemplate gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.gpuZonalRedundancyDisabled = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TaskTemplate retries. - * @member {"maxRetries"|undefined} retries - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - Object.defineProperty(TaskTemplate.prototype, "retries", { - get: $util.oneOfGetter($oneOfFields = ["maxRetries"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(TaskTemplate.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TaskTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {google.cloud.run.v2.ITaskTemplate=} [properties] Properties to set - * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate instance - */ - TaskTemplate.create = function create(properties) { - return new TaskTemplate(properties); - }; - - /** - * Encodes the specified TaskTemplate message. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {google.cloud.run.v2.ITaskTemplate} message TaskTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.maxRetries != null && Object.hasOwnProperty.call(message, "maxRetries")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxRetries); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); - if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.executionEnvironment); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.encryptionKey); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.gpuZonalRedundancyDisabled); - return writer; - }; - - /** - * Encodes the specified TaskTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {google.cloud.run.v2.ITaskTemplate} message TaskTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TaskTemplate(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 3: { - message.maxRetries = reader.int32(); - break; - } - case 4: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.serviceAccount = reader.string(); - break; - } - case 6: { - message.executionEnvironment = reader.int32(); - break; - } - case 7: { - message.encryptionKey = reader.string(); - break; - } - case 8: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 11: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 12: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskTemplate message. - * @function verify - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) { - properties.retries = 1; - if (!$util.isInteger(message.maxRetries)) - return "maxRetries: integer expected"; - } - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - switch (message.executionEnvironment) { - default: - return "executionEnvironment: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - return null; - }; - - /** - * Creates a TaskTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate - */ - TaskTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.TaskTemplate) - return object; - var message = new $root.google.cloud.run.v2.TaskTemplate(); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.TaskTemplate.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.TaskTemplate.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.TaskTemplate.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.TaskTemplate.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - if (object.maxRetries != null) - message.maxRetries = object.maxRetries | 0; - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.run.v2.TaskTemplate.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - switch (object.executionEnvironment) { - default: - if (typeof object.executionEnvironment === "number") { - message.executionEnvironment = object.executionEnvironment; - break; - } - break; - case "EXECUTION_ENVIRONMENT_UNSPECIFIED": - case 0: - message.executionEnvironment = 0; - break; - case "EXECUTION_ENVIRONMENT_GEN1": - case 1: - message.executionEnvironment = 1; - break; - case "EXECUTION_ENVIRONMENT_GEN2": - case 2: - message.executionEnvironment = 2; - break; - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.TaskTemplate.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.TaskTemplate.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - return message; - }; - - /** - * Creates a plain object from a TaskTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {google.cloud.run.v2.TaskTemplate} message TaskTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - } - if (options.defaults) { - object.timeout = null; - object.serviceAccount = ""; - object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; - object.encryptionKey = ""; - object.vpcAccess = null; - object.nodeSelector = null; - } - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) { - object.maxRetries = message.maxRetries; - if (options.oneofs) - object.retries = "maxRetries"; - } - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - return object; - }; - - /** - * Converts this TaskTemplate to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - * @returns {Object.} JSON object - */ - TaskTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskTemplate - * @function getTypeUrl - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.TaskTemplate"; - }; - - return TaskTemplate; - })(); - - v2.Container = (function() { - - /** - * Properties of a Container. - * @memberof google.cloud.run.v2 - * @interface IContainer - * @property {string|null} [name] Container name - * @property {string|null} [image] Container image - * @property {google.cloud.run.v2.ISourceCode|null} [sourceCode] Container sourceCode - * @property {Array.|null} [command] Container command - * @property {Array.|null} [args] Container args - * @property {Array.|null} [env] Container env - * @property {google.cloud.run.v2.IResourceRequirements|null} [resources] Container resources - * @property {Array.|null} [ports] Container ports - * @property {Array.|null} [volumeMounts] Container volumeMounts - * @property {string|null} [workingDir] Container workingDir - * @property {google.cloud.run.v2.IProbe|null} [livenessProbe] Container livenessProbe - * @property {google.cloud.run.v2.IProbe|null} [startupProbe] Container startupProbe - * @property {google.cloud.run.v2.IProbe|null} [readinessProbe] Container readinessProbe - * @property {Array.|null} [dependsOn] Container dependsOn - * @property {string|null} [baseImageUri] Container baseImageUri - * @property {google.cloud.run.v2.IBuildInfo|null} [buildInfo] Container buildInfo - */ - - /** - * Constructs a new Container. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Container. - * @implements IContainer - * @constructor - * @param {google.cloud.run.v2.IContainer=} [properties] Properties to set - */ - function Container(properties) { - this.command = []; - this.args = []; - this.env = []; - this.ports = []; - this.volumeMounts = []; - this.dependsOn = []; - if (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 name. - * @member {string} name - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.name = ""; - - /** - * Container image. - * @member {string} image - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.image = ""; - - /** - * Container sourceCode. - * @member {google.cloud.run.v2.ISourceCode|null|undefined} sourceCode - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.sourceCode = null; - - /** - * Container command. - * @member {Array.} command - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.command = $util.emptyArray; - - /** - * Container args. - * @member {Array.} args - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.args = $util.emptyArray; - - /** - * Container env. - * @member {Array.} env - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.env = $util.emptyArray; - - /** - * Container resources. - * @member {google.cloud.run.v2.IResourceRequirements|null|undefined} resources - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.resources = null; - - /** - * Container ports. - * @member {Array.} ports - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.ports = $util.emptyArray; - - /** - * Container volumeMounts. - * @member {Array.} volumeMounts - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.volumeMounts = $util.emptyArray; - - /** - * Container workingDir. - * @member {string} workingDir - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.workingDir = ""; - - /** - * Container livenessProbe. - * @member {google.cloud.run.v2.IProbe|null|undefined} livenessProbe - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.livenessProbe = null; - - /** - * Container startupProbe. - * @member {google.cloud.run.v2.IProbe|null|undefined} startupProbe - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.startupProbe = null; - - /** - * Container readinessProbe. - * @member {google.cloud.run.v2.IProbe|null|undefined} readinessProbe - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.readinessProbe = null; - - /** - * Container dependsOn. - * @member {Array.} dependsOn - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.dependsOn = $util.emptyArray; - - /** - * Container baseImageUri. - * @member {string} baseImageUri - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.baseImageUri = ""; - - /** - * Container buildInfo. - * @member {google.cloud.run.v2.IBuildInfo|null|undefined} buildInfo - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.buildInfo = null; - - /** - * Creates a new Container instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Container - * @static - * @param {google.cloud.run.v2.IContainer=} [properties] Properties to set - * @returns {google.cloud.run.v2.Container} Container instance - */ - Container.create = function create(properties) { - return new Container(properties); - }; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.run.v2.Container.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Container - * @static - * @param {google.cloud.run.v2.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.image); - if (message.command != null && message.command.length) - for (var i = 0; i < message.command.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.command[i]); - if (message.args != null && message.args.length) - for (var i = 0; i < message.args.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.args[i]); - if (message.env != null && message.env.length) - for (var i = 0; i < message.env.length; ++i) - $root.google.cloud.run.v2.EnvVar.encode(message.env[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.resources != null && Object.hasOwnProperty.call(message, "resources")) - $root.google.cloud.run.v2.ResourceRequirements.encode(message.resources, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.ports != null && message.ports.length) - for (var i = 0; i < message.ports.length; ++i) - $root.google.cloud.run.v2.ContainerPort.encode(message.ports[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.volumeMounts != null && message.volumeMounts.length) - for (var i = 0; i < message.volumeMounts.length; ++i) - $root.google.cloud.run.v2.VolumeMount.encode(message.volumeMounts[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.workingDir != null && Object.hasOwnProperty.call(message, "workingDir")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.workingDir); - if (message.livenessProbe != null && Object.hasOwnProperty.call(message, "livenessProbe")) - $root.google.cloud.run.v2.Probe.encode(message.livenessProbe, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.startupProbe != null && Object.hasOwnProperty.call(message, "startupProbe")) - $root.google.cloud.run.v2.Probe.encode(message.startupProbe, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.dependsOn != null && message.dependsOn.length) - for (var i = 0; i < message.dependsOn.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.dependsOn[i]); - if (message.baseImageUri != null && Object.hasOwnProperty.call(message, "baseImageUri")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.baseImageUri); - if (message.readinessProbe != null && Object.hasOwnProperty.call(message, "readinessProbe")) - $root.google.cloud.run.v2.Probe.encode(message.readinessProbe, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.buildInfo != null && Object.hasOwnProperty.call(message, "buildInfo")) - $root.google.cloud.run.v2.BuildInfo.encode(message.buildInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.sourceCode != null && Object.hasOwnProperty.call(message, "sourceCode")) - $root.google.cloud.run.v2.SourceCode.encode(message.sourceCode, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.run.v2.Container.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Container - * @static - * @param {google.cloud.run.v2.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.run.v2.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Container(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.image = reader.string(); - break; - } - case 17: { - message.sourceCode = $root.google.cloud.run.v2.SourceCode.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.command && message.command.length)) - message.command = []; - message.command.push(reader.string()); - break; - } - case 4: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 5: { - if (!(message.env && message.env.length)) - message.env = []; - message.env.push($root.google.cloud.run.v2.EnvVar.decode(reader, reader.uint32())); - break; - } - case 6: { - message.resources = $root.google.cloud.run.v2.ResourceRequirements.decode(reader, reader.uint32()); - break; - } - case 7: { - if (!(message.ports && message.ports.length)) - message.ports = []; - message.ports.push($root.google.cloud.run.v2.ContainerPort.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.volumeMounts && message.volumeMounts.length)) - message.volumeMounts = []; - message.volumeMounts.push($root.google.cloud.run.v2.VolumeMount.decode(reader, reader.uint32())); - break; - } - case 9: { - message.workingDir = reader.string(); - break; - } - case 10: { - message.livenessProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); - break; - } - case 11: { - message.startupProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); - break; - } - case 14: { - message.readinessProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); - break; - } - case 12: { - if (!(message.dependsOn && message.dependsOn.length)) - message.dependsOn = []; - message.dependsOn.push(reader.string()); - break; - } - case 13: { - message.baseImageUri = reader.string(); - break; - } - case 15: { - message.buildInfo = $root.google.cloud.run.v2.BuildInfo.decode(reader, reader.uint32()); - 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.run.v2.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.image != null && message.hasOwnProperty("image")) - if (!$util.isString(message.image)) - return "image: string expected"; - if (message.sourceCode != null && message.hasOwnProperty("sourceCode")) { - var error = $root.google.cloud.run.v2.SourceCode.verify(message.sourceCode); - if (error) - return "sourceCode." + error; - } - if (message.command != null && message.hasOwnProperty("command")) { - if (!Array.isArray(message.command)) - return "command: array expected"; - for (var i = 0; i < message.command.length; ++i) - if (!$util.isString(message.command[i])) - return "command: string[] expected"; - } - if (message.args != null && message.hasOwnProperty("args")) { - if (!Array.isArray(message.args)) - return "args: array expected"; - for (var i = 0; i < message.args.length; ++i) - if (!$util.isString(message.args[i])) - return "args: string[] expected"; - } - if (message.env != null && message.hasOwnProperty("env")) { - if (!Array.isArray(message.env)) - return "env: array expected"; - for (var i = 0; i < message.env.length; ++i) { - var error = $root.google.cloud.run.v2.EnvVar.verify(message.env[i]); - if (error) - return "env." + error; - } - } - if (message.resources != null && message.hasOwnProperty("resources")) { - var error = $root.google.cloud.run.v2.ResourceRequirements.verify(message.resources); - if (error) - return "resources." + error; - } - if (message.ports != null && message.hasOwnProperty("ports")) { - if (!Array.isArray(message.ports)) - return "ports: array expected"; - for (var i = 0; i < message.ports.length; ++i) { - var error = $root.google.cloud.run.v2.ContainerPort.verify(message.ports[i]); - if (error) - return "ports." + error; - } - } - if (message.volumeMounts != null && message.hasOwnProperty("volumeMounts")) { - if (!Array.isArray(message.volumeMounts)) - return "volumeMounts: array expected"; - for (var i = 0; i < message.volumeMounts.length; ++i) { - var error = $root.google.cloud.run.v2.VolumeMount.verify(message.volumeMounts[i]); - if (error) - return "volumeMounts." + error; - } - } - if (message.workingDir != null && message.hasOwnProperty("workingDir")) - if (!$util.isString(message.workingDir)) - return "workingDir: string expected"; - if (message.livenessProbe != null && message.hasOwnProperty("livenessProbe")) { - var error = $root.google.cloud.run.v2.Probe.verify(message.livenessProbe); - if (error) - return "livenessProbe." + error; - } - if (message.startupProbe != null && message.hasOwnProperty("startupProbe")) { - var error = $root.google.cloud.run.v2.Probe.verify(message.startupProbe); - if (error) - return "startupProbe." + error; - } - if (message.readinessProbe != null && message.hasOwnProperty("readinessProbe")) { - var error = $root.google.cloud.run.v2.Probe.verify(message.readinessProbe); - if (error) - return "readinessProbe." + error; - } - if (message.dependsOn != null && message.hasOwnProperty("dependsOn")) { - if (!Array.isArray(message.dependsOn)) - return "dependsOn: array expected"; - for (var i = 0; i < message.dependsOn.length; ++i) - if (!$util.isString(message.dependsOn[i])) - return "dependsOn: string[] expected"; - } - if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) - if (!$util.isString(message.baseImageUri)) - return "baseImageUri: string expected"; - if (message.buildInfo != null && message.hasOwnProperty("buildInfo")) { - var error = $root.google.cloud.run.v2.BuildInfo.verify(message.buildInfo); - if (error) - return "buildInfo." + error; - } - return null; - }; - - /** - * Creates a Container message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Container - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Container} Container - */ - Container.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Container) - return object; - var message = new $root.google.cloud.run.v2.Container(); - if (object.name != null) - message.name = String(object.name); - if (object.image != null) - message.image = String(object.image); - if (object.sourceCode != null) { - if (typeof object.sourceCode !== "object") - throw TypeError(".google.cloud.run.v2.Container.sourceCode: object expected"); - message.sourceCode = $root.google.cloud.run.v2.SourceCode.fromObject(object.sourceCode); - } - if (object.command) { - if (!Array.isArray(object.command)) - throw TypeError(".google.cloud.run.v2.Container.command: array expected"); - message.command = []; - for (var i = 0; i < object.command.length; ++i) - message.command[i] = String(object.command[i]); - } - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.run.v2.Container.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.env) { - if (!Array.isArray(object.env)) - throw TypeError(".google.cloud.run.v2.Container.env: array expected"); - message.env = []; - for (var i = 0; i < object.env.length; ++i) { - if (typeof object.env[i] !== "object") - throw TypeError(".google.cloud.run.v2.Container.env: object expected"); - message.env[i] = $root.google.cloud.run.v2.EnvVar.fromObject(object.env[i]); - } - } - if (object.resources != null) { - if (typeof object.resources !== "object") - throw TypeError(".google.cloud.run.v2.Container.resources: object expected"); - message.resources = $root.google.cloud.run.v2.ResourceRequirements.fromObject(object.resources); - } - if (object.ports) { - if (!Array.isArray(object.ports)) - throw TypeError(".google.cloud.run.v2.Container.ports: array expected"); - message.ports = []; - for (var i = 0; i < object.ports.length; ++i) { - if (typeof object.ports[i] !== "object") - throw TypeError(".google.cloud.run.v2.Container.ports: object expected"); - message.ports[i] = $root.google.cloud.run.v2.ContainerPort.fromObject(object.ports[i]); - } - } - if (object.volumeMounts) { - if (!Array.isArray(object.volumeMounts)) - throw TypeError(".google.cloud.run.v2.Container.volumeMounts: array expected"); - message.volumeMounts = []; - for (var i = 0; i < object.volumeMounts.length; ++i) { - if (typeof object.volumeMounts[i] !== "object") - throw TypeError(".google.cloud.run.v2.Container.volumeMounts: object expected"); - message.volumeMounts[i] = $root.google.cloud.run.v2.VolumeMount.fromObject(object.volumeMounts[i]); - } - } - if (object.workingDir != null) - message.workingDir = String(object.workingDir); - if (object.livenessProbe != null) { - if (typeof object.livenessProbe !== "object") - throw TypeError(".google.cloud.run.v2.Container.livenessProbe: object expected"); - message.livenessProbe = $root.google.cloud.run.v2.Probe.fromObject(object.livenessProbe); - } - if (object.startupProbe != null) { - if (typeof object.startupProbe !== "object") - throw TypeError(".google.cloud.run.v2.Container.startupProbe: object expected"); - message.startupProbe = $root.google.cloud.run.v2.Probe.fromObject(object.startupProbe); - } - if (object.readinessProbe != null) { - if (typeof object.readinessProbe !== "object") - throw TypeError(".google.cloud.run.v2.Container.readinessProbe: object expected"); - message.readinessProbe = $root.google.cloud.run.v2.Probe.fromObject(object.readinessProbe); - } - if (object.dependsOn) { - if (!Array.isArray(object.dependsOn)) - throw TypeError(".google.cloud.run.v2.Container.dependsOn: array expected"); - message.dependsOn = []; - for (var i = 0; i < object.dependsOn.length; ++i) - message.dependsOn[i] = String(object.dependsOn[i]); - } - if (object.baseImageUri != null) - message.baseImageUri = String(object.baseImageUri); - if (object.buildInfo != null) { - if (typeof object.buildInfo !== "object") - throw TypeError(".google.cloud.run.v2.Container.buildInfo: object expected"); - message.buildInfo = $root.google.cloud.run.v2.BuildInfo.fromObject(object.buildInfo); - } - return message; - }; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Container - * @static - * @param {google.cloud.run.v2.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.command = []; - object.args = []; - object.env = []; - object.ports = []; - object.volumeMounts = []; - object.dependsOn = []; - } - if (options.defaults) { - object.name = ""; - object.image = ""; - object.resources = null; - object.workingDir = ""; - object.livenessProbe = null; - object.startupProbe = null; - object.baseImageUri = ""; - object.readinessProbe = null; - object.buildInfo = null; - object.sourceCode = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.image != null && message.hasOwnProperty("image")) - object.image = message.image; - if (message.command && message.command.length) { - object.command = []; - for (var j = 0; j < message.command.length; ++j) - object.command[j] = message.command[j]; - } - if (message.args && message.args.length) { - object.args = []; - for (var j = 0; j < message.args.length; ++j) - object.args[j] = message.args[j]; - } - if (message.env && message.env.length) { - object.env = []; - for (var j = 0; j < message.env.length; ++j) - object.env[j] = $root.google.cloud.run.v2.EnvVar.toObject(message.env[j], options); - } - if (message.resources != null && message.hasOwnProperty("resources")) - object.resources = $root.google.cloud.run.v2.ResourceRequirements.toObject(message.resources, options); - if (message.ports && message.ports.length) { - object.ports = []; - for (var j = 0; j < message.ports.length; ++j) - object.ports[j] = $root.google.cloud.run.v2.ContainerPort.toObject(message.ports[j], options); - } - if (message.volumeMounts && message.volumeMounts.length) { - object.volumeMounts = []; - for (var j = 0; j < message.volumeMounts.length; ++j) - object.volumeMounts[j] = $root.google.cloud.run.v2.VolumeMount.toObject(message.volumeMounts[j], options); - } - if (message.workingDir != null && message.hasOwnProperty("workingDir")) - object.workingDir = message.workingDir; - if (message.livenessProbe != null && message.hasOwnProperty("livenessProbe")) - object.livenessProbe = $root.google.cloud.run.v2.Probe.toObject(message.livenessProbe, options); - if (message.startupProbe != null && message.hasOwnProperty("startupProbe")) - object.startupProbe = $root.google.cloud.run.v2.Probe.toObject(message.startupProbe, options); - if (message.dependsOn && message.dependsOn.length) { - object.dependsOn = []; - for (var j = 0; j < message.dependsOn.length; ++j) - object.dependsOn[j] = message.dependsOn[j]; - } - if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) - object.baseImageUri = message.baseImageUri; - if (message.readinessProbe != null && message.hasOwnProperty("readinessProbe")) - object.readinessProbe = $root.google.cloud.run.v2.Probe.toObject(message.readinessProbe, options); - if (message.buildInfo != null && message.hasOwnProperty("buildInfo")) - object.buildInfo = $root.google.cloud.run.v2.BuildInfo.toObject(message.buildInfo, options); - if (message.sourceCode != null && message.hasOwnProperty("sourceCode")) - object.sourceCode = $root.google.cloud.run.v2.SourceCode.toObject(message.sourceCode, options); - return object; - }; - - /** - * Converts this Container to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Container"; - }; - - return Container; - })(); - - v2.ResourceRequirements = (function() { - - /** - * Properties of a ResourceRequirements. - * @memberof google.cloud.run.v2 - * @interface IResourceRequirements - * @property {Object.|null} [limits] ResourceRequirements limits - * @property {boolean|null} [cpuIdle] ResourceRequirements cpuIdle - * @property {boolean|null} [startupCpuBoost] ResourceRequirements startupCpuBoost - */ - - /** - * Constructs a new ResourceRequirements. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ResourceRequirements. - * @implements IResourceRequirements - * @constructor - * @param {google.cloud.run.v2.IResourceRequirements=} [properties] Properties to set - */ - function ResourceRequirements(properties) { - this.limits = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceRequirements limits. - * @member {Object.} limits - * @memberof google.cloud.run.v2.ResourceRequirements - * @instance - */ - ResourceRequirements.prototype.limits = $util.emptyObject; - - /** - * ResourceRequirements cpuIdle. - * @member {boolean} cpuIdle - * @memberof google.cloud.run.v2.ResourceRequirements - * @instance - */ - ResourceRequirements.prototype.cpuIdle = false; - - /** - * ResourceRequirements startupCpuBoost. - * @member {boolean} startupCpuBoost - * @memberof google.cloud.run.v2.ResourceRequirements - * @instance - */ - ResourceRequirements.prototype.startupCpuBoost = false; - - /** - * Creates a new ResourceRequirements instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {google.cloud.run.v2.IResourceRequirements=} [properties] Properties to set - * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements instance - */ - ResourceRequirements.create = function create(properties) { - return new ResourceRequirements(properties); - }; - - /** - * Encodes the specified ResourceRequirements message. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {google.cloud.run.v2.IResourceRequirements} message ResourceRequirements message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceRequirements.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.limits != null && Object.hasOwnProperty.call(message, "limits")) - for (var keys = Object.keys(message.limits), 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.limits[keys[i]]).ldelim(); - if (message.cpuIdle != null && Object.hasOwnProperty.call(message, "cpuIdle")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.cpuIdle); - if (message.startupCpuBoost != null && Object.hasOwnProperty.call(message, "startupCpuBoost")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.startupCpuBoost); - return writer; - }; - - /** - * Encodes the specified ResourceRequirements message, length delimited. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {google.cloud.run.v2.IResourceRequirements} message ResourceRequirements message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceRequirements.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceRequirements message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceRequirements.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ResourceRequirements(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.limits === $util.emptyObject) - message.limits = {}; - 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.limits[key] = value; - break; - } - case 2: { - message.cpuIdle = reader.bool(); - break; - } - case 3: { - message.startupCpuBoost = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceRequirements message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceRequirements.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceRequirements message. - * @function verify - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceRequirements.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.limits != null && message.hasOwnProperty("limits")) { - if (!$util.isObject(message.limits)) - return "limits: object expected"; - var key = Object.keys(message.limits); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.limits[key[i]])) - return "limits: string{k:string} expected"; - } - if (message.cpuIdle != null && message.hasOwnProperty("cpuIdle")) - if (typeof message.cpuIdle !== "boolean") - return "cpuIdle: boolean expected"; - if (message.startupCpuBoost != null && message.hasOwnProperty("startupCpuBoost")) - if (typeof message.startupCpuBoost !== "boolean") - return "startupCpuBoost: boolean expected"; - return null; - }; - - /** - * Creates a ResourceRequirements message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements - */ - ResourceRequirements.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ResourceRequirements) - return object; - var message = new $root.google.cloud.run.v2.ResourceRequirements(); - if (object.limits) { - if (typeof object.limits !== "object") - throw TypeError(".google.cloud.run.v2.ResourceRequirements.limits: object expected"); - message.limits = {}; - for (var keys = Object.keys(object.limits), i = 0; i < keys.length; ++i) - message.limits[keys[i]] = String(object.limits[keys[i]]); - } - if (object.cpuIdle != null) - message.cpuIdle = Boolean(object.cpuIdle); - if (object.startupCpuBoost != null) - message.startupCpuBoost = Boolean(object.startupCpuBoost); - return message; - }; - - /** - * Creates a plain object from a ResourceRequirements message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {google.cloud.run.v2.ResourceRequirements} message ResourceRequirements - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceRequirements.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.limits = {}; - if (options.defaults) { - object.cpuIdle = false; - object.startupCpuBoost = false; - } - var keys2; - if (message.limits && (keys2 = Object.keys(message.limits)).length) { - object.limits = {}; - for (var j = 0; j < keys2.length; ++j) - object.limits[keys2[j]] = message.limits[keys2[j]]; - } - if (message.cpuIdle != null && message.hasOwnProperty("cpuIdle")) - object.cpuIdle = message.cpuIdle; - if (message.startupCpuBoost != null && message.hasOwnProperty("startupCpuBoost")) - object.startupCpuBoost = message.startupCpuBoost; - return object; - }; - - /** - * Converts this ResourceRequirements to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ResourceRequirements - * @instance - * @returns {Object.} JSON object - */ - ResourceRequirements.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceRequirements - * @function getTypeUrl - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceRequirements.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ResourceRequirements"; - }; - - return ResourceRequirements; - })(); - - v2.EnvVar = (function() { - - /** - * Properties of an EnvVar. - * @memberof google.cloud.run.v2 - * @interface IEnvVar - * @property {string|null} [name] EnvVar name - * @property {string|null} [value] EnvVar value - * @property {google.cloud.run.v2.IEnvVarSource|null} [valueSource] EnvVar valueSource - */ - - /** - * Constructs a new EnvVar. - * @memberof google.cloud.run.v2 - * @classdesc Represents an EnvVar. - * @implements IEnvVar - * @constructor - * @param {google.cloud.run.v2.IEnvVar=} [properties] Properties to set - */ - function EnvVar(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnvVar name. - * @member {string} name - * @memberof google.cloud.run.v2.EnvVar - * @instance - */ - EnvVar.prototype.name = ""; - - /** - * EnvVar value. - * @member {string|null|undefined} value - * @memberof google.cloud.run.v2.EnvVar - * @instance - */ - EnvVar.prototype.value = null; - - /** - * EnvVar valueSource. - * @member {google.cloud.run.v2.IEnvVarSource|null|undefined} valueSource - * @memberof google.cloud.run.v2.EnvVar - * @instance - */ - EnvVar.prototype.valueSource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * EnvVar values. - * @member {"value"|"valueSource"|undefined} values - * @memberof google.cloud.run.v2.EnvVar - * @instance - */ - Object.defineProperty(EnvVar.prototype, "values", { - get: $util.oneOfGetter($oneOfFields = ["value", "valueSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new EnvVar instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {google.cloud.run.v2.IEnvVar=} [properties] Properties to set - * @returns {google.cloud.run.v2.EnvVar} EnvVar instance - */ - EnvVar.create = function create(properties) { - return new EnvVar(properties); - }; - - /** - * Encodes the specified EnvVar message. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {google.cloud.run.v2.IEnvVar} message EnvVar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnvVar.encode = function encode(message, writer) { - if (!writer) - 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 && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.valueSource != null && Object.hasOwnProperty.call(message, "valueSource")) - $root.google.cloud.run.v2.EnvVarSource.encode(message.valueSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnvVar message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {google.cloud.run.v2.IEnvVar} message EnvVar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnvVar.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnvVar message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.EnvVar} EnvVar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnvVar.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.EnvVar(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - case 3: { - message.valueSource = $root.google.cloud.run.v2.EnvVarSource.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnvVar message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.EnvVar} EnvVar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnvVar.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnvVar message. - * @function verify - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnvVar.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.value != null && message.hasOwnProperty("value")) { - properties.values = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - if (message.valueSource != null && message.hasOwnProperty("valueSource")) { - if (properties.values === 1) - return "values: multiple values"; - properties.values = 1; - { - var error = $root.google.cloud.run.v2.EnvVarSource.verify(message.valueSource); - if (error) - return "valueSource." + error; - } - } - return null; - }; - - /** - * Creates an EnvVar message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.EnvVar} EnvVar - */ - EnvVar.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.EnvVar) - return object; - var message = new $root.google.cloud.run.v2.EnvVar(); - if (object.name != null) - message.name = String(object.name); - if (object.value != null) - message.value = String(object.value); - if (object.valueSource != null) { - if (typeof object.valueSource !== "object") - throw TypeError(".google.cloud.run.v2.EnvVar.valueSource: object expected"); - message.valueSource = $root.google.cloud.run.v2.EnvVarSource.fromObject(object.valueSource); - } - return message; - }; - - /** - * Creates a plain object from an EnvVar message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {google.cloud.run.v2.EnvVar} message EnvVar - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnvVar.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object.values = "value"; - } - if (message.valueSource != null && message.hasOwnProperty("valueSource")) { - object.valueSource = $root.google.cloud.run.v2.EnvVarSource.toObject(message.valueSource, options); - if (options.oneofs) - object.values = "valueSource"; - } - return object; - }; - - /** - * Converts this EnvVar to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.EnvVar - * @instance - * @returns {Object.} JSON object - */ - EnvVar.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnvVar - * @function getTypeUrl - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnvVar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.EnvVar"; - }; - - return EnvVar; - })(); - - v2.EnvVarSource = (function() { - - /** - * Properties of an EnvVarSource. - * @memberof google.cloud.run.v2 - * @interface IEnvVarSource - * @property {google.cloud.run.v2.ISecretKeySelector|null} [secretKeyRef] EnvVarSource secretKeyRef - */ - - /** - * Constructs a new EnvVarSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents an EnvVarSource. - * @implements IEnvVarSource - * @constructor - * @param {google.cloud.run.v2.IEnvVarSource=} [properties] Properties to set - */ - function EnvVarSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnvVarSource secretKeyRef. - * @member {google.cloud.run.v2.ISecretKeySelector|null|undefined} secretKeyRef - * @memberof google.cloud.run.v2.EnvVarSource - * @instance - */ - EnvVarSource.prototype.secretKeyRef = null; - - /** - * Creates a new EnvVarSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {google.cloud.run.v2.IEnvVarSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource instance - */ - EnvVarSource.create = function create(properties) { - return new EnvVarSource(properties); - }; - - /** - * Encodes the specified EnvVarSource message. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {google.cloud.run.v2.IEnvVarSource} message EnvVarSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnvVarSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secretKeyRef != null && Object.hasOwnProperty.call(message, "secretKeyRef")) - $root.google.cloud.run.v2.SecretKeySelector.encode(message.secretKeyRef, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnvVarSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {google.cloud.run.v2.IEnvVarSource} message EnvVarSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnvVarSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnvVarSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnvVarSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.EnvVarSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.secretKeyRef = $root.google.cloud.run.v2.SecretKeySelector.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnvVarSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnvVarSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnvVarSource message. - * @function verify - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnvVarSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secretKeyRef != null && message.hasOwnProperty("secretKeyRef")) { - var error = $root.google.cloud.run.v2.SecretKeySelector.verify(message.secretKeyRef); - if (error) - return "secretKeyRef." + error; - } - return null; - }; - - /** - * Creates an EnvVarSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource - */ - EnvVarSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.EnvVarSource) - return object; - var message = new $root.google.cloud.run.v2.EnvVarSource(); - if (object.secretKeyRef != null) { - if (typeof object.secretKeyRef !== "object") - throw TypeError(".google.cloud.run.v2.EnvVarSource.secretKeyRef: object expected"); - message.secretKeyRef = $root.google.cloud.run.v2.SecretKeySelector.fromObject(object.secretKeyRef); - } - return message; - }; - - /** - * Creates a plain object from an EnvVarSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {google.cloud.run.v2.EnvVarSource} message EnvVarSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnvVarSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.secretKeyRef = null; - if (message.secretKeyRef != null && message.hasOwnProperty("secretKeyRef")) - object.secretKeyRef = $root.google.cloud.run.v2.SecretKeySelector.toObject(message.secretKeyRef, options); - return object; - }; - - /** - * Converts this EnvVarSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.EnvVarSource - * @instance - * @returns {Object.} JSON object - */ - EnvVarSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnvVarSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnvVarSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.EnvVarSource"; - }; - - return EnvVarSource; - })(); - - v2.SecretKeySelector = (function() { - - /** - * Properties of a SecretKeySelector. - * @memberof google.cloud.run.v2 - * @interface ISecretKeySelector - * @property {string|null} [secret] SecretKeySelector secret - * @property {string|null} [version] SecretKeySelector version - */ - - /** - * Constructs a new SecretKeySelector. - * @memberof google.cloud.run.v2 - * @classdesc Represents a SecretKeySelector. - * @implements ISecretKeySelector - * @constructor - * @param {google.cloud.run.v2.ISecretKeySelector=} [properties] Properties to set - */ - function SecretKeySelector(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecretKeySelector secret. - * @member {string} secret - * @memberof google.cloud.run.v2.SecretKeySelector - * @instance - */ - SecretKeySelector.prototype.secret = ""; - - /** - * SecretKeySelector version. - * @member {string} version - * @memberof google.cloud.run.v2.SecretKeySelector - * @instance - */ - SecretKeySelector.prototype.version = ""; - - /** - * Creates a new SecretKeySelector instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {google.cloud.run.v2.ISecretKeySelector=} [properties] Properties to set - * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector instance - */ - SecretKeySelector.create = function create(properties) { - return new SecretKeySelector(properties); - }; - - /** - * Encodes the specified SecretKeySelector message. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {google.cloud.run.v2.ISecretKeySelector} message SecretKeySelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecretKeySelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secret); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - return writer; - }; - - /** - * Encodes the specified SecretKeySelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {google.cloud.run.v2.ISecretKeySelector} message SecretKeySelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecretKeySelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecretKeySelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecretKeySelector.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SecretKeySelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.secret = reader.string(); - break; - } - case 2: { - message.version = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecretKeySelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecretKeySelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecretKeySelector message. - * @function verify - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecretKeySelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secret != null && message.hasOwnProperty("secret")) - if (!$util.isString(message.secret)) - return "secret: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; - }; - - /** - * Creates a SecretKeySelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector - */ - SecretKeySelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SecretKeySelector) - return object; - var message = new $root.google.cloud.run.v2.SecretKeySelector(); - if (object.secret != null) - message.secret = String(object.secret); - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a SecretKeySelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {google.cloud.run.v2.SecretKeySelector} message SecretKeySelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecretKeySelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.secret = ""; - object.version = ""; - } - if (message.secret != null && message.hasOwnProperty("secret")) - object.secret = message.secret; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this SecretKeySelector to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SecretKeySelector - * @instance - * @returns {Object.} JSON object - */ - SecretKeySelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecretKeySelector - * @function getTypeUrl - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecretKeySelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SecretKeySelector"; - }; - - return SecretKeySelector; - })(); - - v2.ContainerPort = (function() { - - /** - * Properties of a ContainerPort. - * @memberof google.cloud.run.v2 - * @interface IContainerPort - * @property {string|null} [name] ContainerPort name - * @property {number|null} [containerPort] ContainerPort containerPort - */ - - /** - * Constructs a new ContainerPort. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ContainerPort. - * @implements IContainerPort - * @constructor - * @param {google.cloud.run.v2.IContainerPort=} [properties] Properties to set - */ - function ContainerPort(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContainerPort name. - * @member {string} name - * @memberof google.cloud.run.v2.ContainerPort - * @instance - */ - ContainerPort.prototype.name = ""; - - /** - * ContainerPort containerPort. - * @member {number} containerPort - * @memberof google.cloud.run.v2.ContainerPort - * @instance - */ - ContainerPort.prototype.containerPort = 0; - - /** - * Creates a new ContainerPort instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {google.cloud.run.v2.IContainerPort=} [properties] Properties to set - * @returns {google.cloud.run.v2.ContainerPort} ContainerPort instance - */ - ContainerPort.create = function create(properties) { - return new ContainerPort(properties); - }; - - /** - * Encodes the specified ContainerPort message. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {google.cloud.run.v2.IContainerPort} message ContainerPort message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerPort.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.containerPort != null && Object.hasOwnProperty.call(message, "containerPort")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.containerPort); - return writer; - }; - - /** - * Encodes the specified ContainerPort message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {google.cloud.run.v2.IContainerPort} message ContainerPort message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerPort.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContainerPort message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ContainerPort} ContainerPort - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerPort.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ContainerPort(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.containerPort = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContainerPort message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ContainerPort} ContainerPort - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerPort.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContainerPort message. - * @function verify - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContainerPort.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.containerPort != null && message.hasOwnProperty("containerPort")) - if (!$util.isInteger(message.containerPort)) - return "containerPort: integer expected"; - return null; - }; - - /** - * Creates a ContainerPort message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ContainerPort} ContainerPort - */ - ContainerPort.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ContainerPort) - return object; - var message = new $root.google.cloud.run.v2.ContainerPort(); - if (object.name != null) - message.name = String(object.name); - if (object.containerPort != null) - message.containerPort = object.containerPort | 0; - return message; - }; - - /** - * Creates a plain object from a ContainerPort message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {google.cloud.run.v2.ContainerPort} message ContainerPort - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContainerPort.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.containerPort = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.containerPort != null && message.hasOwnProperty("containerPort")) - object.containerPort = message.containerPort; - return object; - }; - - /** - * Converts this ContainerPort to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ContainerPort - * @instance - * @returns {Object.} JSON object - */ - ContainerPort.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContainerPort - * @function getTypeUrl - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContainerPort.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ContainerPort"; - }; - - return ContainerPort; - })(); - - v2.VolumeMount = (function() { - - /** - * Properties of a VolumeMount. - * @memberof google.cloud.run.v2 - * @interface IVolumeMount - * @property {string|null} [name] VolumeMount name - * @property {string|null} [mountPath] VolumeMount mountPath - * @property {string|null} [subPath] VolumeMount subPath - */ - - /** - * Constructs a new VolumeMount. - * @memberof google.cloud.run.v2 - * @classdesc Represents a VolumeMount. - * @implements IVolumeMount - * @constructor - * @param {google.cloud.run.v2.IVolumeMount=} [properties] Properties to set - */ - function VolumeMount(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VolumeMount name. - * @member {string} name - * @memberof google.cloud.run.v2.VolumeMount - * @instance - */ - VolumeMount.prototype.name = ""; - - /** - * VolumeMount mountPath. - * @member {string} mountPath - * @memberof google.cloud.run.v2.VolumeMount - * @instance - */ - VolumeMount.prototype.mountPath = ""; - - /** - * VolumeMount subPath. - * @member {string} subPath - * @memberof google.cloud.run.v2.VolumeMount - * @instance - */ - VolumeMount.prototype.subPath = ""; - - /** - * Creates a new VolumeMount instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {google.cloud.run.v2.IVolumeMount=} [properties] Properties to set - * @returns {google.cloud.run.v2.VolumeMount} VolumeMount instance - */ - VolumeMount.create = function create(properties) { - return new VolumeMount(properties); - }; - - /** - * Encodes the specified VolumeMount message. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {google.cloud.run.v2.IVolumeMount} message VolumeMount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VolumeMount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.mountPath); - if (message.subPath != null && Object.hasOwnProperty.call(message, "subPath")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.subPath); - return writer; - }; - - /** - * Encodes the specified VolumeMount message, length delimited. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {google.cloud.run.v2.IVolumeMount} message VolumeMount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VolumeMount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VolumeMount message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.VolumeMount} VolumeMount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VolumeMount.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VolumeMount(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.mountPath = reader.string(); - break; - } - case 4: { - message.subPath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VolumeMount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.VolumeMount} VolumeMount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VolumeMount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VolumeMount message. - * @function verify - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VolumeMount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - if (!$util.isString(message.mountPath)) - return "mountPath: string expected"; - if (message.subPath != null && message.hasOwnProperty("subPath")) - if (!$util.isString(message.subPath)) - return "subPath: string expected"; - return null; - }; - - /** - * Creates a VolumeMount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.VolumeMount} VolumeMount - */ - VolumeMount.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.VolumeMount) - return object; - var message = new $root.google.cloud.run.v2.VolumeMount(); - if (object.name != null) - message.name = String(object.name); - if (object.mountPath != null) - message.mountPath = String(object.mountPath); - if (object.subPath != null) - message.subPath = String(object.subPath); - return message; - }; - - /** - * Creates a plain object from a VolumeMount message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {google.cloud.run.v2.VolumeMount} message VolumeMount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VolumeMount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.mountPath = ""; - object.subPath = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - object.mountPath = message.mountPath; - if (message.subPath != null && message.hasOwnProperty("subPath")) - object.subPath = message.subPath; - return object; - }; - - /** - * Converts this VolumeMount to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.VolumeMount - * @instance - * @returns {Object.} JSON object - */ - VolumeMount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VolumeMount - * @function getTypeUrl - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VolumeMount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.VolumeMount"; - }; - - return VolumeMount; - })(); - - v2.Volume = (function() { - - /** - * Properties of a Volume. - * @memberof google.cloud.run.v2 - * @interface IVolume - * @property {string|null} [name] Volume name - * @property {google.cloud.run.v2.ISecretVolumeSource|null} [secret] Volume secret - * @property {google.cloud.run.v2.ICloudSqlInstance|null} [cloudSqlInstance] Volume cloudSqlInstance - * @property {google.cloud.run.v2.IEmptyDirVolumeSource|null} [emptyDir] Volume emptyDir - * @property {google.cloud.run.v2.INFSVolumeSource|null} [nfs] Volume nfs - * @property {google.cloud.run.v2.IGCSVolumeSource|null} [gcs] Volume gcs - */ - - /** - * Constructs a new Volume. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Volume. - * @implements IVolume - * @constructor - * @param {google.cloud.run.v2.IVolume=} [properties] Properties to set - */ - function Volume(properties) { - if (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 name. - * @member {string} name - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.name = ""; - - /** - * Volume secret. - * @member {google.cloud.run.v2.ISecretVolumeSource|null|undefined} secret - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.secret = null; - - /** - * Volume cloudSqlInstance. - * @member {google.cloud.run.v2.ICloudSqlInstance|null|undefined} cloudSqlInstance - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.cloudSqlInstance = null; - - /** - * Volume emptyDir. - * @member {google.cloud.run.v2.IEmptyDirVolumeSource|null|undefined} emptyDir - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.emptyDir = null; - - /** - * Volume nfs. - * @member {google.cloud.run.v2.INFSVolumeSource|null|undefined} nfs - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.nfs = null; - - /** - * Volume gcs. - * @member {google.cloud.run.v2.IGCSVolumeSource|null|undefined} gcs - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.gcs = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Volume volumeType. - * @member {"secret"|"cloudSqlInstance"|"emptyDir"|"nfs"|"gcs"|undefined} volumeType - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Object.defineProperty(Volume.prototype, "volumeType", { - get: $util.oneOfGetter($oneOfFields = ["secret", "cloudSqlInstance", "emptyDir", "nfs", "gcs"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Volume instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Volume - * @static - * @param {google.cloud.run.v2.IVolume=} [properties] Properties to set - * @returns {google.cloud.run.v2.Volume} Volume instance - */ - Volume.create = function create(properties) { - return new Volume(properties); - }; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.run.v2.Volume.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Volume - * @static - * @param {google.cloud.run.v2.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) - $root.google.cloud.run.v2.SecretVolumeSource.encode(message.secret, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cloudSqlInstance != null && Object.hasOwnProperty.call(message, "cloudSqlInstance")) - $root.google.cloud.run.v2.CloudSqlInstance.encode(message.cloudSqlInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.emptyDir != null && Object.hasOwnProperty.call(message, "emptyDir")) - $root.google.cloud.run.v2.EmptyDirVolumeSource.encode(message.emptyDir, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) - $root.google.cloud.run.v2.NFSVolumeSource.encode(message.nfs, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) - $root.google.cloud.run.v2.GCSVolumeSource.encode(message.gcs, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.run.v2.Volume.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Volume - * @static - * @param {google.cloud.run.v2.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.run.v2.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Volume(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.secret = $root.google.cloud.run.v2.SecretVolumeSource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.decode(reader, reader.uint32()); - break; - } - case 5: { - message.nfs = $root.google.cloud.run.v2.NFSVolumeSource.decode(reader, reader.uint32()); - break; - } - case 6: { - message.gcs = $root.google.cloud.run.v2.GCSVolumeSource.decode(reader, reader.uint32()); - 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.run.v2.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.secret != null && message.hasOwnProperty("secret")) { - properties.volumeType = 1; - { - var error = $root.google.cloud.run.v2.SecretVolumeSource.verify(message.secret); - if (error) - return "secret." + error; - } - } - if (message.cloudSqlInstance != null && message.hasOwnProperty("cloudSqlInstance")) { - if (properties.volumeType === 1) - return "volumeType: multiple values"; - properties.volumeType = 1; - { - var error = $root.google.cloud.run.v2.CloudSqlInstance.verify(message.cloudSqlInstance); - if (error) - return "cloudSqlInstance." + error; - } - } - if (message.emptyDir != null && message.hasOwnProperty("emptyDir")) { - if (properties.volumeType === 1) - return "volumeType: multiple values"; - properties.volumeType = 1; - { - var error = $root.google.cloud.run.v2.EmptyDirVolumeSource.verify(message.emptyDir); - if (error) - return "emptyDir." + error; - } - } - if (message.nfs != null && message.hasOwnProperty("nfs")) { - if (properties.volumeType === 1) - return "volumeType: multiple values"; - properties.volumeType = 1; - { - var error = $root.google.cloud.run.v2.NFSVolumeSource.verify(message.nfs); - if (error) - return "nfs." + error; - } - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - if (properties.volumeType === 1) - return "volumeType: multiple values"; - properties.volumeType = 1; - { - var error = $root.google.cloud.run.v2.GCSVolumeSource.verify(message.gcs); - if (error) - return "gcs." + error; - } - } - return null; - }; - - /** - * Creates a Volume message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Volume - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Volume} Volume - */ - Volume.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Volume) - return object; - var message = new $root.google.cloud.run.v2.Volume(); - if (object.name != null) - message.name = String(object.name); - if (object.secret != null) { - if (typeof object.secret !== "object") - throw TypeError(".google.cloud.run.v2.Volume.secret: object expected"); - message.secret = $root.google.cloud.run.v2.SecretVolumeSource.fromObject(object.secret); - } - if (object.cloudSqlInstance != null) { - if (typeof object.cloudSqlInstance !== "object") - throw TypeError(".google.cloud.run.v2.Volume.cloudSqlInstance: object expected"); - message.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.fromObject(object.cloudSqlInstance); - } - if (object.emptyDir != null) { - if (typeof object.emptyDir !== "object") - throw TypeError(".google.cloud.run.v2.Volume.emptyDir: object expected"); - message.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.fromObject(object.emptyDir); - } - if (object.nfs != null) { - if (typeof object.nfs !== "object") - throw TypeError(".google.cloud.run.v2.Volume.nfs: object expected"); - message.nfs = $root.google.cloud.run.v2.NFSVolumeSource.fromObject(object.nfs); - } - if (object.gcs != null) { - if (typeof object.gcs !== "object") - throw TypeError(".google.cloud.run.v2.Volume.gcs: object expected"); - message.gcs = $root.google.cloud.run.v2.GCSVolumeSource.fromObject(object.gcs); - } - return message; - }; - - /** - * Creates a plain object from a Volume message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Volume - * @static - * @param {google.cloud.run.v2.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.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.secret != null && message.hasOwnProperty("secret")) { - object.secret = $root.google.cloud.run.v2.SecretVolumeSource.toObject(message.secret, options); - if (options.oneofs) - object.volumeType = "secret"; - } - if (message.cloudSqlInstance != null && message.hasOwnProperty("cloudSqlInstance")) { - object.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.toObject(message.cloudSqlInstance, options); - if (options.oneofs) - object.volumeType = "cloudSqlInstance"; - } - if (message.emptyDir != null && message.hasOwnProperty("emptyDir")) { - object.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.toObject(message.emptyDir, options); - if (options.oneofs) - object.volumeType = "emptyDir"; - } - if (message.nfs != null && message.hasOwnProperty("nfs")) { - object.nfs = $root.google.cloud.run.v2.NFSVolumeSource.toObject(message.nfs, options); - if (options.oneofs) - object.volumeType = "nfs"; - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - object.gcs = $root.google.cloud.run.v2.GCSVolumeSource.toObject(message.gcs, options); - if (options.oneofs) - object.volumeType = "gcs"; - } - return object; - }; - - /** - * Converts this Volume to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Volume"; - }; - - return Volume; - })(); - - v2.SecretVolumeSource = (function() { - - /** - * Properties of a SecretVolumeSource. - * @memberof google.cloud.run.v2 - * @interface ISecretVolumeSource - * @property {string|null} [secret] SecretVolumeSource secret - * @property {Array.|null} [items] SecretVolumeSource items - * @property {number|null} [defaultMode] SecretVolumeSource defaultMode - */ - - /** - * Constructs a new SecretVolumeSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents a SecretVolumeSource. - * @implements ISecretVolumeSource - * @constructor - * @param {google.cloud.run.v2.ISecretVolumeSource=} [properties] Properties to set - */ - function SecretVolumeSource(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]]; - } - - /** - * SecretVolumeSource secret. - * @member {string} secret - * @memberof google.cloud.run.v2.SecretVolumeSource - * @instance - */ - SecretVolumeSource.prototype.secret = ""; - - /** - * SecretVolumeSource items. - * @member {Array.} items - * @memberof google.cloud.run.v2.SecretVolumeSource - * @instance - */ - SecretVolumeSource.prototype.items = $util.emptyArray; - - /** - * SecretVolumeSource defaultMode. - * @member {number} defaultMode - * @memberof google.cloud.run.v2.SecretVolumeSource - * @instance - */ - SecretVolumeSource.prototype.defaultMode = 0; - - /** - * Creates a new SecretVolumeSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {google.cloud.run.v2.ISecretVolumeSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource instance - */ - SecretVolumeSource.create = function create(properties) { - return new SecretVolumeSource(properties); - }; - - /** - * Encodes the specified SecretVolumeSource message. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {google.cloud.run.v2.ISecretVolumeSource} message SecretVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecretVolumeSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secret); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.run.v2.VersionToPath.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.defaultMode != null && Object.hasOwnProperty.call(message, "defaultMode")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.defaultMode); - return writer; - }; - - /** - * Encodes the specified SecretVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {google.cloud.run.v2.ISecretVolumeSource} message SecretVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecretVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecretVolumeSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecretVolumeSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SecretVolumeSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.secret = reader.string(); - break; - } - case 2: { - if (!(message.items && message.items.length)) - message.items = []; - message.items.push($root.google.cloud.run.v2.VersionToPath.decode(reader, reader.uint32())); - break; - } - case 3: { - message.defaultMode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecretVolumeSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecretVolumeSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecretVolumeSource message. - * @function verify - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecretVolumeSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secret != null && message.hasOwnProperty("secret")) - if (!$util.isString(message.secret)) - return "secret: string expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) { - var error = $root.google.cloud.run.v2.VersionToPath.verify(message.items[i]); - if (error) - return "items." + error; - } - } - if (message.defaultMode != null && message.hasOwnProperty("defaultMode")) - if (!$util.isInteger(message.defaultMode)) - return "defaultMode: integer expected"; - return null; - }; - - /** - * Creates a SecretVolumeSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource - */ - SecretVolumeSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SecretVolumeSource) - return object; - var message = new $root.google.cloud.run.v2.SecretVolumeSource(); - if (object.secret != null) - message.secret = String(object.secret); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.cloud.run.v2.SecretVolumeSource.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") - throw TypeError(".google.cloud.run.v2.SecretVolumeSource.items: object expected"); - message.items[i] = $root.google.cloud.run.v2.VersionToPath.fromObject(object.items[i]); - } - } - if (object.defaultMode != null) - message.defaultMode = object.defaultMode | 0; - return message; - }; - - /** - * Creates a plain object from a SecretVolumeSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {google.cloud.run.v2.SecretVolumeSource} message SecretVolumeSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecretVolumeSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (options.defaults) { - object.secret = ""; - object.defaultMode = 0; - } - if (message.secret != null && message.hasOwnProperty("secret")) - object.secret = message.secret; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.run.v2.VersionToPath.toObject(message.items[j], options); - } - if (message.defaultMode != null && message.hasOwnProperty("defaultMode")) - object.defaultMode = message.defaultMode; - return object; - }; - - /** - * Converts this SecretVolumeSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SecretVolumeSource - * @instance - * @returns {Object.} JSON object - */ - SecretVolumeSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecretVolumeSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecretVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SecretVolumeSource"; - }; - - return SecretVolumeSource; - })(); - - v2.VersionToPath = (function() { - - /** - * Properties of a VersionToPath. - * @memberof google.cloud.run.v2 - * @interface IVersionToPath - * @property {string|null} [path] VersionToPath path - * @property {string|null} [version] VersionToPath version - * @property {number|null} [mode] VersionToPath mode - */ - - /** - * Constructs a new VersionToPath. - * @memberof google.cloud.run.v2 - * @classdesc Represents a VersionToPath. - * @implements IVersionToPath - * @constructor - * @param {google.cloud.run.v2.IVersionToPath=} [properties] Properties to set - */ - function VersionToPath(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VersionToPath path. - * @member {string} path - * @memberof google.cloud.run.v2.VersionToPath - * @instance - */ - VersionToPath.prototype.path = ""; - - /** - * VersionToPath version. - * @member {string} version - * @memberof google.cloud.run.v2.VersionToPath - * @instance - */ - VersionToPath.prototype.version = ""; - - /** - * VersionToPath mode. - * @member {number} mode - * @memberof google.cloud.run.v2.VersionToPath - * @instance - */ - VersionToPath.prototype.mode = 0; - - /** - * Creates a new VersionToPath instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {google.cloud.run.v2.IVersionToPath=} [properties] Properties to set - * @returns {google.cloud.run.v2.VersionToPath} VersionToPath instance - */ - VersionToPath.create = function create(properties) { - return new VersionToPath(properties); - }; - - /** - * Encodes the specified VersionToPath message. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {google.cloud.run.v2.IVersionToPath} message VersionToPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionToPath.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.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mode); - return writer; - }; - - /** - * Encodes the specified VersionToPath message, length delimited. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {google.cloud.run.v2.IVersionToPath} message VersionToPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionToPath.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VersionToPath message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.VersionToPath} VersionToPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionToPath.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VersionToPath(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.path = reader.string(); - break; - } - case 2: { - message.version = reader.string(); - break; - } - case 3: { - message.mode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VersionToPath message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.VersionToPath} VersionToPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionToPath.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VersionToPath message. - * @function verify - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VersionToPath.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - if (!$util.isInteger(message.mode)) - return "mode: integer expected"; - return null; - }; - - /** - * Creates a VersionToPath message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.VersionToPath} VersionToPath - */ - VersionToPath.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.VersionToPath) - return object; - var message = new $root.google.cloud.run.v2.VersionToPath(); - if (object.path != null) - message.path = String(object.path); - if (object.version != null) - message.version = String(object.version); - if (object.mode != null) - message.mode = object.mode | 0; - return message; - }; - - /** - * Creates a plain object from a VersionToPath message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {google.cloud.run.v2.VersionToPath} message VersionToPath - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VersionToPath.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.path = ""; - object.version = ""; - object.mode = 0; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = message.mode; - return object; - }; - - /** - * Converts this VersionToPath to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.VersionToPath - * @instance - * @returns {Object.} JSON object - */ - VersionToPath.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VersionToPath - * @function getTypeUrl - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VersionToPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.VersionToPath"; - }; - - return VersionToPath; - })(); - - v2.CloudSqlInstance = (function() { - - /** - * Properties of a CloudSqlInstance. - * @memberof google.cloud.run.v2 - * @interface ICloudSqlInstance - * @property {Array.|null} [instances] CloudSqlInstance instances - */ - - /** - * Constructs a new CloudSqlInstance. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CloudSqlInstance. - * @implements ICloudSqlInstance - * @constructor - * @param {google.cloud.run.v2.ICloudSqlInstance=} [properties] Properties to set - */ - function CloudSqlInstance(properties) { - 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]]; - } - - /** - * CloudSqlInstance instances. - * @member {Array.} instances - * @memberof google.cloud.run.v2.CloudSqlInstance - * @instance - */ - CloudSqlInstance.prototype.instances = $util.emptyArray; - - /** - * Creates a new CloudSqlInstance instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {google.cloud.run.v2.ICloudSqlInstance=} [properties] Properties to set - * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance instance - */ - CloudSqlInstance.create = function create(properties) { - return new CloudSqlInstance(properties); - }; - - /** - * Encodes the specified CloudSqlInstance message. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {google.cloud.run.v2.ICloudSqlInstance} message CloudSqlInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instances[i]); - return writer; - }; - - /** - * Encodes the specified CloudSqlInstance message, length delimited. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {google.cloud.run.v2.ICloudSqlInstance} message CloudSqlInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudSqlInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstance.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CloudSqlInstance(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudSqlInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudSqlInstance message. - * @function verify - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudSqlInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) - if (!$util.isString(message.instances[i])) - return "instances: string[] expected"; - } - return null; - }; - - /** - * Creates a CloudSqlInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance - */ - CloudSqlInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CloudSqlInstance) - return object; - var message = new $root.google.cloud.run.v2.CloudSqlInstance(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.run.v2.CloudSqlInstance.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) - message.instances[i] = String(object.instances[i]); - } - return message; - }; - - /** - * Creates a plain object from a CloudSqlInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {google.cloud.run.v2.CloudSqlInstance} message CloudSqlInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudSqlInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = message.instances[j]; - } - return object; - }; - - /** - * Converts this CloudSqlInstance to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.CloudSqlInstance - * @instance - * @returns {Object.} JSON object - */ - CloudSqlInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudSqlInstance - * @function getTypeUrl - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudSqlInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.CloudSqlInstance"; - }; - - return CloudSqlInstance; - })(); - - v2.EmptyDirVolumeSource = (function() { - - /** - * Properties of an EmptyDirVolumeSource. - * @memberof google.cloud.run.v2 - * @interface IEmptyDirVolumeSource - * @property {google.cloud.run.v2.EmptyDirVolumeSource.Medium|null} [medium] EmptyDirVolumeSource medium - * @property {string|null} [sizeLimit] EmptyDirVolumeSource sizeLimit - */ - - /** - * Constructs a new EmptyDirVolumeSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents an EmptyDirVolumeSource. - * @implements IEmptyDirVolumeSource - * @constructor - * @param {google.cloud.run.v2.IEmptyDirVolumeSource=} [properties] Properties to set - */ - function EmptyDirVolumeSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EmptyDirVolumeSource medium. - * @member {google.cloud.run.v2.EmptyDirVolumeSource.Medium} medium - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @instance - */ - EmptyDirVolumeSource.prototype.medium = 0; - - /** - * EmptyDirVolumeSource sizeLimit. - * @member {string} sizeLimit - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @instance - */ - EmptyDirVolumeSource.prototype.sizeLimit = ""; - - /** - * Creates a new EmptyDirVolumeSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {google.cloud.run.v2.IEmptyDirVolumeSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource instance - */ - EmptyDirVolumeSource.create = function create(properties) { - return new EmptyDirVolumeSource(properties); - }; - - /** - * Encodes the specified EmptyDirVolumeSource message. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {google.cloud.run.v2.IEmptyDirVolumeSource} message EmptyDirVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmptyDirVolumeSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.medium != null && Object.hasOwnProperty.call(message, "medium")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.medium); - if (message.sizeLimit != null && Object.hasOwnProperty.call(message, "sizeLimit")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sizeLimit); - return writer; - }; - - /** - * Encodes the specified EmptyDirVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {google.cloud.run.v2.IEmptyDirVolumeSource} message EmptyDirVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmptyDirVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EmptyDirVolumeSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmptyDirVolumeSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.EmptyDirVolumeSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.medium = reader.int32(); - break; - } - case 2: { - message.sizeLimit = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EmptyDirVolumeSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmptyDirVolumeSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EmptyDirVolumeSource message. - * @function verify - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EmptyDirVolumeSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.medium != null && message.hasOwnProperty("medium")) - switch (message.medium) { - default: - return "medium: enum value expected"; - case 0: - case 1: - break; - } - if (message.sizeLimit != null && message.hasOwnProperty("sizeLimit")) - if (!$util.isString(message.sizeLimit)) - return "sizeLimit: string expected"; - return null; - }; - - /** - * Creates an EmptyDirVolumeSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource - */ - EmptyDirVolumeSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.EmptyDirVolumeSource) - return object; - var message = new $root.google.cloud.run.v2.EmptyDirVolumeSource(); - switch (object.medium) { - default: - if (typeof object.medium === "number") { - message.medium = object.medium; - break; - } - break; - case "MEDIUM_UNSPECIFIED": - case 0: - message.medium = 0; - break; - case "MEMORY": - case 1: - message.medium = 1; - break; - } - if (object.sizeLimit != null) - message.sizeLimit = String(object.sizeLimit); - return message; - }; - - /** - * Creates a plain object from an EmptyDirVolumeSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {google.cloud.run.v2.EmptyDirVolumeSource} message EmptyDirVolumeSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EmptyDirVolumeSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.medium = options.enums === String ? "MEDIUM_UNSPECIFIED" : 0; - object.sizeLimit = ""; - } - if (message.medium != null && message.hasOwnProperty("medium")) - object.medium = options.enums === String ? $root.google.cloud.run.v2.EmptyDirVolumeSource.Medium[message.medium] === undefined ? message.medium : $root.google.cloud.run.v2.EmptyDirVolumeSource.Medium[message.medium] : message.medium; - if (message.sizeLimit != null && message.hasOwnProperty("sizeLimit")) - object.sizeLimit = message.sizeLimit; - return object; - }; - - /** - * Converts this EmptyDirVolumeSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @instance - * @returns {Object.} JSON object - */ - EmptyDirVolumeSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EmptyDirVolumeSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EmptyDirVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.EmptyDirVolumeSource"; - }; - - /** - * Medium enum. - * @name google.cloud.run.v2.EmptyDirVolumeSource.Medium - * @enum {number} - * @property {number} MEDIUM_UNSPECIFIED=0 MEDIUM_UNSPECIFIED value - * @property {number} MEMORY=1 MEMORY value - */ - EmptyDirVolumeSource.Medium = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MEDIUM_UNSPECIFIED"] = 0; - values[valuesById[1] = "MEMORY"] = 1; - return values; - })(); - - return EmptyDirVolumeSource; - })(); - - v2.NFSVolumeSource = (function() { - - /** - * Properties of a NFSVolumeSource. - * @memberof google.cloud.run.v2 - * @interface INFSVolumeSource - * @property {string|null} [server] NFSVolumeSource server - * @property {string|null} [path] NFSVolumeSource path - * @property {boolean|null} [readOnly] NFSVolumeSource readOnly - */ - - /** - * Constructs a new NFSVolumeSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents a NFSVolumeSource. - * @implements INFSVolumeSource - * @constructor - * @param {google.cloud.run.v2.INFSVolumeSource=} [properties] Properties to set - */ - function NFSVolumeSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NFSVolumeSource server. - * @member {string} server - * @memberof google.cloud.run.v2.NFSVolumeSource - * @instance - */ - NFSVolumeSource.prototype.server = ""; - - /** - * NFSVolumeSource path. - * @member {string} path - * @memberof google.cloud.run.v2.NFSVolumeSource - * @instance - */ - NFSVolumeSource.prototype.path = ""; - - /** - * NFSVolumeSource readOnly. - * @member {boolean} readOnly - * @memberof google.cloud.run.v2.NFSVolumeSource - * @instance - */ - NFSVolumeSource.prototype.readOnly = false; - - /** - * Creates a new NFSVolumeSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {google.cloud.run.v2.INFSVolumeSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource instance - */ - NFSVolumeSource.create = function create(properties) { - return new NFSVolumeSource(properties); - }; - - /** - * Encodes the specified NFSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {google.cloud.run.v2.INFSVolumeSource} message NFSVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFSVolumeSource.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.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.readOnly); - return writer; - }; - - /** - * Encodes the specified NFSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {google.cloud.run.v2.INFSVolumeSource} message NFSVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFSVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NFSVolumeSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFSVolumeSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.NFSVolumeSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.server = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - case 3: { - message.readOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NFSVolumeSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFSVolumeSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NFSVolumeSource message. - * @function verify - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NFSVolumeSource.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.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) - if (typeof message.readOnly !== "boolean") - return "readOnly: boolean expected"; - return null; - }; - - /** - * Creates a NFSVolumeSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource - */ - NFSVolumeSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.NFSVolumeSource) - return object; - var message = new $root.google.cloud.run.v2.NFSVolumeSource(); - if (object.server != null) - message.server = String(object.server); - if (object.path != null) - message.path = String(object.path); - if (object.readOnly != null) - message.readOnly = Boolean(object.readOnly); - return message; - }; - - /** - * Creates a plain object from a NFSVolumeSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {google.cloud.run.v2.NFSVolumeSource} message NFSVolumeSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NFSVolumeSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.server = ""; - object.path = ""; - object.readOnly = false; - } - if (message.server != null && message.hasOwnProperty("server")) - object.server = message.server; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) - object.readOnly = message.readOnly; - return object; - }; - - /** - * Converts this NFSVolumeSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.NFSVolumeSource - * @instance - * @returns {Object.} JSON object - */ - NFSVolumeSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NFSVolumeSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NFSVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.NFSVolumeSource"; - }; - - return NFSVolumeSource; - })(); - - v2.GCSVolumeSource = (function() { - - /** - * Properties of a GCSVolumeSource. - * @memberof google.cloud.run.v2 - * @interface IGCSVolumeSource - * @property {string|null} [bucket] GCSVolumeSource bucket - * @property {boolean|null} [readOnly] GCSVolumeSource readOnly - * @property {Array.|null} [mountOptions] GCSVolumeSource mountOptions - */ - - /** - * Constructs a new GCSVolumeSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GCSVolumeSource. - * @implements IGCSVolumeSource - * @constructor - * @param {google.cloud.run.v2.IGCSVolumeSource=} [properties] Properties to set - */ - function GCSVolumeSource(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]]; - } - - /** - * GCSVolumeSource bucket. - * @member {string} bucket - * @memberof google.cloud.run.v2.GCSVolumeSource - * @instance - */ - GCSVolumeSource.prototype.bucket = ""; - - /** - * GCSVolumeSource readOnly. - * @member {boolean} readOnly - * @memberof google.cloud.run.v2.GCSVolumeSource - * @instance - */ - GCSVolumeSource.prototype.readOnly = false; - - /** - * GCSVolumeSource mountOptions. - * @member {Array.} mountOptions - * @memberof google.cloud.run.v2.GCSVolumeSource - * @instance - */ - GCSVolumeSource.prototype.mountOptions = $util.emptyArray; - - /** - * Creates a new GCSVolumeSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {google.cloud.run.v2.IGCSVolumeSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource instance - */ - GCSVolumeSource.create = function create(properties) { - return new GCSVolumeSource(properties); - }; - - /** - * Encodes the specified GCSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {google.cloud.run.v2.IGCSVolumeSource} message GCSVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCSVolumeSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); - if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.readOnly); - if (message.mountOptions != null && message.mountOptions.length) - for (var i = 0; i < message.mountOptions.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.mountOptions[i]); - return writer; - }; - - /** - * Encodes the specified GCSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {google.cloud.run.v2.IGCSVolumeSource} message GCSVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCSVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCSVolumeSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCSVolumeSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GCSVolumeSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bucket = reader.string(); - break; - } - case 2: { - message.readOnly = reader.bool(); - break; - } - case 3: { - if (!(message.mountOptions && message.mountOptions.length)) - message.mountOptions = []; - message.mountOptions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCSVolumeSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCSVolumeSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCSVolumeSource message. - * @function verify - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCSVolumeSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bucket != null && message.hasOwnProperty("bucket")) - if (!$util.isString(message.bucket)) - return "bucket: string expected"; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) - if (typeof message.readOnly !== "boolean") - return "readOnly: boolean 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 GCSVolumeSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource - */ - GCSVolumeSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GCSVolumeSource) - return object; - var message = new $root.google.cloud.run.v2.GCSVolumeSource(); - if (object.bucket != null) - message.bucket = String(object.bucket); - if (object.readOnly != null) - message.readOnly = Boolean(object.readOnly); - if (object.mountOptions) { - if (!Array.isArray(object.mountOptions)) - throw TypeError(".google.cloud.run.v2.GCSVolumeSource.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 GCSVolumeSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {google.cloud.run.v2.GCSVolumeSource} message GCSVolumeSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCSVolumeSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mountOptions = []; - if (options.defaults) { - object.bucket = ""; - object.readOnly = false; - } - if (message.bucket != null && message.hasOwnProperty("bucket")) - object.bucket = message.bucket; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) - object.readOnly = message.readOnly; - if (message.mountOptions && message.mountOptions.length) { - object.mountOptions = []; - for (var j = 0; j < message.mountOptions.length; ++j) - object.mountOptions[j] = message.mountOptions[j]; - } - return object; - }; - - /** - * Converts this GCSVolumeSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GCSVolumeSource - * @instance - * @returns {Object.} JSON object - */ - GCSVolumeSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCSVolumeSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCSVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GCSVolumeSource"; - }; - - return GCSVolumeSource; - })(); - - v2.Probe = (function() { - - /** - * Properties of a Probe. - * @memberof google.cloud.run.v2 - * @interface IProbe - * @property {number|null} [initialDelaySeconds] Probe initialDelaySeconds - * @property {number|null} [timeoutSeconds] Probe timeoutSeconds - * @property {number|null} [periodSeconds] Probe periodSeconds - * @property {number|null} [failureThreshold] Probe failureThreshold - * @property {google.cloud.run.v2.IHTTPGetAction|null} [httpGet] Probe httpGet - * @property {google.cloud.run.v2.ITCPSocketAction|null} [tcpSocket] Probe tcpSocket - * @property {google.cloud.run.v2.IGRPCAction|null} [grpc] Probe grpc - */ - - /** - * Constructs a new Probe. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Probe. - * @implements IProbe - * @constructor - * @param {google.cloud.run.v2.IProbe=} [properties] Properties to set - */ - function Probe(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Probe initialDelaySeconds. - * @member {number} initialDelaySeconds - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.initialDelaySeconds = 0; - - /** - * Probe timeoutSeconds. - * @member {number} timeoutSeconds - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.timeoutSeconds = 0; - - /** - * Probe periodSeconds. - * @member {number} periodSeconds - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.periodSeconds = 0; - - /** - * Probe failureThreshold. - * @member {number} failureThreshold - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.failureThreshold = 0; - - /** - * Probe httpGet. - * @member {google.cloud.run.v2.IHTTPGetAction|null|undefined} httpGet - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.httpGet = null; - - /** - * Probe tcpSocket. - * @member {google.cloud.run.v2.ITCPSocketAction|null|undefined} tcpSocket - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.tcpSocket = null; - - /** - * Probe grpc. - * @member {google.cloud.run.v2.IGRPCAction|null|undefined} grpc - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.grpc = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Probe probeType. - * @member {"httpGet"|"tcpSocket"|"grpc"|undefined} probeType - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Object.defineProperty(Probe.prototype, "probeType", { - get: $util.oneOfGetter($oneOfFields = ["httpGet", "tcpSocket", "grpc"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Probe instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Probe - * @static - * @param {google.cloud.run.v2.IProbe=} [properties] Properties to set - * @returns {google.cloud.run.v2.Probe} Probe instance - */ - Probe.create = function create(properties) { - return new Probe(properties); - }; - - /** - * Encodes the specified Probe message. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Probe - * @static - * @param {google.cloud.run.v2.IProbe} message Probe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Probe.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialDelaySeconds != null && Object.hasOwnProperty.call(message, "initialDelaySeconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.initialDelaySeconds); - if (message.timeoutSeconds != null && Object.hasOwnProperty.call(message, "timeoutSeconds")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.timeoutSeconds); - if (message.periodSeconds != null && Object.hasOwnProperty.call(message, "periodSeconds")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.periodSeconds); - if (message.failureThreshold != null && Object.hasOwnProperty.call(message, "failureThreshold")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureThreshold); - if (message.httpGet != null && Object.hasOwnProperty.call(message, "httpGet")) - $root.google.cloud.run.v2.HTTPGetAction.encode(message.httpGet, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.tcpSocket != null && Object.hasOwnProperty.call(message, "tcpSocket")) - $root.google.cloud.run.v2.TCPSocketAction.encode(message.tcpSocket, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.grpc != null && Object.hasOwnProperty.call(message, "grpc")) - $root.google.cloud.run.v2.GRPCAction.encode(message.grpc, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Probe message, length delimited. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Probe - * @static - * @param {google.cloud.run.v2.IProbe} message Probe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Probe.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Probe message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Probe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Probe} Probe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Probe.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Probe(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialDelaySeconds = reader.int32(); - break; - } - case 2: { - message.timeoutSeconds = reader.int32(); - break; - } - case 3: { - message.periodSeconds = reader.int32(); - break; - } - case 4: { - message.failureThreshold = reader.int32(); - break; - } - case 5: { - message.httpGet = $root.google.cloud.run.v2.HTTPGetAction.decode(reader, reader.uint32()); - break; - } - case 6: { - message.tcpSocket = $root.google.cloud.run.v2.TCPSocketAction.decode(reader, reader.uint32()); - break; - } - case 7: { - message.grpc = $root.google.cloud.run.v2.GRPCAction.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Probe message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Probe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Probe} Probe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Probe.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Probe message. - * @function verify - * @memberof google.cloud.run.v2.Probe - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Probe.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.initialDelaySeconds != null && message.hasOwnProperty("initialDelaySeconds")) - if (!$util.isInteger(message.initialDelaySeconds)) - return "initialDelaySeconds: integer expected"; - if (message.timeoutSeconds != null && message.hasOwnProperty("timeoutSeconds")) - if (!$util.isInteger(message.timeoutSeconds)) - return "timeoutSeconds: integer expected"; - if (message.periodSeconds != null && message.hasOwnProperty("periodSeconds")) - if (!$util.isInteger(message.periodSeconds)) - return "periodSeconds: integer expected"; - if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) - if (!$util.isInteger(message.failureThreshold)) - return "failureThreshold: integer expected"; - if (message.httpGet != null && message.hasOwnProperty("httpGet")) { - properties.probeType = 1; - { - var error = $root.google.cloud.run.v2.HTTPGetAction.verify(message.httpGet); - if (error) - return "httpGet." + error; - } - } - if (message.tcpSocket != null && message.hasOwnProperty("tcpSocket")) { - if (properties.probeType === 1) - return "probeType: multiple values"; - properties.probeType = 1; - { - var error = $root.google.cloud.run.v2.TCPSocketAction.verify(message.tcpSocket); - if (error) - return "tcpSocket." + error; - } - } - if (message.grpc != null && message.hasOwnProperty("grpc")) { - if (properties.probeType === 1) - return "probeType: multiple values"; - properties.probeType = 1; - { - var error = $root.google.cloud.run.v2.GRPCAction.verify(message.grpc); - if (error) - return "grpc." + error; - } - } - return null; - }; - - /** - * Creates a Probe message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Probe - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Probe} Probe - */ - Probe.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Probe) - return object; - var message = new $root.google.cloud.run.v2.Probe(); - if (object.initialDelaySeconds != null) - message.initialDelaySeconds = object.initialDelaySeconds | 0; - if (object.timeoutSeconds != null) - message.timeoutSeconds = object.timeoutSeconds | 0; - if (object.periodSeconds != null) - message.periodSeconds = object.periodSeconds | 0; - if (object.failureThreshold != null) - message.failureThreshold = object.failureThreshold | 0; - if (object.httpGet != null) { - if (typeof object.httpGet !== "object") - throw TypeError(".google.cloud.run.v2.Probe.httpGet: object expected"); - message.httpGet = $root.google.cloud.run.v2.HTTPGetAction.fromObject(object.httpGet); - } - if (object.tcpSocket != null) { - if (typeof object.tcpSocket !== "object") - throw TypeError(".google.cloud.run.v2.Probe.tcpSocket: object expected"); - message.tcpSocket = $root.google.cloud.run.v2.TCPSocketAction.fromObject(object.tcpSocket); - } - if (object.grpc != null) { - if (typeof object.grpc !== "object") - throw TypeError(".google.cloud.run.v2.Probe.grpc: object expected"); - message.grpc = $root.google.cloud.run.v2.GRPCAction.fromObject(object.grpc); - } - return message; - }; - - /** - * Creates a plain object from a Probe message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Probe - * @static - * @param {google.cloud.run.v2.Probe} message Probe - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Probe.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialDelaySeconds = 0; - object.timeoutSeconds = 0; - object.periodSeconds = 0; - object.failureThreshold = 0; - } - if (message.initialDelaySeconds != null && message.hasOwnProperty("initialDelaySeconds")) - object.initialDelaySeconds = message.initialDelaySeconds; - if (message.timeoutSeconds != null && message.hasOwnProperty("timeoutSeconds")) - object.timeoutSeconds = message.timeoutSeconds; - if (message.periodSeconds != null && message.hasOwnProperty("periodSeconds")) - object.periodSeconds = message.periodSeconds; - if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) - object.failureThreshold = message.failureThreshold; - if (message.httpGet != null && message.hasOwnProperty("httpGet")) { - object.httpGet = $root.google.cloud.run.v2.HTTPGetAction.toObject(message.httpGet, options); - if (options.oneofs) - object.probeType = "httpGet"; - } - if (message.tcpSocket != null && message.hasOwnProperty("tcpSocket")) { - object.tcpSocket = $root.google.cloud.run.v2.TCPSocketAction.toObject(message.tcpSocket, options); - if (options.oneofs) - object.probeType = "tcpSocket"; - } - if (message.grpc != null && message.hasOwnProperty("grpc")) { - object.grpc = $root.google.cloud.run.v2.GRPCAction.toObject(message.grpc, options); - if (options.oneofs) - object.probeType = "grpc"; - } - return object; - }; - - /** - * Converts this Probe to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Probe - * @instance - * @returns {Object.} JSON object - */ - Probe.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Probe - * @function getTypeUrl - * @memberof google.cloud.run.v2.Probe - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Probe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Probe"; - }; - - return Probe; - })(); - - v2.HTTPGetAction = (function() { - - /** - * Properties of a HTTPGetAction. - * @memberof google.cloud.run.v2 - * @interface IHTTPGetAction - * @property {string|null} [path] HTTPGetAction path - * @property {Array.|null} [httpHeaders] HTTPGetAction httpHeaders - * @property {number|null} [port] HTTPGetAction port - */ - - /** - * Constructs a new HTTPGetAction. - * @memberof google.cloud.run.v2 - * @classdesc Represents a HTTPGetAction. - * @implements IHTTPGetAction - * @constructor - * @param {google.cloud.run.v2.IHTTPGetAction=} [properties] Properties to set - */ - function HTTPGetAction(properties) { - this.httpHeaders = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HTTPGetAction path. - * @member {string} path - * @memberof google.cloud.run.v2.HTTPGetAction - * @instance - */ - HTTPGetAction.prototype.path = ""; - - /** - * HTTPGetAction httpHeaders. - * @member {Array.} httpHeaders - * @memberof google.cloud.run.v2.HTTPGetAction - * @instance - */ - HTTPGetAction.prototype.httpHeaders = $util.emptyArray; - - /** - * HTTPGetAction port. - * @member {number} port - * @memberof google.cloud.run.v2.HTTPGetAction - * @instance - */ - HTTPGetAction.prototype.port = 0; - - /** - * Creates a new HTTPGetAction instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {google.cloud.run.v2.IHTTPGetAction=} [properties] Properties to set - * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction instance - */ - HTTPGetAction.create = function create(properties) { - return new HTTPGetAction(properties); - }; - - /** - * Encodes the specified HTTPGetAction message. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {google.cloud.run.v2.IHTTPGetAction} message HTTPGetAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HTTPGetAction.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.httpHeaders != null && message.httpHeaders.length) - for (var i = 0; i < message.httpHeaders.length; ++i) - $root.google.cloud.run.v2.HTTPHeader.encode(message.httpHeaders[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); - return writer; - }; - - /** - * Encodes the specified HTTPGetAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {google.cloud.run.v2.IHTTPGetAction} message HTTPGetAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HTTPGetAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HTTPGetAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HTTPGetAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.HTTPGetAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.path = reader.string(); - break; - } - case 4: { - if (!(message.httpHeaders && message.httpHeaders.length)) - message.httpHeaders = []; - message.httpHeaders.push($root.google.cloud.run.v2.HTTPHeader.decode(reader, reader.uint32())); - break; - } - case 5: { - message.port = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HTTPGetAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HTTPGetAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HTTPGetAction message. - * @function verify - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HTTPGetAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.httpHeaders != null && message.hasOwnProperty("httpHeaders")) { - if (!Array.isArray(message.httpHeaders)) - return "httpHeaders: array expected"; - for (var i = 0; i < message.httpHeaders.length; ++i) { - var error = $root.google.cloud.run.v2.HTTPHeader.verify(message.httpHeaders[i]); - if (error) - return "httpHeaders." + error; - } - } - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isInteger(message.port)) - return "port: integer expected"; - return null; - }; - - /** - * Creates a HTTPGetAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction - */ - HTTPGetAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.HTTPGetAction) - return object; - var message = new $root.google.cloud.run.v2.HTTPGetAction(); - if (object.path != null) - message.path = String(object.path); - if (object.httpHeaders) { - if (!Array.isArray(object.httpHeaders)) - throw TypeError(".google.cloud.run.v2.HTTPGetAction.httpHeaders: array expected"); - message.httpHeaders = []; - for (var i = 0; i < object.httpHeaders.length; ++i) { - if (typeof object.httpHeaders[i] !== "object") - throw TypeError(".google.cloud.run.v2.HTTPGetAction.httpHeaders: object expected"); - message.httpHeaders[i] = $root.google.cloud.run.v2.HTTPHeader.fromObject(object.httpHeaders[i]); - } - } - if (object.port != null) - message.port = object.port | 0; - return message; - }; - - /** - * Creates a plain object from a HTTPGetAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {google.cloud.run.v2.HTTPGetAction} message HTTPGetAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HTTPGetAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.httpHeaders = []; - if (options.defaults) { - object.path = ""; - object.port = 0; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.httpHeaders && message.httpHeaders.length) { - object.httpHeaders = []; - for (var j = 0; j < message.httpHeaders.length; ++j) - object.httpHeaders[j] = $root.google.cloud.run.v2.HTTPHeader.toObject(message.httpHeaders[j], options); - } - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - return object; - }; - - /** - * Converts this HTTPGetAction to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.HTTPGetAction - * @instance - * @returns {Object.} JSON object - */ - HTTPGetAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HTTPGetAction - * @function getTypeUrl - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HTTPGetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.HTTPGetAction"; - }; - - return HTTPGetAction; - })(); - - v2.HTTPHeader = (function() { - - /** - * Properties of a HTTPHeader. - * @memberof google.cloud.run.v2 - * @interface IHTTPHeader - * @property {string|null} [name] HTTPHeader name - * @property {string|null} [value] HTTPHeader value - */ - - /** - * Constructs a new HTTPHeader. - * @memberof google.cloud.run.v2 - * @classdesc Represents a HTTPHeader. - * @implements IHTTPHeader - * @constructor - * @param {google.cloud.run.v2.IHTTPHeader=} [properties] Properties to set - */ - function HTTPHeader(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HTTPHeader name. - * @member {string} name - * @memberof google.cloud.run.v2.HTTPHeader - * @instance - */ - HTTPHeader.prototype.name = ""; - - /** - * HTTPHeader value. - * @member {string} value - * @memberof google.cloud.run.v2.HTTPHeader - * @instance - */ - HTTPHeader.prototype.value = ""; - - /** - * Creates a new HTTPHeader instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {google.cloud.run.v2.IHTTPHeader=} [properties] Properties to set - * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader instance - */ - HTTPHeader.create = function create(properties) { - return new HTTPHeader(properties); - }; - - /** - * Encodes the specified HTTPHeader message. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {google.cloud.run.v2.IHTTPHeader} message HTTPHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HTTPHeader.encode = function encode(message, writer) { - if (!writer) - 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 && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - return writer; - }; - - /** - * Encodes the specified HTTPHeader message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {google.cloud.run.v2.IHTTPHeader} message HTTPHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HTTPHeader.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HTTPHeader message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HTTPHeader.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.HTTPHeader(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HTTPHeader message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HTTPHeader.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HTTPHeader message. - * @function verify - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HTTPHeader.verify = function verify(message) { - if (typeof message !== "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 (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a HTTPHeader message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader - */ - HTTPHeader.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.HTTPHeader) - return object; - var message = new $root.google.cloud.run.v2.HTTPHeader(); - if (object.name != null) - message.name = String(object.name); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a HTTPHeader message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {google.cloud.run.v2.HTTPHeader} message HTTPHeader - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HTTPHeader.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.value = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this HTTPHeader to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.HTTPHeader - * @instance - * @returns {Object.} JSON object - */ - HTTPHeader.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HTTPHeader - * @function getTypeUrl - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HTTPHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.HTTPHeader"; - }; - - return HTTPHeader; - })(); - - v2.TCPSocketAction = (function() { - - /** - * Properties of a TCPSocketAction. - * @memberof google.cloud.run.v2 - * @interface ITCPSocketAction - * @property {number|null} [port] TCPSocketAction port - */ - - /** - * Constructs a new TCPSocketAction. - * @memberof google.cloud.run.v2 - * @classdesc Represents a TCPSocketAction. - * @implements ITCPSocketAction - * @constructor - * @param {google.cloud.run.v2.ITCPSocketAction=} [properties] Properties to set - */ - function TCPSocketAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TCPSocketAction port. - * @member {number} port - * @memberof google.cloud.run.v2.TCPSocketAction - * @instance - */ - TCPSocketAction.prototype.port = 0; - - /** - * Creates a new TCPSocketAction instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {google.cloud.run.v2.ITCPSocketAction=} [properties] Properties to set - * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction instance - */ - TCPSocketAction.create = function create(properties) { - return new TCPSocketAction(properties); - }; - - /** - * Encodes the specified TCPSocketAction message. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {google.cloud.run.v2.ITCPSocketAction} message TCPSocketAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TCPSocketAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port); - return writer; - }; - - /** - * Encodes the specified TCPSocketAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {google.cloud.run.v2.ITCPSocketAction} message TCPSocketAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TCPSocketAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TCPSocketAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TCPSocketAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TCPSocketAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.port = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TCPSocketAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TCPSocketAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TCPSocketAction message. - * @function verify - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TCPSocketAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isInteger(message.port)) - return "port: integer expected"; - return null; - }; - - /** - * Creates a TCPSocketAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction - */ - TCPSocketAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.TCPSocketAction) - return object; - var message = new $root.google.cloud.run.v2.TCPSocketAction(); - if (object.port != null) - message.port = object.port | 0; - return message; - }; - - /** - * Creates a plain object from a TCPSocketAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {google.cloud.run.v2.TCPSocketAction} message TCPSocketAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TCPSocketAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.port = 0; - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - return object; - }; - - /** - * Converts this TCPSocketAction to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.TCPSocketAction - * @instance - * @returns {Object.} JSON object - */ - TCPSocketAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TCPSocketAction - * @function getTypeUrl - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TCPSocketAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.TCPSocketAction"; - }; - - return TCPSocketAction; - })(); - - v2.GRPCAction = (function() { - - /** - * Properties of a GRPCAction. - * @memberof google.cloud.run.v2 - * @interface IGRPCAction - * @property {number|null} [port] GRPCAction port - * @property {string|null} [service] GRPCAction service - */ - - /** - * Constructs a new GRPCAction. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GRPCAction. - * @implements IGRPCAction - * @constructor - * @param {google.cloud.run.v2.IGRPCAction=} [properties] Properties to set - */ - function GRPCAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GRPCAction port. - * @member {number} port - * @memberof google.cloud.run.v2.GRPCAction - * @instance - */ - GRPCAction.prototype.port = 0; - - /** - * GRPCAction service. - * @member {string} service - * @memberof google.cloud.run.v2.GRPCAction - * @instance - */ - GRPCAction.prototype.service = ""; - - /** - * Creates a new GRPCAction instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {google.cloud.run.v2.IGRPCAction=} [properties] Properties to set - * @returns {google.cloud.run.v2.GRPCAction} GRPCAction instance - */ - GRPCAction.create = function create(properties) { - return new GRPCAction(properties); - }; - - /** - * Encodes the specified GRPCAction message. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {google.cloud.run.v2.IGRPCAction} message GRPCAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GRPCAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - return writer; - }; - - /** - * Encodes the specified GRPCAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {google.cloud.run.v2.IGRPCAction} message GRPCAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GRPCAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GRPCAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GRPCAction} GRPCAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GRPCAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GRPCAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.port = reader.int32(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GRPCAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GRPCAction} GRPCAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GRPCAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GRPCAction message. - * @function verify - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GRPCAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isInteger(message.port)) - return "port: integer expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - return null; - }; - - /** - * Creates a GRPCAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GRPCAction} GRPCAction - */ - GRPCAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GRPCAction) - return object; - var message = new $root.google.cloud.run.v2.GRPCAction(); - if (object.port != null) - message.port = object.port | 0; - if (object.service != null) - message.service = String(object.service); - return message; - }; - - /** - * Creates a plain object from a GRPCAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {google.cloud.run.v2.GRPCAction} message GRPCAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GRPCAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port = 0; - object.service = ""; - } - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - return object; - }; - - /** - * Converts this GRPCAction to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GRPCAction - * @instance - * @returns {Object.} JSON object - */ - GRPCAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GRPCAction - * @function getTypeUrl - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GRPCAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GRPCAction"; - }; - - return GRPCAction; - })(); - - v2.BuildInfo = (function() { - - /** - * Properties of a BuildInfo. - * @memberof google.cloud.run.v2 - * @interface IBuildInfo - * @property {string|null} [functionTarget] BuildInfo functionTarget - * @property {string|null} [sourceLocation] BuildInfo sourceLocation - */ - - /** - * Constructs a new BuildInfo. - * @memberof google.cloud.run.v2 - * @classdesc Represents a BuildInfo. - * @implements IBuildInfo - * @constructor - * @param {google.cloud.run.v2.IBuildInfo=} [properties] Properties to set - */ - function BuildInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BuildInfo functionTarget. - * @member {string} functionTarget - * @memberof google.cloud.run.v2.BuildInfo - * @instance - */ - BuildInfo.prototype.functionTarget = ""; - - /** - * BuildInfo sourceLocation. - * @member {string} sourceLocation - * @memberof google.cloud.run.v2.BuildInfo - * @instance - */ - BuildInfo.prototype.sourceLocation = ""; - - /** - * Creates a new BuildInfo instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {google.cloud.run.v2.IBuildInfo=} [properties] Properties to set - * @returns {google.cloud.run.v2.BuildInfo} BuildInfo instance - */ - BuildInfo.create = function create(properties) { - return new BuildInfo(properties); - }; - - /** - * Encodes the specified BuildInfo message. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {google.cloud.run.v2.IBuildInfo} message BuildInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.functionTarget != null && Object.hasOwnProperty.call(message, "functionTarget")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.functionTarget); - if (message.sourceLocation != null && Object.hasOwnProperty.call(message, "sourceLocation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLocation); - return writer; - }; - - /** - * Encodes the specified BuildInfo message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {google.cloud.run.v2.IBuildInfo} message BuildInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BuildInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.BuildInfo} BuildInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.BuildInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.functionTarget = reader.string(); - break; - } - case 2: { - message.sourceLocation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BuildInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.BuildInfo} BuildInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BuildInfo message. - * @function verify - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BuildInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - if (!$util.isString(message.functionTarget)) - return "functionTarget: string expected"; - if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) - if (!$util.isString(message.sourceLocation)) - return "sourceLocation: string expected"; - return null; - }; - - /** - * Creates a BuildInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.BuildInfo} BuildInfo - */ - BuildInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.BuildInfo) - return object; - var message = new $root.google.cloud.run.v2.BuildInfo(); - if (object.functionTarget != null) - message.functionTarget = String(object.functionTarget); - if (object.sourceLocation != null) - message.sourceLocation = String(object.sourceLocation); - return message; - }; - - /** - * Creates a plain object from a BuildInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {google.cloud.run.v2.BuildInfo} message BuildInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BuildInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.functionTarget = ""; - object.sourceLocation = ""; - } - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - object.functionTarget = message.functionTarget; - if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) - object.sourceLocation = message.sourceLocation; - return object; - }; - - /** - * Converts this BuildInfo to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.BuildInfo - * @instance - * @returns {Object.} JSON object - */ - BuildInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BuildInfo - * @function getTypeUrl - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BuildInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.BuildInfo"; - }; - - return BuildInfo; - })(); - - v2.SourceCode = (function() { - - /** - * Properties of a SourceCode. - * @memberof google.cloud.run.v2 - * @interface ISourceCode - * @property {google.cloud.run.v2.SourceCode.ICloudStorageSource|null} [cloudStorageSource] SourceCode cloudStorageSource - */ - - /** - * Constructs a new SourceCode. - * @memberof google.cloud.run.v2 - * @classdesc Represents a SourceCode. - * @implements ISourceCode - * @constructor - * @param {google.cloud.run.v2.ISourceCode=} [properties] Properties to set - */ - function SourceCode(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCode cloudStorageSource. - * @member {google.cloud.run.v2.SourceCode.ICloudStorageSource|null|undefined} cloudStorageSource - * @memberof google.cloud.run.v2.SourceCode - * @instance - */ - SourceCode.prototype.cloudStorageSource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SourceCode sourceType. - * @member {"cloudStorageSource"|undefined} sourceType - * @memberof google.cloud.run.v2.SourceCode - * @instance - */ - Object.defineProperty(SourceCode.prototype, "sourceType", { - get: $util.oneOfGetter($oneOfFields = ["cloudStorageSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SourceCode instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {google.cloud.run.v2.ISourceCode=} [properties] Properties to set - * @returns {google.cloud.run.v2.SourceCode} SourceCode instance - */ - SourceCode.create = function create(properties) { - return new SourceCode(properties); - }; - - /** - * Encodes the specified SourceCode message. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {google.cloud.run.v2.ISourceCode} message SourceCode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cloudStorageSource != null && Object.hasOwnProperty.call(message, "cloudStorageSource")) - $root.google.cloud.run.v2.SourceCode.CloudStorageSource.encode(message.cloudStorageSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCode message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {google.cloud.run.v2.ISourceCode} message SourceCode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SourceCode} SourceCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SourceCode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cloudStorageSource = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SourceCode} SourceCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCode message. - * @function verify - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cloudStorageSource != null && message.hasOwnProperty("cloudStorageSource")) { - properties.sourceType = 1; - { - var error = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.verify(message.cloudStorageSource); - if (error) - return "cloudStorageSource." + error; - } - } - return null; - }; - - /** - * Creates a SourceCode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SourceCode} SourceCode - */ - SourceCode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SourceCode) - return object; - var message = new $root.google.cloud.run.v2.SourceCode(); - if (object.cloudStorageSource != null) { - if (typeof object.cloudStorageSource !== "object") - throw TypeError(".google.cloud.run.v2.SourceCode.cloudStorageSource: object expected"); - message.cloudStorageSource = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.fromObject(object.cloudStorageSource); - } - return message; - }; - - /** - * Creates a plain object from a SourceCode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {google.cloud.run.v2.SourceCode} message SourceCode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.cloudStorageSource != null && message.hasOwnProperty("cloudStorageSource")) { - object.cloudStorageSource = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.toObject(message.cloudStorageSource, options); - if (options.oneofs) - object.sourceType = "cloudStorageSource"; - } - return object; - }; - - /** - * Converts this SourceCode to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SourceCode - * @instance - * @returns {Object.} JSON object - */ - SourceCode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCode - * @function getTypeUrl - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SourceCode"; - }; - - SourceCode.CloudStorageSource = (function() { - - /** - * Properties of a CloudStorageSource. - * @memberof google.cloud.run.v2.SourceCode - * @interface ICloudStorageSource - * @property {string|null} [bucket] CloudStorageSource bucket - * @property {string|null} [object] CloudStorageSource object - * @property {number|Long|null} [generation] CloudStorageSource generation - */ - - /** - * Constructs a new CloudStorageSource. - * @memberof google.cloud.run.v2.SourceCode - * @classdesc Represents a CloudStorageSource. - * @implements ICloudStorageSource - * @constructor - * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource=} [properties] Properties to set - */ - function CloudStorageSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudStorageSource bucket. - * @member {string} bucket - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @instance - */ - CloudStorageSource.prototype.bucket = ""; - - /** - * CloudStorageSource object. - * @member {string} object - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @instance - */ - CloudStorageSource.prototype.object = ""; - - /** - * CloudStorageSource generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @instance - */ - CloudStorageSource.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new CloudStorageSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource instance - */ - CloudStorageSource.create = function create(properties) { - return new CloudStorageSource(properties); - }; - - /** - * Encodes the specified CloudStorageSource message. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource} message CloudStorageSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudStorageSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); - if (message.object != null && Object.hasOwnProperty.call(message, "object")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - return writer; - }; - - /** - * Encodes the specified CloudStorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource} message CloudStorageSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudStorageSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudStorageSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudStorageSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SourceCode.CloudStorageSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bucket = reader.string(); - break; - } - case 2: { - message.object = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudStorageSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudStorageSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudStorageSource message. - * @function verify - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudStorageSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bucket != null && message.hasOwnProperty("bucket")) - if (!$util.isString(message.bucket)) - return "bucket: string expected"; - if (message.object != null && message.hasOwnProperty("object")) - if (!$util.isString(message.object)) - return "object: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - return null; - }; - - /** - * Creates a CloudStorageSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource - */ - CloudStorageSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SourceCode.CloudStorageSource) - return object; - var message = new $root.google.cloud.run.v2.SourceCode.CloudStorageSource(); - if (object.bucket != null) - message.bucket = String(object.bucket); - if (object.object != null) - message.object = String(object.object); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a CloudStorageSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {google.cloud.run.v2.SourceCode.CloudStorageSource} message CloudStorageSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudStorageSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.bucket = ""; - object.object = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - } - if (message.bucket != null && message.hasOwnProperty("bucket")) - object.bucket = message.bucket; - if (message.object != null && message.hasOwnProperty("object")) - object.object = message.object; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - return object; - }; - - /** - * Converts this CloudStorageSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @instance - * @returns {Object.} JSON object - */ - CloudStorageSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudStorageSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudStorageSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SourceCode.CloudStorageSource"; - }; - - return CloudStorageSource; - })(); - - return SourceCode; - })(); - - v2.VpcAccess = (function() { - - /** - * Properties of a VpcAccess. - * @memberof google.cloud.run.v2 - * @interface IVpcAccess - * @property {string|null} [connector] VpcAccess connector - * @property {google.cloud.run.v2.VpcAccess.VpcEgress|null} [egress] VpcAccess egress - * @property {Array.|null} [networkInterfaces] VpcAccess networkInterfaces - */ - - /** - * Constructs a new VpcAccess. - * @memberof google.cloud.run.v2 - * @classdesc Represents a VpcAccess. - * @implements IVpcAccess - * @constructor - * @param {google.cloud.run.v2.IVpcAccess=} [properties] Properties to set - */ - function VpcAccess(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]]; - } - - /** - * VpcAccess connector. - * @member {string} connector - * @memberof google.cloud.run.v2.VpcAccess - * @instance - */ - VpcAccess.prototype.connector = ""; - - /** - * VpcAccess egress. - * @member {google.cloud.run.v2.VpcAccess.VpcEgress} egress - * @memberof google.cloud.run.v2.VpcAccess - * @instance - */ - VpcAccess.prototype.egress = 0; - - /** - * VpcAccess networkInterfaces. - * @member {Array.} networkInterfaces - * @memberof google.cloud.run.v2.VpcAccess - * @instance - */ - VpcAccess.prototype.networkInterfaces = $util.emptyArray; - - /** - * Creates a new VpcAccess instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {google.cloud.run.v2.IVpcAccess=} [properties] Properties to set - * @returns {google.cloud.run.v2.VpcAccess} VpcAccess instance - */ - VpcAccess.create = function create(properties) { - return new VpcAccess(properties); - }; - - /** - * Encodes the specified VpcAccess message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {google.cloud.run.v2.IVpcAccess} message VpcAccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VpcAccess.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connector != null && Object.hasOwnProperty.call(message, "connector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connector); - if (message.egress != null && Object.hasOwnProperty.call(message, "egress")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.egress); - if (message.networkInterfaces != null && message.networkInterfaces.length) - for (var i = 0; i < message.networkInterfaces.length; ++i) - $root.google.cloud.run.v2.VpcAccess.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VpcAccess message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {google.cloud.run.v2.IVpcAccess} message VpcAccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VpcAccess.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VpcAccess message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.VpcAccess} VpcAccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VpcAccess.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VpcAccess(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.connector = reader.string(); - break; - } - case 2: { - message.egress = reader.int32(); - break; - } - case 3: { - if (!(message.networkInterfaces && message.networkInterfaces.length)) - message.networkInterfaces = []; - message.networkInterfaces.push($root.google.cloud.run.v2.VpcAccess.NetworkInterface.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VpcAccess message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.VpcAccess} VpcAccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VpcAccess.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VpcAccess message. - * @function verify - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VpcAccess.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connector != null && message.hasOwnProperty("connector")) - if (!$util.isString(message.connector)) - return "connector: string expected"; - if (message.egress != null && message.hasOwnProperty("egress")) - switch (message.egress) { - default: - return "egress: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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.run.v2.VpcAccess.NetworkInterface.verify(message.networkInterfaces[i]); - if (error) - return "networkInterfaces." + error; - } - } - return null; - }; - - /** - * Creates a VpcAccess message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.VpcAccess} VpcAccess - */ - VpcAccess.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.VpcAccess) - return object; - var message = new $root.google.cloud.run.v2.VpcAccess(); - if (object.connector != null) - message.connector = String(object.connector); - switch (object.egress) { - default: - if (typeof object.egress === "number") { - message.egress = object.egress; - break; - } - break; - case "VPC_EGRESS_UNSPECIFIED": - case 0: - message.egress = 0; - break; - case "ALL_TRAFFIC": - case 1: - message.egress = 1; - break; - case "PRIVATE_RANGES_ONLY": - case 2: - message.egress = 2; - break; - } - if (object.networkInterfaces) { - if (!Array.isArray(object.networkInterfaces)) - throw TypeError(".google.cloud.run.v2.VpcAccess.networkInterfaces: array expected"); - message.networkInterfaces = []; - for (var i = 0; i < object.networkInterfaces.length; ++i) { - if (typeof object.networkInterfaces[i] !== "object") - throw TypeError(".google.cloud.run.v2.VpcAccess.networkInterfaces: object expected"); - message.networkInterfaces[i] = $root.google.cloud.run.v2.VpcAccess.NetworkInterface.fromObject(object.networkInterfaces[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a VpcAccess message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {google.cloud.run.v2.VpcAccess} message VpcAccess - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VpcAccess.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.networkInterfaces = []; - if (options.defaults) { - object.connector = ""; - object.egress = options.enums === String ? "VPC_EGRESS_UNSPECIFIED" : 0; - } - if (message.connector != null && message.hasOwnProperty("connector")) - object.connector = message.connector; - if (message.egress != null && message.hasOwnProperty("egress")) - object.egress = options.enums === String ? $root.google.cloud.run.v2.VpcAccess.VpcEgress[message.egress] === undefined ? message.egress : $root.google.cloud.run.v2.VpcAccess.VpcEgress[message.egress] : message.egress; - if (message.networkInterfaces && message.networkInterfaces.length) { - object.networkInterfaces = []; - for (var j = 0; j < message.networkInterfaces.length; ++j) - object.networkInterfaces[j] = $root.google.cloud.run.v2.VpcAccess.NetworkInterface.toObject(message.networkInterfaces[j], options); - } - return object; - }; - - /** - * Converts this VpcAccess to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.VpcAccess - * @instance - * @returns {Object.} JSON object - */ - VpcAccess.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VpcAccess - * @function getTypeUrl - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VpcAccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.VpcAccess"; - }; - - /** - * VpcEgress enum. - * @name google.cloud.run.v2.VpcAccess.VpcEgress - * @enum {number} - * @property {number} VPC_EGRESS_UNSPECIFIED=0 VPC_EGRESS_UNSPECIFIED value - * @property {number} ALL_TRAFFIC=1 ALL_TRAFFIC value - * @property {number} PRIVATE_RANGES_ONLY=2 PRIVATE_RANGES_ONLY value - */ - VpcAccess.VpcEgress = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VPC_EGRESS_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALL_TRAFFIC"] = 1; - values[valuesById[2] = "PRIVATE_RANGES_ONLY"] = 2; - return values; - })(); - - VpcAccess.NetworkInterface = (function() { - - /** - * Properties of a NetworkInterface. - * @memberof google.cloud.run.v2.VpcAccess - * @interface INetworkInterface - * @property {string|null} [network] NetworkInterface network - * @property {string|null} [subnetwork] NetworkInterface subnetwork - * @property {Array.|null} [tags] NetworkInterface tags - */ - - /** - * Constructs a new NetworkInterface. - * @memberof google.cloud.run.v2.VpcAccess - * @classdesc Represents a NetworkInterface. - * @implements INetworkInterface - * @constructor - * @param {google.cloud.run.v2.VpcAccess.INetworkInterface=} [properties] Properties to set - */ - function NetworkInterface(properties) { - 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]]; - } - - /** - * NetworkInterface network. - * @member {string} network - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @instance - */ - NetworkInterface.prototype.network = ""; - - /** - * NetworkInterface subnetwork. - * @member {string} subnetwork - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @instance - */ - NetworkInterface.prototype.subnetwork = ""; - - /** - * NetworkInterface tags. - * @member {Array.} tags - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @instance - */ - NetworkInterface.prototype.tags = $util.emptyArray; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @static - * @param {google.cloud.run.v2.VpcAccess.INetworkInterface=} [properties] Properties to set - * @returns {google.cloud.run.v2.VpcAccess.NetworkInterface} NetworkInterface instance - */ - NetworkInterface.create = function create(properties) { - return new NetworkInterface(properties); - }; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.NetworkInterface.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @static - * @param {google.cloud.run.v2.VpcAccess.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.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tags[i]); - return writer; - }; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.NetworkInterface.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @static - * @param {google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.VpcAccess.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VpcAccess.NetworkInterface(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.subnetwork = reader.string(); - break; - } - case 3: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - 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.run.v2.VpcAccess.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.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.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 a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.VpcAccess.NetworkInterface} NetworkInterface - */ - NetworkInterface.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.VpcAccess.NetworkInterface) - return object; - var message = new $root.google.cloud.run.v2.VpcAccess.NetworkInterface(); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.run.v2.VpcAccess.NetworkInterface.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 a NetworkInterface message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @static - * @param {google.cloud.run.v2.VpcAccess.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.arrays || options.defaults) - object.tags = []; - if (options.defaults) { - object.network = ""; - object.subnetwork = ""; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - object.subnetwork = message.subnetwork; - 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 NetworkInterface to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.NetworkInterface"; - }; - - return NetworkInterface; - })(); - - return VpcAccess; - })(); - - v2.BinaryAuthorization = (function() { - - /** - * Properties of a BinaryAuthorization. - * @memberof google.cloud.run.v2 - * @interface IBinaryAuthorization - * @property {boolean|null} [useDefault] BinaryAuthorization useDefault - * @property {string|null} [policy] BinaryAuthorization policy - * @property {string|null} [breakglassJustification] BinaryAuthorization breakglassJustification - */ - - /** - * Constructs a new BinaryAuthorization. - * @memberof google.cloud.run.v2 - * @classdesc Represents a BinaryAuthorization. - * @implements IBinaryAuthorization - * @constructor - * @param {google.cloud.run.v2.IBinaryAuthorization=} [properties] Properties to set - */ - function BinaryAuthorization(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BinaryAuthorization useDefault. - * @member {boolean|null|undefined} useDefault - * @memberof google.cloud.run.v2.BinaryAuthorization - * @instance - */ - BinaryAuthorization.prototype.useDefault = null; - - /** - * BinaryAuthorization policy. - * @member {string|null|undefined} policy - * @memberof google.cloud.run.v2.BinaryAuthorization - * @instance - */ - BinaryAuthorization.prototype.policy = null; - - /** - * BinaryAuthorization breakglassJustification. - * @member {string} breakglassJustification - * @memberof google.cloud.run.v2.BinaryAuthorization - * @instance - */ - BinaryAuthorization.prototype.breakglassJustification = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BinaryAuthorization binauthzMethod. - * @member {"useDefault"|"policy"|undefined} binauthzMethod - * @memberof google.cloud.run.v2.BinaryAuthorization - * @instance - */ - Object.defineProperty(BinaryAuthorization.prototype, "binauthzMethod", { - get: $util.oneOfGetter($oneOfFields = ["useDefault", "policy"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BinaryAuthorization instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {google.cloud.run.v2.IBinaryAuthorization=} [properties] Properties to set - * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization instance - */ - BinaryAuthorization.create = function create(properties) { - return new BinaryAuthorization(properties); - }; - - /** - * Encodes the specified BinaryAuthorization message. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {google.cloud.run.v2.IBinaryAuthorization} message BinaryAuthorization message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BinaryAuthorization.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.useDefault != null && Object.hasOwnProperty.call(message, "useDefault")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useDefault); - if (message.breakglassJustification != null && Object.hasOwnProperty.call(message, "breakglassJustification")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.breakglassJustification); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.policy); - return writer; - }; - - /** - * Encodes the specified BinaryAuthorization message, length delimited. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {google.cloud.run.v2.IBinaryAuthorization} message BinaryAuthorization message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BinaryAuthorization.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BinaryAuthorization message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BinaryAuthorization.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.BinaryAuthorization(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.useDefault = reader.bool(); - break; - } - case 3: { - message.policy = reader.string(); - break; - } - case 2: { - message.breakglassJustification = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BinaryAuthorization message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BinaryAuthorization.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BinaryAuthorization message. - * @function verify - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BinaryAuthorization.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.useDefault != null && message.hasOwnProperty("useDefault")) { - properties.binauthzMethod = 1; - if (typeof message.useDefault !== "boolean") - return "useDefault: boolean expected"; - } - if (message.policy != null && message.hasOwnProperty("policy")) { - if (properties.binauthzMethod === 1) - return "binauthzMethod: multiple values"; - properties.binauthzMethod = 1; - if (!$util.isString(message.policy)) - return "policy: string expected"; - } - if (message.breakglassJustification != null && message.hasOwnProperty("breakglassJustification")) - if (!$util.isString(message.breakglassJustification)) - return "breakglassJustification: string expected"; - return null; - }; - - /** - * Creates a BinaryAuthorization message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization - */ - BinaryAuthorization.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.BinaryAuthorization) - return object; - var message = new $root.google.cloud.run.v2.BinaryAuthorization(); - if (object.useDefault != null) - message.useDefault = Boolean(object.useDefault); - if (object.policy != null) - message.policy = String(object.policy); - if (object.breakglassJustification != null) - message.breakglassJustification = String(object.breakglassJustification); - return message; - }; - - /** - * Creates a plain object from a BinaryAuthorization message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {google.cloud.run.v2.BinaryAuthorization} message BinaryAuthorization - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BinaryAuthorization.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.breakglassJustification = ""; - if (message.useDefault != null && message.hasOwnProperty("useDefault")) { - object.useDefault = message.useDefault; - if (options.oneofs) - object.binauthzMethod = "useDefault"; - } - if (message.breakglassJustification != null && message.hasOwnProperty("breakglassJustification")) - object.breakglassJustification = message.breakglassJustification; - if (message.policy != null && message.hasOwnProperty("policy")) { - object.policy = message.policy; - if (options.oneofs) - object.binauthzMethod = "policy"; - } - return object; - }; - - /** - * Converts this BinaryAuthorization to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.BinaryAuthorization - * @instance - * @returns {Object.} JSON object - */ - BinaryAuthorization.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BinaryAuthorization - * @function getTypeUrl - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BinaryAuthorization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.BinaryAuthorization"; - }; - - return BinaryAuthorization; - })(); - - v2.RevisionScaling = (function() { - - /** - * Properties of a RevisionScaling. - * @memberof google.cloud.run.v2 - * @interface IRevisionScaling - * @property {number|null} [minInstanceCount] RevisionScaling minInstanceCount - * @property {number|null} [maxInstanceCount] RevisionScaling maxInstanceCount - */ - - /** - * Constructs a new RevisionScaling. - * @memberof google.cloud.run.v2 - * @classdesc Represents a RevisionScaling. - * @implements IRevisionScaling - * @constructor - * @param {google.cloud.run.v2.IRevisionScaling=} [properties] Properties to set - */ - function RevisionScaling(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RevisionScaling minInstanceCount. - * @member {number} minInstanceCount - * @memberof google.cloud.run.v2.RevisionScaling - * @instance - */ - RevisionScaling.prototype.minInstanceCount = 0; - - /** - * RevisionScaling maxInstanceCount. - * @member {number} maxInstanceCount - * @memberof google.cloud.run.v2.RevisionScaling - * @instance - */ - RevisionScaling.prototype.maxInstanceCount = 0; - - /** - * Creates a new RevisionScaling instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {google.cloud.run.v2.IRevisionScaling=} [properties] Properties to set - * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling instance - */ - RevisionScaling.create = function create(properties) { - return new RevisionScaling(properties); - }; - - /** - * Encodes the specified RevisionScaling message. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {google.cloud.run.v2.IRevisionScaling} message RevisionScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionScaling.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minInstanceCount != null && Object.hasOwnProperty.call(message, "minInstanceCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minInstanceCount); - if (message.maxInstanceCount != null && Object.hasOwnProperty.call(message, "maxInstanceCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxInstanceCount); - return writer; - }; - - /** - * Encodes the specified RevisionScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {google.cloud.run.v2.IRevisionScaling} message RevisionScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionScaling.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevisionScaling message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionScaling.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RevisionScaling(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minInstanceCount = reader.int32(); - break; - } - case 2: { - message.maxInstanceCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevisionScaling message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionScaling.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevisionScaling message. - * @function verify - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevisionScaling.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) - if (!$util.isInteger(message.minInstanceCount)) - return "minInstanceCount: integer expected"; - if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) - if (!$util.isInteger(message.maxInstanceCount)) - return "maxInstanceCount: integer expected"; - return null; - }; - - /** - * Creates a RevisionScaling message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling - */ - RevisionScaling.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RevisionScaling) - return object; - var message = new $root.google.cloud.run.v2.RevisionScaling(); - if (object.minInstanceCount != null) - message.minInstanceCount = object.minInstanceCount | 0; - if (object.maxInstanceCount != null) - message.maxInstanceCount = object.maxInstanceCount | 0; - return message; - }; - - /** - * Creates a plain object from a RevisionScaling message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {google.cloud.run.v2.RevisionScaling} message RevisionScaling - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevisionScaling.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minInstanceCount = 0; - object.maxInstanceCount = 0; - } - if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) - object.minInstanceCount = message.minInstanceCount; - if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) - object.maxInstanceCount = message.maxInstanceCount; - return object; - }; - - /** - * Converts this RevisionScaling to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RevisionScaling - * @instance - * @returns {Object.} JSON object - */ - RevisionScaling.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevisionScaling - * @function getTypeUrl - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevisionScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RevisionScaling"; - }; - - return RevisionScaling; - })(); - - v2.ServiceMesh = (function() { - - /** - * Properties of a ServiceMesh. - * @memberof google.cloud.run.v2 - * @interface IServiceMesh - * @property {string|null} [mesh] ServiceMesh mesh - */ - - /** - * Constructs a new ServiceMesh. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ServiceMesh. - * @implements IServiceMesh - * @constructor - * @param {google.cloud.run.v2.IServiceMesh=} [properties] Properties to set - */ - function ServiceMesh(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceMesh mesh. - * @member {string} mesh - * @memberof google.cloud.run.v2.ServiceMesh - * @instance - */ - ServiceMesh.prototype.mesh = ""; - - /** - * Creates a new ServiceMesh instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {google.cloud.run.v2.IServiceMesh=} [properties] Properties to set - * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh instance - */ - ServiceMesh.create = function create(properties) { - return new ServiceMesh(properties); - }; - - /** - * Encodes the specified ServiceMesh message. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {google.cloud.run.v2.IServiceMesh} message ServiceMesh message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceMesh.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mesh != null && Object.hasOwnProperty.call(message, "mesh")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mesh); - return writer; - }; - - /** - * Encodes the specified ServiceMesh message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {google.cloud.run.v2.IServiceMesh} message ServiceMesh message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceMesh.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceMesh message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceMesh.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ServiceMesh(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mesh = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceMesh message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceMesh.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceMesh message. - * @function verify - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceMesh.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mesh != null && message.hasOwnProperty("mesh")) - if (!$util.isString(message.mesh)) - return "mesh: string expected"; - return null; - }; - - /** - * Creates a ServiceMesh message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh - */ - ServiceMesh.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ServiceMesh) - return object; - var message = new $root.google.cloud.run.v2.ServiceMesh(); - if (object.mesh != null) - message.mesh = String(object.mesh); - return message; - }; - - /** - * Creates a plain object from a ServiceMesh message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {google.cloud.run.v2.ServiceMesh} message ServiceMesh - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceMesh.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.mesh = ""; - if (message.mesh != null && message.hasOwnProperty("mesh")) - object.mesh = message.mesh; - return object; - }; - - /** - * Converts this ServiceMesh to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ServiceMesh - * @instance - * @returns {Object.} JSON object - */ - ServiceMesh.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceMesh - * @function getTypeUrl - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceMesh.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ServiceMesh"; - }; - - return ServiceMesh; - })(); - - v2.ServiceScaling = (function() { - - /** - * Properties of a ServiceScaling. - * @memberof google.cloud.run.v2 - * @interface IServiceScaling - * @property {number|null} [minInstanceCount] ServiceScaling minInstanceCount - * @property {google.cloud.run.v2.ServiceScaling.ScalingMode|null} [scalingMode] ServiceScaling scalingMode - * @property {number|null} [maxInstanceCount] ServiceScaling maxInstanceCount - * @property {number|null} [manualInstanceCount] ServiceScaling manualInstanceCount - */ - - /** - * Constructs a new ServiceScaling. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ServiceScaling. - * @implements IServiceScaling - * @constructor - * @param {google.cloud.run.v2.IServiceScaling=} [properties] Properties to set - */ - function ServiceScaling(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceScaling minInstanceCount. - * @member {number} minInstanceCount - * @memberof google.cloud.run.v2.ServiceScaling - * @instance - */ - ServiceScaling.prototype.minInstanceCount = 0; - - /** - * ServiceScaling scalingMode. - * @member {google.cloud.run.v2.ServiceScaling.ScalingMode} scalingMode - * @memberof google.cloud.run.v2.ServiceScaling - * @instance - */ - ServiceScaling.prototype.scalingMode = 0; - - /** - * ServiceScaling maxInstanceCount. - * @member {number} maxInstanceCount - * @memberof google.cloud.run.v2.ServiceScaling - * @instance - */ - ServiceScaling.prototype.maxInstanceCount = 0; - - /** - * ServiceScaling manualInstanceCount. - * @member {number|null|undefined} manualInstanceCount - * @memberof google.cloud.run.v2.ServiceScaling - * @instance - */ - ServiceScaling.prototype.manualInstanceCount = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ServiceScaling.prototype, "_manualInstanceCount", { - get: $util.oneOfGetter($oneOfFields = ["manualInstanceCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ServiceScaling instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {google.cloud.run.v2.IServiceScaling=} [properties] Properties to set - * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling instance - */ - ServiceScaling.create = function create(properties) { - return new ServiceScaling(properties); - }; - - /** - * Encodes the specified ServiceScaling message. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {google.cloud.run.v2.IServiceScaling} message ServiceScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceScaling.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minInstanceCount != null && Object.hasOwnProperty.call(message, "minInstanceCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minInstanceCount); - if (message.scalingMode != null && Object.hasOwnProperty.call(message, "scalingMode")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.scalingMode); - if (message.maxInstanceCount != null && Object.hasOwnProperty.call(message, "maxInstanceCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxInstanceCount); - if (message.manualInstanceCount != null && Object.hasOwnProperty.call(message, "manualInstanceCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.manualInstanceCount); - return writer; - }; - - /** - * Encodes the specified ServiceScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {google.cloud.run.v2.IServiceScaling} message ServiceScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceScaling.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceScaling message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceScaling.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ServiceScaling(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minInstanceCount = reader.int32(); - break; - } - case 3: { - message.scalingMode = reader.int32(); - break; - } - case 4: { - message.maxInstanceCount = reader.int32(); - break; - } - case 6: { - message.manualInstanceCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceScaling message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceScaling.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceScaling message. - * @function verify - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceScaling.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) - if (!$util.isInteger(message.minInstanceCount)) - return "minInstanceCount: integer expected"; - if (message.scalingMode != null && message.hasOwnProperty("scalingMode")) - switch (message.scalingMode) { - default: - return "scalingMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) - if (!$util.isInteger(message.maxInstanceCount)) - return "maxInstanceCount: integer expected"; - if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { - properties._manualInstanceCount = 1; - if (!$util.isInteger(message.manualInstanceCount)) - return "manualInstanceCount: integer expected"; - } - return null; - }; - - /** - * Creates a ServiceScaling message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling - */ - ServiceScaling.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ServiceScaling) - return object; - var message = new $root.google.cloud.run.v2.ServiceScaling(); - if (object.minInstanceCount != null) - message.minInstanceCount = object.minInstanceCount | 0; - switch (object.scalingMode) { - default: - if (typeof object.scalingMode === "number") { - message.scalingMode = object.scalingMode; - break; - } - break; - case "SCALING_MODE_UNSPECIFIED": - case 0: - message.scalingMode = 0; - break; - case "AUTOMATIC": - case 1: - message.scalingMode = 1; - break; - case "MANUAL": - case 2: - message.scalingMode = 2; - break; - } - if (object.maxInstanceCount != null) - message.maxInstanceCount = object.maxInstanceCount | 0; - if (object.manualInstanceCount != null) - message.manualInstanceCount = object.manualInstanceCount | 0; - return message; - }; - - /** - * Creates a plain object from a ServiceScaling message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {google.cloud.run.v2.ServiceScaling} message ServiceScaling - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceScaling.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minInstanceCount = 0; - object.scalingMode = options.enums === String ? "SCALING_MODE_UNSPECIFIED" : 0; - object.maxInstanceCount = 0; - } - if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) - object.minInstanceCount = message.minInstanceCount; - if (message.scalingMode != null && message.hasOwnProperty("scalingMode")) - object.scalingMode = options.enums === String ? $root.google.cloud.run.v2.ServiceScaling.ScalingMode[message.scalingMode] === undefined ? message.scalingMode : $root.google.cloud.run.v2.ServiceScaling.ScalingMode[message.scalingMode] : message.scalingMode; - if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) - object.maxInstanceCount = message.maxInstanceCount; - if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { - object.manualInstanceCount = message.manualInstanceCount; - if (options.oneofs) - object._manualInstanceCount = "manualInstanceCount"; - } - return object; - }; - - /** - * Converts this ServiceScaling to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ServiceScaling - * @instance - * @returns {Object.} JSON object - */ - ServiceScaling.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceScaling - * @function getTypeUrl - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ServiceScaling"; - }; - - /** - * ScalingMode enum. - * @name google.cloud.run.v2.ServiceScaling.ScalingMode - * @enum {number} - * @property {number} SCALING_MODE_UNSPECIFIED=0 SCALING_MODE_UNSPECIFIED value - * @property {number} AUTOMATIC=1 AUTOMATIC value - * @property {number} MANUAL=2 MANUAL value - */ - ServiceScaling.ScalingMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCALING_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUTOMATIC"] = 1; - values[valuesById[2] = "MANUAL"] = 2; - return values; - })(); - - return ServiceScaling; - })(); - - v2.WorkerPoolScaling = (function() { - - /** - * Properties of a WorkerPoolScaling. - * @memberof google.cloud.run.v2 - * @interface IWorkerPoolScaling - * @property {number|null} [manualInstanceCount] WorkerPoolScaling manualInstanceCount - */ - - /** - * Constructs a new WorkerPoolScaling. - * @memberof google.cloud.run.v2 - * @classdesc Represents a WorkerPoolScaling. - * @implements IWorkerPoolScaling - * @constructor - * @param {google.cloud.run.v2.IWorkerPoolScaling=} [properties] Properties to set - */ - function WorkerPoolScaling(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkerPoolScaling manualInstanceCount. - * @member {number|null|undefined} manualInstanceCount - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @instance - */ - WorkerPoolScaling.prototype.manualInstanceCount = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(WorkerPoolScaling.prototype, "_manualInstanceCount", { - get: $util.oneOfGetter($oneOfFields = ["manualInstanceCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WorkerPoolScaling instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {google.cloud.run.v2.IWorkerPoolScaling=} [properties] Properties to set - * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling instance - */ - WorkerPoolScaling.create = function create(properties) { - return new WorkerPoolScaling(properties); - }; - - /** - * Encodes the specified WorkerPoolScaling message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {google.cloud.run.v2.IWorkerPoolScaling} message WorkerPoolScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPoolScaling.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.manualInstanceCount != null && Object.hasOwnProperty.call(message, "manualInstanceCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.manualInstanceCount); - return writer; - }; - - /** - * Encodes the specified WorkerPoolScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {google.cloud.run.v2.IWorkerPoolScaling} message WorkerPoolScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPoolScaling.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkerPoolScaling message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPoolScaling.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.WorkerPoolScaling(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 6: { - message.manualInstanceCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkerPoolScaling message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPoolScaling.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkerPoolScaling message. - * @function verify - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkerPoolScaling.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { - properties._manualInstanceCount = 1; - if (!$util.isInteger(message.manualInstanceCount)) - return "manualInstanceCount: integer expected"; - } - return null; - }; - - /** - * Creates a WorkerPoolScaling message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling - */ - WorkerPoolScaling.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.WorkerPoolScaling) - return object; - var message = new $root.google.cloud.run.v2.WorkerPoolScaling(); - if (object.manualInstanceCount != null) - message.manualInstanceCount = object.manualInstanceCount | 0; - return message; - }; - - /** - * Creates a plain object from a WorkerPoolScaling message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {google.cloud.run.v2.WorkerPoolScaling} message WorkerPoolScaling - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkerPoolScaling.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { - object.manualInstanceCount = message.manualInstanceCount; - if (options.oneofs) - object._manualInstanceCount = "manualInstanceCount"; - } - return object; - }; - - /** - * Converts this WorkerPoolScaling to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @instance - * @returns {Object.} JSON object - */ - WorkerPoolScaling.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkerPoolScaling - * @function getTypeUrl - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkerPoolScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.WorkerPoolScaling"; - }; - - return WorkerPoolScaling; - })(); - - v2.NodeSelector = (function() { - - /** - * Properties of a NodeSelector. - * @memberof google.cloud.run.v2 - * @interface INodeSelector - * @property {string|null} [accelerator] NodeSelector accelerator - */ - - /** - * Constructs a new NodeSelector. - * @memberof google.cloud.run.v2 - * @classdesc Represents a NodeSelector. - * @implements INodeSelector - * @constructor - * @param {google.cloud.run.v2.INodeSelector=} [properties] Properties to set - */ - function NodeSelector(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSelector accelerator. - * @member {string} accelerator - * @memberof google.cloud.run.v2.NodeSelector - * @instance - */ - NodeSelector.prototype.accelerator = ""; - - /** - * Creates a new NodeSelector instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {google.cloud.run.v2.INodeSelector=} [properties] Properties to set - * @returns {google.cloud.run.v2.NodeSelector} NodeSelector instance - */ - NodeSelector.create = function create(properties) { - return new NodeSelector(properties); - }; - - /** - * Encodes the specified NodeSelector message. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {google.cloud.run.v2.INodeSelector} message NodeSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.accelerator != null && Object.hasOwnProperty.call(message, "accelerator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.accelerator); - return writer; - }; - - /** - * Encodes the specified NodeSelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {google.cloud.run.v2.INodeSelector} message NodeSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.NodeSelector} NodeSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSelector.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.NodeSelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.accelerator = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.NodeSelector} NodeSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSelector message. - * @function verify - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.accelerator != null && message.hasOwnProperty("accelerator")) - if (!$util.isString(message.accelerator)) - return "accelerator: string expected"; - return null; - }; - - /** - * Creates a NodeSelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.NodeSelector} NodeSelector - */ - NodeSelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.NodeSelector) - return object; - var message = new $root.google.cloud.run.v2.NodeSelector(); - if (object.accelerator != null) - message.accelerator = String(object.accelerator); - return message; - }; - - /** - * Creates a plain object from a NodeSelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {google.cloud.run.v2.NodeSelector} message NodeSelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.accelerator = ""; - if (message.accelerator != null && message.hasOwnProperty("accelerator")) - object.accelerator = message.accelerator; - return object; - }; - - /** - * Converts this NodeSelector to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.NodeSelector - * @instance - * @returns {Object.} JSON object - */ - NodeSelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSelector - * @function getTypeUrl - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.NodeSelector"; - }; - - return NodeSelector; - })(); - - v2.BuildConfig = (function() { - - /** - * Properties of a BuildConfig. - * @memberof google.cloud.run.v2 - * @interface IBuildConfig - * @property {string|null} [name] BuildConfig name - * @property {string|null} [sourceLocation] BuildConfig sourceLocation - * @property {string|null} [functionTarget] BuildConfig functionTarget - * @property {string|null} [imageUri] BuildConfig imageUri - * @property {string|null} [baseImage] BuildConfig baseImage - * @property {boolean|null} [enableAutomaticUpdates] BuildConfig enableAutomaticUpdates - * @property {string|null} [workerPool] BuildConfig workerPool - * @property {Object.|null} [environmentVariables] BuildConfig environmentVariables - * @property {string|null} [serviceAccount] BuildConfig serviceAccount - */ - - /** - * Constructs a new BuildConfig. - * @memberof google.cloud.run.v2 - * @classdesc Represents a BuildConfig. - * @implements IBuildConfig - * @constructor - * @param {google.cloud.run.v2.IBuildConfig=} [properties] Properties to set - */ - function BuildConfig(properties) { - this.environmentVariables = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BuildConfig name. - * @member {string} name - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.name = ""; - - /** - * BuildConfig sourceLocation. - * @member {string} sourceLocation - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.sourceLocation = ""; - - /** - * BuildConfig functionTarget. - * @member {string} functionTarget - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.functionTarget = ""; - - /** - * BuildConfig imageUri. - * @member {string} imageUri - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.imageUri = ""; - - /** - * BuildConfig baseImage. - * @member {string} baseImage - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.baseImage = ""; - - /** - * BuildConfig enableAutomaticUpdates. - * @member {boolean} enableAutomaticUpdates - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.enableAutomaticUpdates = false; - - /** - * BuildConfig workerPool. - * @member {string} workerPool - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.workerPool = ""; - - /** - * BuildConfig environmentVariables. - * @member {Object.} environmentVariables - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.environmentVariables = $util.emptyObject; - - /** - * BuildConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.serviceAccount = ""; - - /** - * Creates a new BuildConfig instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {google.cloud.run.v2.IBuildConfig=} [properties] Properties to set - * @returns {google.cloud.run.v2.BuildConfig} BuildConfig instance - */ - BuildConfig.create = function create(properties) { - return new BuildConfig(properties); - }; - - /** - * Encodes the specified BuildConfig message. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {google.cloud.run.v2.IBuildConfig} message BuildConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.sourceLocation != null && Object.hasOwnProperty.call(message, "sourceLocation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLocation); - if (message.functionTarget != null && Object.hasOwnProperty.call(message, "functionTarget")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.functionTarget); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.imageUri); - if (message.baseImage != null && Object.hasOwnProperty.call(message, "baseImage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.baseImage); - if (message.enableAutomaticUpdates != null && Object.hasOwnProperty.call(message, "enableAutomaticUpdates")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableAutomaticUpdates); - if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.workerPool); - if (message.environmentVariables != null && Object.hasOwnProperty.call(message, "environmentVariables")) - for (var keys = Object.keys(message.environmentVariables), 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.environmentVariables[keys[i]]).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccount); - return writer; - }; - - /** - * Encodes the specified BuildConfig message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {google.cloud.run.v2.IBuildConfig} message BuildConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BuildConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.BuildConfig} BuildConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.BuildConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.sourceLocation = reader.string(); - break; - } - case 3: { - message.functionTarget = reader.string(); - break; - } - case 4: { - message.imageUri = reader.string(); - break; - } - case 5: { - message.baseImage = reader.string(); - break; - } - case 6: { - message.enableAutomaticUpdates = reader.bool(); - break; - } - case 7: { - message.workerPool = reader.string(); - break; - } - case 8: { - if (message.environmentVariables === $util.emptyObject) - message.environmentVariables = {}; - 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.environmentVariables[key] = value; - break; - } - case 9: { - message.serviceAccount = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BuildConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.BuildConfig} BuildConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BuildConfig message. - * @function verify - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BuildConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) - if (!$util.isString(message.sourceLocation)) - return "sourceLocation: string expected"; - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - if (!$util.isString(message.functionTarget)) - return "functionTarget: string expected"; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.baseImage != null && message.hasOwnProperty("baseImage")) - if (!$util.isString(message.baseImage)) - return "baseImage: string expected"; - if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) - if (typeof message.enableAutomaticUpdates !== "boolean") - return "enableAutomaticUpdates: boolean expected"; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - if (!$util.isString(message.workerPool)) - return "workerPool: string expected"; - if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) { - if (!$util.isObject(message.environmentVariables)) - return "environmentVariables: object expected"; - var key = Object.keys(message.environmentVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.environmentVariables[key[i]])) - return "environmentVariables: string{k:string} expected"; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - return null; - }; - - /** - * Creates a BuildConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.BuildConfig} BuildConfig - */ - BuildConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.BuildConfig) - return object; - var message = new $root.google.cloud.run.v2.BuildConfig(); - if (object.name != null) - message.name = String(object.name); - if (object.sourceLocation != null) - message.sourceLocation = String(object.sourceLocation); - if (object.functionTarget != null) - message.functionTarget = String(object.functionTarget); - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.baseImage != null) - message.baseImage = String(object.baseImage); - if (object.enableAutomaticUpdates != null) - message.enableAutomaticUpdates = Boolean(object.enableAutomaticUpdates); - if (object.workerPool != null) - message.workerPool = String(object.workerPool); - if (object.environmentVariables) { - if (typeof object.environmentVariables !== "object") - throw TypeError(".google.cloud.run.v2.BuildConfig.environmentVariables: object expected"); - message.environmentVariables = {}; - for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i) - message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - return message; - }; - - /** - * Creates a plain object from a BuildConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {google.cloud.run.v2.BuildConfig} message BuildConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BuildConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.environmentVariables = {}; - if (options.defaults) { - object.name = ""; - object.sourceLocation = ""; - object.functionTarget = ""; - object.imageUri = ""; - object.baseImage = ""; - object.enableAutomaticUpdates = false; - object.workerPool = ""; - object.serviceAccount = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) - object.sourceLocation = message.sourceLocation; - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - object.functionTarget = message.functionTarget; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.baseImage != null && message.hasOwnProperty("baseImage")) - object.baseImage = message.baseImage; - if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) - object.enableAutomaticUpdates = message.enableAutomaticUpdates; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - object.workerPool = message.workerPool; - var keys2; - if (message.environmentVariables && (keys2 = Object.keys(message.environmentVariables)).length) { - object.environmentVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.environmentVariables[keys2[j]] = message.environmentVariables[keys2[j]]; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - return object; - }; - - /** - * Converts this BuildConfig to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.BuildConfig - * @instance - * @returns {Object.} JSON object - */ - BuildConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BuildConfig - * @function getTypeUrl - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BuildConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.BuildConfig"; - }; - - return BuildConfig; - })(); - - /** - * IngressTraffic enum. - * @name google.cloud.run.v2.IngressTraffic - * @enum {number} - * @property {number} INGRESS_TRAFFIC_UNSPECIFIED=0 INGRESS_TRAFFIC_UNSPECIFIED value - * @property {number} INGRESS_TRAFFIC_ALL=1 INGRESS_TRAFFIC_ALL value - * @property {number} INGRESS_TRAFFIC_INTERNAL_ONLY=2 INGRESS_TRAFFIC_INTERNAL_ONLY value - * @property {number} INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER=3 INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER value - * @property {number} INGRESS_TRAFFIC_NONE=4 INGRESS_TRAFFIC_NONE value - */ - v2.IngressTraffic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INGRESS_TRAFFIC_UNSPECIFIED"] = 0; - values[valuesById[1] = "INGRESS_TRAFFIC_ALL"] = 1; - values[valuesById[2] = "INGRESS_TRAFFIC_INTERNAL_ONLY"] = 2; - values[valuesById[3] = "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"] = 3; - values[valuesById[4] = "INGRESS_TRAFFIC_NONE"] = 4; - return values; - })(); - - /** - * ExecutionEnvironment enum. - * @name google.cloud.run.v2.ExecutionEnvironment - * @enum {number} - * @property {number} EXECUTION_ENVIRONMENT_UNSPECIFIED=0 EXECUTION_ENVIRONMENT_UNSPECIFIED value - * @property {number} EXECUTION_ENVIRONMENT_GEN1=1 EXECUTION_ENVIRONMENT_GEN1 value - * @property {number} EXECUTION_ENVIRONMENT_GEN2=2 EXECUTION_ENVIRONMENT_GEN2 value - */ - v2.ExecutionEnvironment = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXECUTION_ENVIRONMENT_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXECUTION_ENVIRONMENT_GEN1"] = 1; - values[valuesById[2] = "EXECUTION_ENVIRONMENT_GEN2"] = 2; - return values; - })(); - - /** - * EncryptionKeyRevocationAction enum. - * @name google.cloud.run.v2.EncryptionKeyRevocationAction - * @enum {number} - * @property {number} ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED=0 ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED value - * @property {number} PREVENT_NEW=1 PREVENT_NEW value - * @property {number} SHUTDOWN=2 SHUTDOWN value - */ - v2.EncryptionKeyRevocationAction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "PREVENT_NEW"] = 1; - values[valuesById[2] = "SHUTDOWN"] = 2; - return values; - })(); - - v2.ExecutionTemplate = (function() { - - /** - * Properties of an ExecutionTemplate. - * @memberof google.cloud.run.v2 - * @interface IExecutionTemplate - * @property {Object.|null} [labels] ExecutionTemplate labels - * @property {Object.|null} [annotations] ExecutionTemplate annotations - * @property {number|null} [parallelism] ExecutionTemplate parallelism - * @property {number|null} [taskCount] ExecutionTemplate taskCount - * @property {google.cloud.run.v2.ITaskTemplate|null} [template] ExecutionTemplate template - */ - - /** - * Constructs a new ExecutionTemplate. - * @memberof google.cloud.run.v2 - * @classdesc Represents an ExecutionTemplate. - * @implements IExecutionTemplate - * @constructor - * @param {google.cloud.run.v2.IExecutionTemplate=} [properties] Properties to set - */ - function ExecutionTemplate(properties) { - this.labels = {}; - this.annotations = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecutionTemplate labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - */ - ExecutionTemplate.prototype.labels = $util.emptyObject; - - /** - * ExecutionTemplate annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - */ - ExecutionTemplate.prototype.annotations = $util.emptyObject; - - /** - * ExecutionTemplate parallelism. - * @member {number} parallelism - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - */ - ExecutionTemplate.prototype.parallelism = 0; - - /** - * ExecutionTemplate taskCount. - * @member {number} taskCount - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - */ - ExecutionTemplate.prototype.taskCount = 0; - - /** - * ExecutionTemplate template. - * @member {google.cloud.run.v2.ITaskTemplate|null|undefined} template - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - */ - ExecutionTemplate.prototype.template = null; - - /** - * Creates a new ExecutionTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {google.cloud.run.v2.IExecutionTemplate=} [properties] Properties to set - * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate instance - */ - ExecutionTemplate.create = function create(properties) { - return new ExecutionTemplate(properties); - }; - - /** - * Encodes the specified ExecutionTemplate message. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {google.cloud.run.v2.IExecutionTemplate} message ExecutionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.parallelism); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.taskCount); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.run.v2.TaskTemplate.encode(message.template, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecutionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {google.cloud.run.v2.IExecutionTemplate} message ExecutionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecutionTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ExecutionTemplate(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - 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 2: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 3: { - message.parallelism = reader.int32(); - break; - } - case 4: { - message.taskCount = reader.int32(); - break; - } - case 5: { - message.template = $root.google.cloud.run.v2.TaskTemplate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecutionTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecutionTemplate message. - * @function verify - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecutionTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (!$util.isInteger(message.parallelism)) - return "parallelism: integer expected"; - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount)) - return "taskCount: integer expected"; - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.run.v2.TaskTemplate.verify(message.template); - if (error) - return "template." + error; - } - return null; - }; - - /** - * Creates an ExecutionTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate - */ - ExecutionTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ExecutionTemplate) - return object; - var message = new $root.google.cloud.run.v2.ExecutionTemplate(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionTemplate.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionTemplate.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.parallelism != null) - message.parallelism = object.parallelism | 0; - if (object.taskCount != null) - message.taskCount = object.taskCount | 0; - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionTemplate.template: object expected"); - message.template = $root.google.cloud.run.v2.TaskTemplate.fromObject(object.template); - } - return message; - }; - - /** - * Creates a plain object from an ExecutionTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {google.cloud.run.v2.ExecutionTemplate} message ExecutionTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecutionTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.parallelism = 0; - object.taskCount = 0; - object.template = null; - } - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - object.parallelism = message.parallelism; - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - object.taskCount = message.taskCount; - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.run.v2.TaskTemplate.toObject(message.template, options); - return object; - }; - - /** - * Converts this ExecutionTemplate to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - * @returns {Object.} JSON object - */ - ExecutionTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecutionTemplate - * @function getTypeUrl - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecutionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ExecutionTemplate"; - }; - - return ExecutionTemplate; - })(); - - v2.Instances = (function() { - - /** - * Constructs a new Instances service. - * @memberof google.cloud.run.v2 - * @classdesc Represents an Instances - * @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 Instances(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Instances.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Instances; - - /** - * Creates new Instances service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Instances - * @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 {Instances} RPC service. Useful where requests and/or responses are streamed. - */ - Instances.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|createInstance}. - * @memberof google.cloud.run.v2.Instances - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.cloud.run.v2.Instances.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.cloud.run.v2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|deleteInstance}. - * @memberof google.cloud.run.v2.Instances - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.cloud.run.v2.Instances.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.cloud.run.v2.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteInstance" }); - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|getInstance}. - * @memberof google.cloud.run.v2.Instances - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Instance} [response] Instance - */ - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.cloud.run.v2.Instances.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.cloud.run.v2.GetInstanceRequest, $root.google.cloud.run.v2.Instance, request, callback); - }, "name", { value: "GetInstance" }); - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|listInstances}. - * @memberof google.cloud.run.v2.Instances - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListInstancesResponse} [response] ListInstancesResponse - */ - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.cloud.run.v2.Instances.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.cloud.run.v2.ListInstancesRequest, $root.google.cloud.run.v2.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|stopInstance}. - * @memberof google.cloud.run.v2.Instances - * @typedef StopInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls StopInstance. - * @function stopInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IStopInstanceRequest} request StopInstanceRequest message or plain object - * @param {google.cloud.run.v2.Instances.StopInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.stopInstance = function stopInstance(request, callback) { - return this.rpcCall(stopInstance, $root.google.cloud.run.v2.StopInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "StopInstance" }); - - /** - * Calls StopInstance. - * @function stopInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IStopInstanceRequest} request StopInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|startInstance}. - * @memberof google.cloud.run.v2.Instances - * @typedef StartInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls StartInstance. - * @function startInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IStartInstanceRequest} request StartInstanceRequest message or plain object - * @param {google.cloud.run.v2.Instances.StartInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.startInstance = function startInstance(request, callback) { - return this.rpcCall(startInstance, $root.google.cloud.run.v2.StartInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "StartInstance" }); - - /** - * Calls StartInstance. - * @function startInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IStartInstanceRequest} request StartInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Instances; - })(); - - v2.CreateInstanceRequest = (function() { - - /** - * Properties of a CreateInstanceRequest. - * @memberof google.cloud.run.v2 - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {google.cloud.run.v2.IInstance|null} [instance] CreateInstanceRequest instance - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly - */ - - /** - * Constructs a new CreateInstanceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest - * @constructor - * @param {google.cloud.run.v2.ICreateInstanceRequest=} [properties] Properties to set - */ - function CreateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.parent = ""; - - /** - * CreateInstanceRequest instance. - * @member {google.cloud.run.v2.IInstance|null|undefined} instance - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instance = null; - - /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instanceId = ""; - - /** - * CreateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {google.cloud.run.v2.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest instance - */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {google.cloud.run.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.run.v2.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {google.cloud.run.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instance = $root.google.cloud.run.v2.Instance.decode(reader, reader.uint32()); - break; - } - case 3: { - message.instanceId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceRequest message. - * @function verify - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.run.v2.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest - */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CreateInstanceRequest) - return object; - var message = new $root.google.cloud.run.v2.CreateInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.run.v2.CreateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.run.v2.Instance.fromObject(object.instance); - } - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {google.cloud.run.v2.CreateInstanceRequest} message CreateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instance = null; - object.instanceId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.run.v2.Instance.toObject(message.instance, options); - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.CreateInstanceRequest"; - }; - - return CreateInstanceRequest; - })(); - - v2.GetInstanceRequest = (function() { - - /** - * Properties of a GetInstanceRequest. - * @memberof google.cloud.run.v2 - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - */ - - /** - * Constructs a new GetInstanceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest - * @constructor - * @param {google.cloud.run.v2.IGetInstanceRequest=} [properties] Properties to set - */ - function GetInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.name = ""; - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {google.cloud.run.v2.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest instance - */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); - }; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {google.cloud.run.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {google.cloud.run.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetInstanceRequest message. - * @function verify - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest - */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetInstanceRequest) - return object; - var message = new $root.google.cloud.run.v2.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {google.cloud.run.v2.GetInstanceRequest} message GetInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GetInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GetInstanceRequest"; - }; - - return GetInstanceRequest; - })(); - - v2.DeleteInstanceRequest = (function() { - - /** - * Properties of a DeleteInstanceRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name - * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly - * @property {string|null} [etag] DeleteInstanceRequest etag - */ - - /** - * Constructs a new DeleteInstanceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest - * @constructor - * @param {google.cloud.run.v2.IDeleteInstanceRequest=} [properties] Properties to set - */ - function DeleteInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstanceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.name = ""; - - /** - * DeleteInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.validateOnly = false; - - /** - * DeleteInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.etag = ""; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {google.cloud.run.v2.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest instance - */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); - }; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {google.cloud.run.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {google.cloud.run.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstanceRequest message. - * @function verify - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest - */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteInstanceRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {google.cloud.run.v2.DeleteInstanceRequest} message DeleteInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.DeleteInstanceRequest"; - }; - - return DeleteInstanceRequest; - })(); - - v2.ListInstancesRequest = (function() { - - /** - * Properties of a ListInstancesRequest. - * @memberof google.cloud.run.v2 - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {boolean|null} [showDeleted] ListInstancesRequest showDeleted - */ - - /** - * Constructs a new ListInstancesRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest - * @constructor - * @param {google.cloud.run.v2.IListInstancesRequest=} [properties] Properties to set - */ - function ListInstancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.parent = ""; - - /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageSize = 0; - - /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageToken = ""; - - /** - * ListInstancesRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.showDeleted = false; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {google.cloud.run.v2.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest instance - */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); - }; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {google.cloud.run.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {google.cloud.run.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesRequest message. - * @function verify - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest - */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListInstancesRequest) - return object; - var message = new $root.google.cloud.run.v2.ListInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {google.cloud.run.v2.ListInstancesRequest} message ListInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListInstancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListInstancesRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListInstancesRequest"; - }; - - return ListInstancesRequest; - })(); - - v2.ListInstancesResponse = (function() { - - /** - * Properties of a ListInstancesResponse. - * @memberof google.cloud.run.v2 - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - */ - - /** - * Constructs a new ListInstancesResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse - * @constructor - * @param {google.cloud.run.v2.IListInstancesResponse=} [properties] Properties to set - */ - function ListInstancesResponse(properties) { - 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]]; - } - - /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.run.v2.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {google.cloud.run.v2.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse instance - */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); - }; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {google.cloud.run.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.run.v2.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {google.cloud.run.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.run.v2.Instance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesResponse message. - * @function verify - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.run.v2.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse - */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListInstancesResponse) - return object; - var message = new $root.google.cloud.run.v2.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.run.v2.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.run.v2.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.run.v2.Instance.fromObject(object.instances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {google.cloud.run.v2.ListInstancesResponse} message ListInstancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.run.v2.Instance.toObject(message.instances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListInstancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListInstancesResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListInstancesResponse"; - }; - - return ListInstancesResponse; - })(); - - v2.StopInstanceRequest = (function() { - - /** - * Properties of a StopInstanceRequest. - * @memberof google.cloud.run.v2 - * @interface IStopInstanceRequest - * @property {string|null} [name] StopInstanceRequest name - * @property {boolean|null} [validateOnly] StopInstanceRequest validateOnly - * @property {string|null} [etag] StopInstanceRequest etag - */ - - /** - * Constructs a new StopInstanceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a StopInstanceRequest. - * @implements IStopInstanceRequest - * @constructor - * @param {google.cloud.run.v2.IStopInstanceRequest=} [properties] Properties to set - */ - function StopInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StopInstanceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.StopInstanceRequest - * @instance - */ - StopInstanceRequest.prototype.name = ""; - - /** - * StopInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.StopInstanceRequest - * @instance - */ - StopInstanceRequest.prototype.validateOnly = false; - - /** - * StopInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.StopInstanceRequest - * @instance - */ - StopInstanceRequest.prototype.etag = ""; - - /** - * Creates a new StopInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {google.cloud.run.v2.IStopInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest instance - */ - StopInstanceRequest.create = function create(properties) { - return new StopInstanceRequest(properties); - }; - - /** - * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {google.cloud.run.v2.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StopInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {google.cloud.run.v2.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StopInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StopInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StopInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StopInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StopInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StopInstanceRequest message. - * @function verify - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StopInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest - */ - StopInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.StopInstanceRequest) - return object; - var message = new $root.google.cloud.run.v2.StopInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {google.cloud.run.v2.StopInstanceRequest} message StopInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StopInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this StopInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.StopInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - StopInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StopInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StopInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.StopInstanceRequest"; - }; - - return StopInstanceRequest; - })(); - - v2.StartInstanceRequest = (function() { - - /** - * Properties of a StartInstanceRequest. - * @memberof google.cloud.run.v2 - * @interface IStartInstanceRequest - * @property {string|null} [name] StartInstanceRequest name - * @property {boolean|null} [validateOnly] StartInstanceRequest validateOnly - * @property {string|null} [etag] StartInstanceRequest etag - */ - - /** - * Constructs a new StartInstanceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a StartInstanceRequest. - * @implements IStartInstanceRequest - * @constructor - * @param {google.cloud.run.v2.IStartInstanceRequest=} [properties] Properties to set - */ - function StartInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartInstanceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.StartInstanceRequest - * @instance - */ - StartInstanceRequest.prototype.name = ""; - - /** - * StartInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.StartInstanceRequest - * @instance - */ - StartInstanceRequest.prototype.validateOnly = false; - - /** - * StartInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.StartInstanceRequest - * @instance - */ - StartInstanceRequest.prototype.etag = ""; - - /** - * Creates a new StartInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {google.cloud.run.v2.IStartInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest instance - */ - StartInstanceRequest.create = function create(properties) { - return new StartInstanceRequest(properties); - }; - - /** - * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {google.cloud.run.v2.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {google.cloud.run.v2.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StartInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartInstanceRequest message. - * @function verify - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest - */ - StartInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.StartInstanceRequest) - return object; - var message = new $root.google.cloud.run.v2.StartInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {google.cloud.run.v2.StartInstanceRequest} message StartInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this StartInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.StartInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - StartInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StartInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.StartInstanceRequest"; - }; - - return StartInstanceRequest; - })(); - - v2.Instance = (function() { - - /** - * Properties of an Instance. - * @memberof google.cloud.run.v2 - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [description] Instance description - * @property {string|null} [uid] Instance uid - * @property {number|Long|null} [generation] Instance generation - * @property {Object.|null} [labels] Instance labels - * @property {Object.|null} [annotations] Instance annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Instance expireTime - * @property {string|null} [creator] Instance creator - * @property {string|null} [lastModifier] Instance lastModifier - * @property {string|null} [client] Instance client - * @property {string|null} [clientVersion] Instance clientVersion - * @property {google.api.LaunchStage|null} [launchStage] Instance launchStage - * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Instance binaryAuthorization - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Instance vpcAccess - * @property {string|null} [serviceAccount] Instance serviceAccount - * @property {Array.|null} [containers] Instance containers - * @property {Array.|null} [volumes] Instance volumes - * @property {string|null} [encryptionKey] Instance encryptionKey - * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] Instance encryptionKeyRevocationAction - * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] Instance encryptionKeyShutdownDuration - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Instance nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] Instance gpuZonalRedundancyDisabled - * @property {google.cloud.run.v2.IngressTraffic|null} [ingress] Instance ingress - * @property {boolean|null} [invokerIamDisabled] Instance invokerIamDisabled - * @property {boolean|null} [iapEnabled] Instance iapEnabled - * @property {number|Long|null} [observedGeneration] Instance observedGeneration - * @property {string|null} [logUri] Instance logUri - * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Instance terminalCondition - * @property {Array.|null} [conditions] Instance conditions - * @property {Array.|null} [containerStatuses] Instance containerStatuses - * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs - * @property {Array.|null} [urls] Instance urls - * @property {boolean|null} [reconciling] Instance reconciling - * @property {string|null} [etag] Instance etag - */ - - /** - * Constructs a new Instance. - * @memberof google.cloud.run.v2 - * @classdesc Represents an Instance. - * @implements IInstance - * @constructor - * @param {google.cloud.run.v2.IInstance=} [properties] Properties to set - */ - function Instance(properties) { - this.labels = {}; - this.annotations = {}; - this.containers = []; - this.volumes = []; - this.conditions = []; - this.containerStatuses = []; - this.urls = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Instance name. - * @member {string} name - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.name = ""; - - /** - * Instance description. - * @member {string} description - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.description = ""; - - /** - * Instance uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.uid = ""; - - /** - * Instance generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Instance labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.labels = $util.emptyObject; - - /** - * Instance annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.annotations = $util.emptyObject; - - /** - * Instance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.createTime = null; - - /** - * Instance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.updateTime = null; - - /** - * Instance deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.deleteTime = null; - - /** - * Instance expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.expireTime = null; - - /** - * Instance creator. - * @member {string} creator - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.creator = ""; - - /** - * Instance lastModifier. - * @member {string} lastModifier - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.lastModifier = ""; - - /** - * Instance client. - * @member {string} client - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.client = ""; - - /** - * Instance clientVersion. - * @member {string} clientVersion - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.clientVersion = ""; - - /** - * Instance launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.launchStage = 0; - - /** - * Instance binaryAuthorization. - * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.binaryAuthorization = null; - - /** - * Instance vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.vpcAccess = null; - - /** - * Instance serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.serviceAccount = ""; - - /** - * Instance containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.containers = $util.emptyArray; - - /** - * Instance volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.volumes = $util.emptyArray; - - /** - * Instance encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.encryptionKey = ""; - - /** - * Instance encryptionKeyRevocationAction. - * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.encryptionKeyRevocationAction = 0; - - /** - * Instance encryptionKeyShutdownDuration. - * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.encryptionKeyShutdownDuration = null; - - /** - * Instance nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.nodeSelector = null; - - /** - * Instance gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.gpuZonalRedundancyDisabled = null; - - /** - * Instance ingress. - * @member {google.cloud.run.v2.IngressTraffic} ingress - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.ingress = 0; - - /** - * Instance invokerIamDisabled. - * @member {boolean} invokerIamDisabled - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.invokerIamDisabled = false; - - /** - * Instance iapEnabled. - * @member {boolean} iapEnabled - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.iapEnabled = false; - - /** - * Instance observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Instance logUri. - * @member {string} logUri - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.logUri = ""; - - /** - * Instance terminalCondition. - * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.terminalCondition = null; - - /** - * Instance conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.conditions = $util.emptyArray; - - /** - * Instance containerStatuses. - * @member {Array.} containerStatuses - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.containerStatuses = $util.emptyArray; - - /** - * Instance satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.satisfiesPzs = false; - - /** - * Instance urls. - * @member {Array.} urls - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.urls = $util.emptyArray; - - /** - * Instance reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.reconciling = false; - - /** - * Instance etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Instance.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Instance instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Instance - * @static - * @param {google.cloud.run.v2.IInstance=} [properties] Properties to set - * @returns {google.cloud.run.v2.Instance} Instance instance - */ - Instance.create = function create(properties) { - return new Instance(properties); - }; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Instance - * @static - * @param {google.cloud.run.v2.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.uid); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.generation); - 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.creator); - if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.lastModifier); - if (message.client != null && Object.hasOwnProperty.call(message, "client")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.client); - if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.clientVersion); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); - if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) - $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 19, wireType 2 =*/154).string(message.serviceAccount); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 22, wireType 2 =*/178).string(message.encryptionKey); - if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.encryptionKeyRevocationAction); - if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) - $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.gpuZonalRedundancyDisabled); - if (message.ingress != null && Object.hasOwnProperty.call(message, "ingress")) - writer.uint32(/* id 28, wireType 0 =*/224).int32(message.ingress); - if (message.invokerIamDisabled != null && Object.hasOwnProperty.call(message, "invokerIamDisabled")) - writer.uint32(/* id 29, wireType 0 =*/232).bool(message.invokerIamDisabled); - if (message.iapEnabled != null && Object.hasOwnProperty.call(message, "iapEnabled")) - writer.uint32(/* id 30, wireType 0 =*/240).bool(message.iapEnabled); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 40, wireType 0 =*/320).int64(message.observedGeneration); - if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.logUri); - if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) - $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); - if (message.containerStatuses != null && message.containerStatuses.length) - for (var i = 0; i < message.containerStatuses.length; ++i) - $root.google.cloud.run.v2.ContainerStatus.encode(message.containerStatuses[i], writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); - if (message.urls != null && message.urls.length) - for (var i = 0; i < message.urls.length; ++i) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.urls[i]); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 46, wireType 0 =*/368).bool(message.satisfiesPzs); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Instance - * @static - * @param {google.cloud.run.v2.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Instance(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.uid = reader.string(); - break; - } - case 5: { - message.generation = reader.int64(); - 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: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 8: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.creator = reader.string(); - break; - } - case 13: { - message.lastModifier = reader.string(); - break; - } - case 14: { - message.client = reader.string(); - break; - } - case 15: { - message.clientVersion = reader.string(); - break; - } - case 16: { - message.launchStage = reader.int32(); - break; - } - case 17: { - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); - break; - } - case 18: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 19: { - message.serviceAccount = reader.string(); - break; - } - case 20: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 21: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 22: { - message.encryptionKey = reader.string(); - break; - } - case 24: { - message.encryptionKeyRevocationAction = reader.int32(); - break; - } - case 25: { - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 26: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 27: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - case 28: { - message.ingress = reader.int32(); - break; - } - case 29: { - message.invokerIamDisabled = reader.bool(); - break; - } - case 30: { - message.iapEnabled = reader.bool(); - break; - } - case 40: { - message.observedGeneration = reader.int64(); - break; - } - case 41: { - message.logUri = reader.string(); - break; - } - case 42: { - message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); - break; - } - case 43: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 44: { - if (!(message.containerStatuses && message.containerStatuses.length)) - message.containerStatuses = []; - message.containerStatuses.push($root.google.cloud.run.v2.ContainerStatus.decode(reader, reader.uint32())); - break; - } - case 46: { - message.satisfiesPzs = reader.bool(); - break; - } - case 45: { - if (!(message.urls && message.urls.length)) - message.urls = []; - message.urls.push(reader.string()); - break; - } - case 98: { - message.reconciling = reader.bool(); - break; - } - case 99: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Instance message. - * @function verify - * @memberof google.cloud.run.v2.Instance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Instance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - if (!$util.isString(message.lastModifier)) - return "lastModifier: string expected"; - if (message.client != null && message.hasOwnProperty("client")) - if (!$util.isString(message.client)) - return "client: string expected"; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - if (!$util.isString(message.clientVersion)) - return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { - var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); - if (error) - return "binaryAuthorization." + error; - } - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - switch (message.encryptionKeyRevocationAction) { - default: - return "encryptionKeyRevocationAction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { - var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); - if (error) - return "encryptionKeyShutdownDuration." + error; - } - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - if (message.ingress != null && message.hasOwnProperty("ingress")) - switch (message.ingress) { - default: - return "ingress: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) - if (typeof message.invokerIamDisabled !== "boolean") - return "invokerIamDisabled: boolean expected"; - if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) - if (typeof message.iapEnabled !== "boolean") - return "iapEnabled: boolean expected"; - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.logUri != null && message.hasOwnProperty("logUri")) - if (!$util.isString(message.logUri)) - return "logUri: string expected"; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { - var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); - if (error) - return "terminalCondition." + error; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.containerStatuses != null && message.hasOwnProperty("containerStatuses")) { - if (!Array.isArray(message.containerStatuses)) - return "containerStatuses: array expected"; - for (var i = 0; i < message.containerStatuses.length; ++i) { - var error = $root.google.cloud.run.v2.ContainerStatus.verify(message.containerStatuses[i]); - if (error) - return "containerStatuses." + error; - } - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.urls != null && message.hasOwnProperty("urls")) { - if (!Array.isArray(message.urls)) - return "urls: array expected"; - for (var i = 0; i < message.urls.length; ++i) - if (!$util.isString(message.urls[i])) - return "urls: string[] expected"; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Instance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Instance} Instance - */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Instance) - return object; - var message = new $root.google.cloud.run.v2.Instance(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.Instance.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Instance.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.Instance.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.run.v2.Instance.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Instance.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Instance.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.lastModifier != null) - message.lastModifier = String(object.lastModifier); - if (object.client != null) - message.client = String(object.client); - if (object.clientVersion != null) - message.clientVersion = String(object.clientVersion); - 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.binaryAuthorization != null) { - if (typeof object.binaryAuthorization !== "object") - throw TypeError(".google.cloud.run.v2.Instance.binaryAuthorization: object expected"); - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); - } - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.Instance.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.Instance.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.Instance.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.Instance.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.Instance.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - switch (object.encryptionKeyRevocationAction) { - default: - if (typeof object.encryptionKeyRevocationAction === "number") { - message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; - break; - } - break; - case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": - case 0: - message.encryptionKeyRevocationAction = 0; - break; - case "PREVENT_NEW": - case 1: - message.encryptionKeyRevocationAction = 1; - break; - case "SHUTDOWN": - case 2: - message.encryptionKeyRevocationAction = 2; - break; - } - if (object.encryptionKeyShutdownDuration != null) { - if (typeof object.encryptionKeyShutdownDuration !== "object") - throw TypeError(".google.cloud.run.v2.Instance.encryptionKeyShutdownDuration: object expected"); - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); - } - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.Instance.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - switch (object.ingress) { - default: - if (typeof object.ingress === "number") { - message.ingress = object.ingress; - break; - } - break; - case "INGRESS_TRAFFIC_UNSPECIFIED": - case 0: - message.ingress = 0; - break; - case "INGRESS_TRAFFIC_ALL": - case 1: - message.ingress = 1; - break; - case "INGRESS_TRAFFIC_INTERNAL_ONLY": - case 2: - message.ingress = 2; - break; - case "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": - case 3: - message.ingress = 3; - break; - case "INGRESS_TRAFFIC_NONE": - case 4: - message.ingress = 4; - break; - } - if (object.invokerIamDisabled != null) - message.invokerIamDisabled = Boolean(object.invokerIamDisabled); - if (object.iapEnabled != null) - message.iapEnabled = Boolean(object.iapEnabled); - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.logUri != null) - message.logUri = String(object.logUri); - if (object.terminalCondition != null) { - if (typeof object.terminalCondition !== "object") - throw TypeError(".google.cloud.run.v2.Instance.terminalCondition: object expected"); - message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Instance.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Instance.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.containerStatuses) { - if (!Array.isArray(object.containerStatuses)) - throw TypeError(".google.cloud.run.v2.Instance.containerStatuses: array expected"); - message.containerStatuses = []; - for (var i = 0; i < object.containerStatuses.length; ++i) { - if (typeof object.containerStatuses[i] !== "object") - throw TypeError(".google.cloud.run.v2.Instance.containerStatuses: object expected"); - message.containerStatuses[i] = $root.google.cloud.run.v2.ContainerStatus.fromObject(object.containerStatuses[i]); - } - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.urls) { - if (!Array.isArray(object.urls)) - throw TypeError(".google.cloud.run.v2.Instance.urls: array expected"); - message.urls = []; - for (var i = 0; i < object.urls.length; ++i) - message.urls[i] = String(object.urls[i]); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Instance - * @static - * @param {google.cloud.run.v2.Instance} message Instance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Instance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - object.conditions = []; - object.containerStatuses = []; - object.urls = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.description = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.creator = ""; - object.lastModifier = ""; - object.client = ""; - object.clientVersion = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.binaryAuthorization = null; - object.vpcAccess = null; - object.serviceAccount = ""; - object.encryptionKey = ""; - object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; - object.encryptionKeyShutdownDuration = null; - object.nodeSelector = null; - object.ingress = options.enums === String ? "INGRESS_TRAFFIC_UNSPECIFIED" : 0; - object.invokerIamDisabled = false; - object.iapEnabled = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.logUri = ""; - object.terminalCondition = null; - object.satisfiesPzs = false; - object.reconciling = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - object.lastModifier = message.lastModifier; - if (message.client != null && message.hasOwnProperty("client")) - object.client = message.client; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - object.clientVersion = message.clientVersion; - 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) - object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) - object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - if (message.ingress != null && message.hasOwnProperty("ingress")) - object.ingress = options.enums === String ? $root.google.cloud.run.v2.IngressTraffic[message.ingress] === undefined ? message.ingress : $root.google.cloud.run.v2.IngressTraffic[message.ingress] : message.ingress; - if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) - object.invokerIamDisabled = message.invokerIamDisabled; - if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) - object.iapEnabled = message.iapEnabled; - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.logUri != null && message.hasOwnProperty("logUri")) - object.logUri = message.logUri; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) - object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.containerStatuses && message.containerStatuses.length) { - object.containerStatuses = []; - for (var j = 0; j < message.containerStatuses.length; ++j) - object.containerStatuses[j] = $root.google.cloud.run.v2.ContainerStatus.toObject(message.containerStatuses[j], options); - } - if (message.urls && message.urls.length) { - object.urls = []; - for (var j = 0; j < message.urls.length; ++j) - object.urls[j] = message.urls[j]; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Instance to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Instance - * @instance - * @returns {Object.} JSON object - */ - Instance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Instance - * @function getTypeUrl - * @memberof google.cloud.run.v2.Instance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Instance"; - }; - - return Instance; - })(); - - v2.InstanceSplit = (function() { - - /** - * Properties of an InstanceSplit. - * @memberof google.cloud.run.v2 - * @interface IInstanceSplit - * @property {google.cloud.run.v2.InstanceSplitAllocationType|null} [type] InstanceSplit type - * @property {string|null} [revision] InstanceSplit revision - * @property {number|null} [percent] InstanceSplit percent - */ - - /** - * Constructs a new InstanceSplit. - * @memberof google.cloud.run.v2 - * @classdesc Represents an InstanceSplit. - * @implements IInstanceSplit - * @constructor - * @param {google.cloud.run.v2.IInstanceSplit=} [properties] Properties to set - */ - function InstanceSplit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceSplit type. - * @member {google.cloud.run.v2.InstanceSplitAllocationType} type - * @memberof google.cloud.run.v2.InstanceSplit - * @instance - */ - InstanceSplit.prototype.type = 0; - - /** - * InstanceSplit revision. - * @member {string} revision - * @memberof google.cloud.run.v2.InstanceSplit - * @instance - */ - InstanceSplit.prototype.revision = ""; - - /** - * InstanceSplit percent. - * @member {number} percent - * @memberof google.cloud.run.v2.InstanceSplit - * @instance - */ - InstanceSplit.prototype.percent = 0; - - /** - * Creates a new InstanceSplit instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {google.cloud.run.v2.IInstanceSplit=} [properties] Properties to set - * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit instance - */ - InstanceSplit.create = function create(properties) { - return new InstanceSplit(properties); - }; - - /** - * Encodes the specified InstanceSplit message. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {google.cloud.run.v2.IInstanceSplit} message InstanceSplit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSplit.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.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); - if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); - return writer; - }; - - /** - * Encodes the specified InstanceSplit message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {google.cloud.run.v2.IInstanceSplit} message InstanceSplit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSplit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceSplit message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSplit.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.InstanceSplit(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.revision = reader.string(); - break; - } - case 3: { - message.percent = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceSplit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSplit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceSplit message. - * @function verify - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceSplit.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.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.percent != null && message.hasOwnProperty("percent")) - if (!$util.isInteger(message.percent)) - return "percent: integer expected"; - return null; - }; - - /** - * Creates an InstanceSplit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit - */ - InstanceSplit.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.InstanceSplit) - return object; - var message = new $root.google.cloud.run.v2.InstanceSplit(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST": - case 1: - message.type = 1; - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION": - case 2: - message.type = 2; - break; - } - if (object.revision != null) - message.revision = String(object.revision); - if (object.percent != null) - message.percent = object.percent | 0; - return message; - }; - - /** - * Creates a plain object from an InstanceSplit message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {google.cloud.run.v2.InstanceSplit} message InstanceSplit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceSplit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED" : 0; - object.revision = ""; - object.percent = 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] : message.type; - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.percent != null && message.hasOwnProperty("percent")) - object.percent = message.percent; - return object; - }; - - /** - * Converts this InstanceSplit to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.InstanceSplit - * @instance - * @returns {Object.} JSON object - */ - InstanceSplit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceSplit - * @function getTypeUrl - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceSplit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.InstanceSplit"; - }; - - return InstanceSplit; - })(); - - v2.InstanceSplitStatus = (function() { - - /** - * Properties of an InstanceSplitStatus. - * @memberof google.cloud.run.v2 - * @interface IInstanceSplitStatus - * @property {google.cloud.run.v2.InstanceSplitAllocationType|null} [type] InstanceSplitStatus type - * @property {string|null} [revision] InstanceSplitStatus revision - * @property {number|null} [percent] InstanceSplitStatus percent - */ - - /** - * Constructs a new InstanceSplitStatus. - * @memberof google.cloud.run.v2 - * @classdesc Represents an InstanceSplitStatus. - * @implements IInstanceSplitStatus - * @constructor - * @param {google.cloud.run.v2.IInstanceSplitStatus=} [properties] Properties to set - */ - function InstanceSplitStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceSplitStatus type. - * @member {google.cloud.run.v2.InstanceSplitAllocationType} type - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @instance - */ - InstanceSplitStatus.prototype.type = 0; - - /** - * InstanceSplitStatus revision. - * @member {string} revision - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @instance - */ - InstanceSplitStatus.prototype.revision = ""; - - /** - * InstanceSplitStatus percent. - * @member {number} percent - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @instance - */ - InstanceSplitStatus.prototype.percent = 0; - - /** - * Creates a new InstanceSplitStatus instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {google.cloud.run.v2.IInstanceSplitStatus=} [properties] Properties to set - * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus instance - */ - InstanceSplitStatus.create = function create(properties) { - return new InstanceSplitStatus(properties); - }; - - /** - * Encodes the specified InstanceSplitStatus message. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {google.cloud.run.v2.IInstanceSplitStatus} message InstanceSplitStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSplitStatus.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.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); - if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); - return writer; - }; - - /** - * Encodes the specified InstanceSplitStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {google.cloud.run.v2.IInstanceSplitStatus} message InstanceSplitStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSplitStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceSplitStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSplitStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.InstanceSplitStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.revision = reader.string(); - break; - } - case 3: { - message.percent = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceSplitStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSplitStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceSplitStatus message. - * @function verify - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceSplitStatus.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.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.percent != null && message.hasOwnProperty("percent")) - if (!$util.isInteger(message.percent)) - return "percent: integer expected"; - return null; - }; - - /** - * Creates an InstanceSplitStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus - */ - InstanceSplitStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.InstanceSplitStatus) - return object; - var message = new $root.google.cloud.run.v2.InstanceSplitStatus(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST": - case 1: - message.type = 1; - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION": - case 2: - message.type = 2; - break; - } - if (object.revision != null) - message.revision = String(object.revision); - if (object.percent != null) - message.percent = object.percent | 0; - return message; - }; - - /** - * Creates a plain object from an InstanceSplitStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {google.cloud.run.v2.InstanceSplitStatus} message InstanceSplitStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceSplitStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED" : 0; - object.revision = ""; - object.percent = 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] : message.type; - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.percent != null && message.hasOwnProperty("percent")) - object.percent = message.percent; - return object; - }; - - /** - * Converts this InstanceSplitStatus to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @instance - * @returns {Object.} JSON object - */ - InstanceSplitStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceSplitStatus - * @function getTypeUrl - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceSplitStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.InstanceSplitStatus"; - }; - - return InstanceSplitStatus; - })(); - - /** - * InstanceSplitAllocationType enum. - * @name google.cloud.run.v2.InstanceSplitAllocationType - * @enum {number} - * @property {number} INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED=0 INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED value - * @property {number} INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST=1 INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST value - * @property {number} INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION=2 INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION value - */ - v2.InstanceSplitAllocationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST"] = 1; - values[valuesById[2] = "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION"] = 2; - return values; - })(); - - v2.Jobs = (function() { - - /** - * Constructs a new Jobs service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Jobs - * @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 Jobs(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Jobs.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Jobs; - - /** - * Creates new Jobs service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Jobs - * @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 {Jobs} RPC service. Useful where requests and/or responses are streamed. - */ - Jobs.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|createJob}. - * @memberof google.cloud.run.v2.Jobs - * @typedef CreateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.ICreateJobRequest} request CreateJobRequest message or plain object - * @param {google.cloud.run.v2.Jobs.CreateJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.createJob = function createJob(request, callback) { - return this.rpcCall(createJob, $root.google.cloud.run.v2.CreateJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateJob" }); - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.ICreateJobRequest} request CreateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|getJob}. - * @memberof google.cloud.run.v2.Jobs - * @typedef GetJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Job} [response] Job - */ - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IGetJobRequest} request GetJobRequest message or plain object - * @param {google.cloud.run.v2.Jobs.GetJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.getJob = function getJob(request, callback) { - return this.rpcCall(getJob, $root.google.cloud.run.v2.GetJobRequest, $root.google.cloud.run.v2.Job, request, callback); - }, "name", { value: "GetJob" }); - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IGetJobRequest} request GetJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|listJobs}. - * @memberof google.cloud.run.v2.Jobs - * @typedef ListJobsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListJobsResponse} [response] ListJobsResponse - */ - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IListJobsRequest} request ListJobsRequest message or plain object - * @param {google.cloud.run.v2.Jobs.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.listJobs = function listJobs(request, callback) { - return this.rpcCall(listJobs, $root.google.cloud.run.v2.ListJobsRequest, $root.google.cloud.run.v2.ListJobsResponse, request, callback); - }, "name", { value: "ListJobs" }); - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IListJobsRequest} request ListJobsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|updateJob}. - * @memberof google.cloud.run.v2.Jobs - * @typedef UpdateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateJob. - * @function updateJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IUpdateJobRequest} request UpdateJobRequest message or plain object - * @param {google.cloud.run.v2.Jobs.UpdateJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.updateJob = function updateJob(request, callback) { - return this.rpcCall(updateJob, $root.google.cloud.run.v2.UpdateJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateJob" }); - - /** - * Calls UpdateJob. - * @function updateJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IUpdateJobRequest} request UpdateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|deleteJob}. - * @memberof google.cloud.run.v2.Jobs - * @typedef DeleteJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @param {google.cloud.run.v2.Jobs.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.deleteJob = function deleteJob(request, callback) { - return this.rpcCall(deleteJob, $root.google.cloud.run.v2.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteJob" }); - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|runJob}. - * @memberof google.cloud.run.v2.Jobs - * @typedef RunJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RunJob. - * @function runJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IRunJobRequest} request RunJobRequest message or plain object - * @param {google.cloud.run.v2.Jobs.RunJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.runJob = function runJob(request, callback) { - return this.rpcCall(runJob, $root.google.cloud.run.v2.RunJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunJob" }); - - /** - * Calls RunJob. - * @function runJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IRunJobRequest} request RunJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|getIamPolicy}. - * @memberof google.cloud.run.v2.Jobs - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.Jobs.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|setIamPolicy}. - * @memberof google.cloud.run.v2.Jobs - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.Jobs.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|testIamPermissions}. - * @memberof google.cloud.run.v2.Jobs - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.run.v2.Jobs.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Jobs; - })(); - - v2.CreateJobRequest = (function() { - - /** - * Properties of a CreateJobRequest. - * @memberof google.cloud.run.v2 - * @interface ICreateJobRequest - * @property {string|null} [parent] CreateJobRequest parent - * @property {google.cloud.run.v2.IJob|null} [job] CreateJobRequest job - * @property {string|null} [jobId] CreateJobRequest jobId - * @property {boolean|null} [validateOnly] CreateJobRequest validateOnly - */ - - /** - * Constructs a new CreateJobRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CreateJobRequest. - * @implements ICreateJobRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.parent = ""; - - /** - * CreateJobRequest job. - * @member {google.cloud.run.v2.IJob|null|undefined} job - * @memberof google.cloud.run.v2.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.job = null; - - /** - * CreateJobRequest jobId. - * @member {string} jobId - * @memberof google.cloud.run.v2.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.jobId = ""; - - /** - * CreateJobRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CreateJobRequest - * @static - * @param {google.cloud.run.v2.ICreateJobRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.CreateJobRequest} CreateJobRequest instance - */ - CreateJobRequest.create = function create(properties) { - return new CreateJobRequest(properties); - }; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.run.v2.CreateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CreateJobRequest - * @static - * @param {google.cloud.run.v2.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.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.run.v2.Job.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CreateJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.job = $root.google.cloud.run.v2.Job.decode(reader, reader.uint32()); - break; - } - case 3: { - message.jobId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - 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.run.v2.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.run.v2.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CreateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CreateJobRequest} CreateJobRequest - */ - CreateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CreateJobRequest) - return object; - var message = new $root.google.cloud.run.v2.CreateJobRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.run.v2.CreateJobRequest.job: object expected"); - message.job = $root.google.cloud.run.v2.Job.fromObject(object.job); - } - if (object.jobId != null) - message.jobId = String(object.jobId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CreateJobRequest - * @static - * @param {google.cloud.run.v2.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.job = null; - object.jobId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.run.v2.Job.toObject(message.job, options); - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.CreateJobRequest"; - }; - - return CreateJobRequest; - })(); - - v2.GetJobRequest = (function() { - - /** - * Properties of a GetJobRequest. - * @memberof google.cloud.run.v2 - * @interface IGetJobRequest - * @property {string|null} [name] GetJobRequest name - */ - - /** - * Constructs a new GetJobRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetJobRequest. - * @implements IGetJobRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.GetJobRequest - * @instance - */ - GetJobRequest.prototype.name = ""; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetJobRequest - * @static - * @param {google.cloud.run.v2.IGetJobRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetJobRequest} GetJobRequest instance - */ - GetJobRequest.create = function create(properties) { - return new GetJobRequest(properties); - }; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.run.v2.GetJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.GetJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.GetJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetJobRequest} GetJobRequest - */ - GetJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetJobRequest) - return object; - var message = new $root.google.cloud.run.v2.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.run.v2.GetJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.GetJobRequest"; - }; - - return GetJobRequest; - })(); - - v2.UpdateJobRequest = (function() { - - /** - * Properties of an UpdateJobRequest. - * @memberof google.cloud.run.v2 - * @interface IUpdateJobRequest - * @property {google.cloud.run.v2.IJob|null} [job] UpdateJobRequest job - * @property {boolean|null} [validateOnly] UpdateJobRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateJobRequest allowMissing - */ - - /** - * Constructs a new UpdateJobRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents an UpdateJobRequest. - * @implements IUpdateJobRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.IJob|null|undefined} job - * @memberof google.cloud.run.v2.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.job = null; - - /** - * UpdateJobRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.validateOnly = false; - - /** - * UpdateJobRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.run.v2.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.UpdateJobRequest - * @static - * @param {google.cloud.run.v2.IUpdateJobRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.UpdateJobRequest} UpdateJobRequest instance - */ - UpdateJobRequest.create = function create(properties) { - return new UpdateJobRequest(properties); - }; - - /** - * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.UpdateJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.UpdateJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.UpdateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.UpdateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.job = $root.google.cloud.run.v2.Job.decode(reader, reader.uint32()); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.allowMissing = reader.bool(); - 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.run.v2.UpdateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.UpdateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.UpdateJobRequest} UpdateJobRequest - */ - UpdateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.UpdateJobRequest) - return object; - var message = new $root.google.cloud.run.v2.UpdateJobRequest(); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.run.v2.UpdateJobRequest.job: object expected"); - message.job = $root.google.cloud.run.v2.Job.fromObject(object.job); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.UpdateJobRequest - * @static - * @param {google.cloud.run.v2.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.validateOnly = false; - object.allowMissing = false; - } - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.run.v2.Job.toObject(message.job, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.UpdateJobRequest"; - }; - - return UpdateJobRequest; - })(); - - v2.ListJobsRequest = (function() { - - /** - * Properties of a ListJobsRequest. - * @memberof google.cloud.run.v2 - * @interface IListJobsRequest - * @property {string|null} [parent] ListJobsRequest parent - * @property {number|null} [pageSize] ListJobsRequest pageSize - * @property {string|null} [pageToken] ListJobsRequest pageToken - * @property {boolean|null} [showDeleted] ListJobsRequest showDeleted - */ - - /** - * Constructs a new ListJobsRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListJobsRequest. - * @implements IListJobsRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.parent = ""; - - /** - * ListJobsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageSize = 0; - - /** - * ListJobsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageToken = ""; - - /** - * ListJobsRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.showDeleted = false; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListJobsRequest - * @static - * @param {google.cloud.run.v2.IListJobsRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListJobsRequest} ListJobsRequest instance - */ - ListJobsRequest.create = function create(properties) { - return new ListJobsRequest(properties); - }; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.run.v2.ListJobsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListJobsRequest - * @static - * @param {google.cloud.run.v2.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListJobsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListJobsRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListJobsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - 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.run.v2.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListJobsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListJobsRequest} ListJobsRequest - */ - ListJobsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListJobsRequest) - return object; - var message = new $root.google.cloud.run.v2.ListJobsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListJobsRequest - * @static - * @param {google.cloud.run.v2.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.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListJobsRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListJobsRequest"; - }; - - return ListJobsRequest; - })(); - - v2.ListJobsResponse = (function() { - - /** - * Properties of a ListJobsResponse. - * @memberof google.cloud.run.v2 - * @interface IListJobsResponse - * @property {Array.|null} [jobs] ListJobsResponse jobs - * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken - */ - - /** - * Constructs a new ListJobsResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListJobsResponse. - * @implements IListJobsResponse - * @constructor - * @param {google.cloud.run.v2.IListJobsResponse=} [properties] Properties to set - */ - function ListJobsResponse(properties) { - this.jobs = []; - if (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.run.v2.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.jobs = $util.emptyArray; - - /** - * ListJobsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListJobsResponse - * @static - * @param {google.cloud.run.v2.IListJobsResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListJobsResponse} ListJobsResponse instance - */ - ListJobsResponse.create = function create(properties) { - return new ListJobsResponse(properties); - }; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.run.v2.ListJobsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListJobsResponse - * @static - * @param {google.cloud.run.v2.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.run.v2.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); - return writer; - }; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListJobsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListJobsResponse - * @static - * @param {google.cloud.run.v2.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.run.v2.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListJobsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.jobs && message.jobs.length)) - message.jobs = []; - message.jobs.push($root.google.cloud.run.v2.Job.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = 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.run.v2.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.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"; - return null; - }; - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListJobsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListJobsResponse} ListJobsResponse - */ - ListJobsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListJobsResponse) - return object; - var message = new $root.google.cloud.run.v2.ListJobsResponse(); - if (object.jobs) { - if (!Array.isArray(object.jobs)) - throw TypeError(".google.cloud.run.v2.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.run.v2.ListJobsResponse.jobs: object expected"); - message.jobs[i] = $root.google.cloud.run.v2.Job.fromObject(object.jobs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListJobsResponse - * @static - * @param {google.cloud.run.v2.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 = []; - 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.run.v2.Job.toObject(message.jobs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListJobsResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListJobsResponse"; - }; - - return ListJobsResponse; - })(); - - v2.DeleteJobRequest = (function() { - - /** - * Properties of a DeleteJobRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteJobRequest - * @property {string|null} [name] DeleteJobRequest name - * @property {boolean|null} [validateOnly] DeleteJobRequest validateOnly - * @property {string|null} [etag] DeleteJobRequest etag - */ - - /** - * Constructs a new DeleteJobRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteJobRequest. - * @implements IDeleteJobRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.name = ""; - - /** - * DeleteJobRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.validateOnly = false; - - /** - * DeleteJobRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.etag = ""; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteJobRequest - * @static - * @param {google.cloud.run.v2.IDeleteJobRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteJobRequest} DeleteJobRequest instance - */ - DeleteJobRequest.create = function create(properties) { - return new DeleteJobRequest(properties); - }; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteJobRequest - * @static - * @param {google.cloud.run.v2.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.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.etag = 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.run.v2.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: 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.run.v2.DeleteJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteJobRequest} DeleteJobRequest - */ - DeleteJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteJobRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteJobRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteJobRequest - * @static - * @param {google.cloud.run.v2.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.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.DeleteJobRequest"; - }; - - return DeleteJobRequest; - })(); - - v2.RunJobRequest = (function() { - - /** - * Properties of a RunJobRequest. - * @memberof google.cloud.run.v2 - * @interface IRunJobRequest - * @property {string|null} [name] RunJobRequest name - * @property {boolean|null} [validateOnly] RunJobRequest validateOnly - * @property {string|null} [etag] RunJobRequest etag - * @property {google.cloud.run.v2.RunJobRequest.IOverrides|null} [overrides] RunJobRequest overrides - */ - - /** - * Constructs a new RunJobRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a RunJobRequest. - * @implements IRunJobRequest - * @constructor - * @param {google.cloud.run.v2.IRunJobRequest=} [properties] Properties to set - */ - function RunJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunJobRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.RunJobRequest - * @instance - */ - RunJobRequest.prototype.name = ""; - - /** - * RunJobRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.RunJobRequest - * @instance - */ - RunJobRequest.prototype.validateOnly = false; - - /** - * RunJobRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.RunJobRequest - * @instance - */ - RunJobRequest.prototype.etag = ""; - - /** - * RunJobRequest overrides. - * @member {google.cloud.run.v2.RunJobRequest.IOverrides|null|undefined} overrides - * @memberof google.cloud.run.v2.RunJobRequest - * @instance - */ - RunJobRequest.prototype.overrides = null; - - /** - * Creates a new RunJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {google.cloud.run.v2.IRunJobRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest instance - */ - RunJobRequest.create = function create(properties) { - return new RunJobRequest(properties); - }; - - /** - * Encodes the specified RunJobRequest message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {google.cloud.run.v2.IRunJobRequest} message RunJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) - $root.google.cloud.run.v2.RunJobRequest.Overrides.encode(message.overrides, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RunJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {google.cloud.run.v2.IRunJobRequest} message RunJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunJobRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunJobRequest message. - * @function verify - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.overrides != null && message.hasOwnProperty("overrides")) { - var error = $root.google.cloud.run.v2.RunJobRequest.Overrides.verify(message.overrides); - if (error) - return "overrides." + error; - } - return null; - }; - - /** - * Creates a RunJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest - */ - RunJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RunJobRequest) - return object; - var message = new $root.google.cloud.run.v2.RunJobRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - if (object.overrides != null) { - if (typeof object.overrides !== "object") - throw TypeError(".google.cloud.run.v2.RunJobRequest.overrides: object expected"); - message.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.fromObject(object.overrides); - } - return message; - }; - - /** - * Creates a plain object from a RunJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {google.cloud.run.v2.RunJobRequest} message RunJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - object.overrides = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.overrides != null && message.hasOwnProperty("overrides")) - object.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.toObject(message.overrides, options); - return object; - }; - - /** - * Converts this RunJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RunJobRequest - * @instance - * @returns {Object.} JSON object - */ - RunJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunJobRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest"; - }; - - RunJobRequest.Overrides = (function() { - - /** - * Properties of an Overrides. - * @memberof google.cloud.run.v2.RunJobRequest - * @interface IOverrides - * @property {Array.|null} [containerOverrides] Overrides containerOverrides - * @property {number|null} [taskCount] Overrides taskCount - * @property {google.protobuf.IDuration|null} [timeout] Overrides timeout - */ - - /** - * Constructs a new Overrides. - * @memberof google.cloud.run.v2.RunJobRequest - * @classdesc Represents an Overrides. - * @implements IOverrides - * @constructor - * @param {google.cloud.run.v2.RunJobRequest.IOverrides=} [properties] Properties to set - */ - function Overrides(properties) { - this.containerOverrides = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Overrides containerOverrides. - * @member {Array.} containerOverrides - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @instance - */ - Overrides.prototype.containerOverrides = $util.emptyArray; - - /** - * Overrides taskCount. - * @member {number} taskCount - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @instance - */ - Overrides.prototype.taskCount = 0; - - /** - * Overrides timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @instance - */ - Overrides.prototype.timeout = null; - - /** - * Creates a new Overrides instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {google.cloud.run.v2.RunJobRequest.IOverrides=} [properties] Properties to set - * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides instance - */ - Overrides.create = function create(properties) { - return new Overrides(properties); - }; - - /** - * Encodes the specified Overrides message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {google.cloud.run.v2.RunJobRequest.IOverrides} message Overrides message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Overrides.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.containerOverrides != null && message.containerOverrides.length) - for (var i = 0; i < message.containerOverrides.length; ++i) - $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.encode(message.containerOverrides[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.taskCount); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Overrides message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {google.cloud.run.v2.RunJobRequest.IOverrides} message Overrides message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Overrides.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Overrides message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Overrides.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest.Overrides(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.containerOverrides && message.containerOverrides.length)) - message.containerOverrides = []; - message.containerOverrides.push($root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.decode(reader, reader.uint32())); - break; - } - case 2: { - message.taskCount = reader.int32(); - break; - } - case 4: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Overrides message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Overrides.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Overrides message. - * @function verify - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Overrides.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.containerOverrides != null && message.hasOwnProperty("containerOverrides")) { - if (!Array.isArray(message.containerOverrides)) - return "containerOverrides: array expected"; - for (var i = 0; i < message.containerOverrides.length; ++i) { - var error = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify(message.containerOverrides[i]); - if (error) - return "containerOverrides." + error; - } - } - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount)) - return "taskCount: integer 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 an Overrides message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides - */ - Overrides.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RunJobRequest.Overrides) - return object; - var message = new $root.google.cloud.run.v2.RunJobRequest.Overrides(); - if (object.containerOverrides) { - if (!Array.isArray(object.containerOverrides)) - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.containerOverrides: array expected"); - message.containerOverrides = []; - for (var i = 0; i < object.containerOverrides.length; ++i) { - if (typeof object.containerOverrides[i] !== "object") - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.containerOverrides: object expected"); - message.containerOverrides[i] = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.fromObject(object.containerOverrides[i]); - } - } - if (object.taskCount != null) - message.taskCount = object.taskCount | 0; - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from an Overrides message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {google.cloud.run.v2.RunJobRequest.Overrides} message Overrides - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Overrides.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.containerOverrides = []; - if (options.defaults) { - object.taskCount = 0; - object.timeout = null; - } - if (message.containerOverrides && message.containerOverrides.length) { - object.containerOverrides = []; - for (var j = 0; j < message.containerOverrides.length; ++j) - object.containerOverrides[j] = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.toObject(message.containerOverrides[j], options); - } - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - object.taskCount = message.taskCount; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this Overrides to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @instance - * @returns {Object.} JSON object - */ - Overrides.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Overrides - * @function getTypeUrl - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Overrides.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest.Overrides"; - }; - - Overrides.ContainerOverride = (function() { - - /** - * Properties of a ContainerOverride. - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @interface IContainerOverride - * @property {string|null} [name] ContainerOverride name - * @property {Array.|null} [args] ContainerOverride args - * @property {Array.|null} [env] ContainerOverride env - * @property {boolean|null} [clearArgs] ContainerOverride clearArgs - */ - - /** - * Constructs a new ContainerOverride. - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @classdesc Represents a ContainerOverride. - * @implements IContainerOverride - * @constructor - * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride=} [properties] Properties to set - */ - function ContainerOverride(properties) { - this.args = []; - this.env = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContainerOverride name. - * @member {string} name - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @instance - */ - ContainerOverride.prototype.name = ""; - - /** - * ContainerOverride args. - * @member {Array.} args - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @instance - */ - ContainerOverride.prototype.args = $util.emptyArray; - - /** - * ContainerOverride env. - * @member {Array.} env - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @instance - */ - ContainerOverride.prototype.env = $util.emptyArray; - - /** - * ContainerOverride clearArgs. - * @member {boolean} clearArgs - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @instance - */ - ContainerOverride.prototype.clearArgs = false; - - /** - * Creates a new ContainerOverride instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride=} [properties] Properties to set - * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride instance - */ - ContainerOverride.create = function create(properties) { - return new ContainerOverride(properties); - }; - - /** - * Encodes the specified ContainerOverride message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride} message ContainerOverride message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerOverride.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.args != null && message.args.length) - for (var i = 0; i < message.args.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.args[i]); - if (message.env != null && message.env.length) - for (var i = 0; i < message.env.length; ++i) - $root.google.cloud.run.v2.EnvVar.encode(message.env[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.clearArgs != null && Object.hasOwnProperty.call(message, "clearArgs")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.clearArgs); - return writer; - }; - - /** - * Encodes the specified ContainerOverride message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride} message ContainerOverride message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerOverride.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContainerOverride message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerOverride.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 3: { - if (!(message.env && message.env.length)) - message.env = []; - message.env.push($root.google.cloud.run.v2.EnvVar.decode(reader, reader.uint32())); - break; - } - case 4: { - message.clearArgs = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContainerOverride message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerOverride.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContainerOverride message. - * @function verify - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContainerOverride.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.args != null && message.hasOwnProperty("args")) { - if (!Array.isArray(message.args)) - return "args: array expected"; - for (var i = 0; i < message.args.length; ++i) - if (!$util.isString(message.args[i])) - return "args: string[] expected"; - } - if (message.env != null && message.hasOwnProperty("env")) { - if (!Array.isArray(message.env)) - return "env: array expected"; - for (var i = 0; i < message.env.length; ++i) { - var error = $root.google.cloud.run.v2.EnvVar.verify(message.env[i]); - if (error) - return "env." + error; - } - } - if (message.clearArgs != null && message.hasOwnProperty("clearArgs")) - if (typeof message.clearArgs !== "boolean") - return "clearArgs: boolean expected"; - return null; - }; - - /** - * Creates a ContainerOverride message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride - */ - ContainerOverride.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride) - return object; - var message = new $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride(); - if (object.name != null) - message.name = String(object.name); - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.env) { - if (!Array.isArray(object.env)) - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.env: array expected"); - message.env = []; - for (var i = 0; i < object.env.length; ++i) { - if (typeof object.env[i] !== "object") - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.env: object expected"); - message.env[i] = $root.google.cloud.run.v2.EnvVar.fromObject(object.env[i]); - } - } - if (object.clearArgs != null) - message.clearArgs = Boolean(object.clearArgs); - return message; - }; - - /** - * Creates a plain object from a ContainerOverride message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} message ContainerOverride - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContainerOverride.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.args = []; - object.env = []; - } - if (options.defaults) { - object.name = ""; - object.clearArgs = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.args && message.args.length) { - object.args = []; - for (var j = 0; j < message.args.length; ++j) - object.args[j] = message.args[j]; - } - if (message.env && message.env.length) { - object.env = []; - for (var j = 0; j < message.env.length; ++j) - object.env[j] = $root.google.cloud.run.v2.EnvVar.toObject(message.env[j], options); - } - if (message.clearArgs != null && message.hasOwnProperty("clearArgs")) - object.clearArgs = message.clearArgs; - return object; - }; - - /** - * Converts this ContainerOverride to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @instance - * @returns {Object.} JSON object - */ - ContainerOverride.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContainerOverride - * @function getTypeUrl - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContainerOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride"; - }; - - return ContainerOverride; - })(); - - return Overrides; - })(); - - return RunJobRequest; - })(); - - v2.Job = (function() { - - /** - * Properties of a Job. - * @memberof google.cloud.run.v2 - * @interface IJob - * @property {string|null} [name] Job name - * @property {string|null} [uid] Job uid - * @property {number|Long|null} [generation] Job generation - * @property {Object.|null} [labels] Job labels - * @property {Object.|null} [annotations] Job annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Job deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Job expireTime - * @property {string|null} [creator] Job creator - * @property {string|null} [lastModifier] Job lastModifier - * @property {string|null} [client] Job client - * @property {string|null} [clientVersion] Job clientVersion - * @property {google.api.LaunchStage|null} [launchStage] Job launchStage - * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Job binaryAuthorization - * @property {google.cloud.run.v2.IExecutionTemplate|null} [template] Job template - * @property {number|Long|null} [observedGeneration] Job observedGeneration - * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Job terminalCondition - * @property {Array.|null} [conditions] Job conditions - * @property {number|null} [executionCount] Job executionCount - * @property {google.cloud.run.v2.IExecutionReference|null} [latestCreatedExecution] Job latestCreatedExecution - * @property {boolean|null} [reconciling] Job reconciling - * @property {boolean|null} [satisfiesPzs] Job satisfiesPzs - * @property {string|null} [startExecutionToken] Job startExecutionToken - * @property {string|null} [runExecutionToken] Job runExecutionToken - * @property {string|null} [etag] Job etag - */ - - /** - * Constructs a new Job. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Job. - * @implements IJob - * @constructor - * @param {google.cloud.run.v2.IJob=} [properties] Properties to set - */ - function Job(properties) { - this.labels = {}; - this.annotations = {}; - this.conditions = []; - if (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.run.v2.Job - * @instance - */ - Job.prototype.name = ""; - - /** - * Job uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.uid = ""; - - /** - * Job generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Job labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.labels = $util.emptyObject; - - /** - * Job annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.annotations = $util.emptyObject; - - /** - * Job createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.createTime = null; - - /** - * Job updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.updateTime = null; - - /** - * Job deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.deleteTime = null; - - /** - * Job expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.expireTime = null; - - /** - * Job creator. - * @member {string} creator - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.creator = ""; - - /** - * Job lastModifier. - * @member {string} lastModifier - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.lastModifier = ""; - - /** - * Job client. - * @member {string} client - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.client = ""; - - /** - * Job clientVersion. - * @member {string} clientVersion - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.clientVersion = ""; - - /** - * Job launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.launchStage = 0; - - /** - * Job binaryAuthorization. - * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.binaryAuthorization = null; - - /** - * Job template. - * @member {google.cloud.run.v2.IExecutionTemplate|null|undefined} template - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.template = null; - - /** - * Job observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Job terminalCondition. - * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.terminalCondition = null; - - /** - * Job conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.conditions = $util.emptyArray; - - /** - * Job executionCount. - * @member {number} executionCount - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.executionCount = 0; - - /** - * Job latestCreatedExecution. - * @member {google.cloud.run.v2.IExecutionReference|null|undefined} latestCreatedExecution - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.latestCreatedExecution = null; - - /** - * Job reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.reconciling = false; - - /** - * Job satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.satisfiesPzs = false; - - /** - * Job startExecutionToken. - * @member {string|null|undefined} startExecutionToken - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.startExecutionToken = null; - - /** - * Job runExecutionToken. - * @member {string|null|undefined} runExecutionToken - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.runExecutionToken = null; - - /** - * Job etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Job createExecution. - * @member {"startExecutionToken"|"runExecutionToken"|undefined} createExecution - * @memberof google.cloud.run.v2.Job - * @instance - */ - Object.defineProperty(Job.prototype, "createExecution", { - get: $util.oneOfGetter($oneOfFields = ["startExecutionToken", "runExecutionToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Job instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Job - * @static - * @param {google.cloud.run.v2.IJob=} [properties] Properties to set - * @returns {google.cloud.run.v2.Job} Job instance - */ - Job.create = function create(properties) { - return new Job(properties); - }; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.run.v2.Job.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Job - * @static - * @param {google.cloud.run.v2.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.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.creator); - if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.lastModifier); - if (message.client != null && Object.hasOwnProperty.call(message, "client")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.client); - if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.clientVersion); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.launchStage); - if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) - $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.run.v2.ExecutionTemplate.encode(message.template, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.observedGeneration); - if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) - $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.executionCount != null && Object.hasOwnProperty.call(message, "executionCount")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.executionCount); - if (message.latestCreatedExecution != null && Object.hasOwnProperty.call(message, "latestCreatedExecution")) - $root.google.cloud.run.v2.ExecutionReference.encode(message.latestCreatedExecution, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.reconciling); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 25, wireType 0 =*/200).bool(message.satisfiesPzs); - if (message.startExecutionToken != null && Object.hasOwnProperty.call(message, "startExecutionToken")) - writer.uint32(/* id 26, wireType 2 =*/210).string(message.startExecutionToken); - if (message.runExecutionToken != null && Object.hasOwnProperty.call(message, "runExecutionToken")) - writer.uint32(/* id 27, wireType 2 =*/218).string(message.runExecutionToken); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.run.v2.Job.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Job - * @static - * @param {google.cloud.run.v2.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.run.v2.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Job(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 5: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.creator = reader.string(); - break; - } - case 11: { - message.lastModifier = reader.string(); - break; - } - case 12: { - message.client = reader.string(); - break; - } - case 13: { - message.clientVersion = reader.string(); - break; - } - case 14: { - message.launchStage = reader.int32(); - break; - } - case 15: { - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); - break; - } - case 16: { - message.template = $root.google.cloud.run.v2.ExecutionTemplate.decode(reader, reader.uint32()); - break; - } - case 17: { - message.observedGeneration = reader.int64(); - break; - } - case 18: { - message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); - break; - } - case 19: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 20: { - message.executionCount = reader.int32(); - break; - } - case 22: { - message.latestCreatedExecution = $root.google.cloud.run.v2.ExecutionReference.decode(reader, reader.uint32()); - break; - } - case 23: { - message.reconciling = reader.bool(); - break; - } - case 25: { - message.satisfiesPzs = reader.bool(); - break; - } - case 26: { - message.startExecutionToken = reader.string(); - break; - } - case 27: { - message.runExecutionToken = reader.string(); - break; - } - case 99: { - message.etag = reader.string(); - 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.run.v2.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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"; - var properties = {}; - 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.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - if (!$util.isString(message.lastModifier)) - return "lastModifier: string expected"; - if (message.client != null && message.hasOwnProperty("client")) - if (!$util.isString(message.client)) - return "client: string expected"; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - if (!$util.isString(message.clientVersion)) - return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { - var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); - if (error) - return "binaryAuthorization." + error; - } - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.run.v2.ExecutionTemplate.verify(message.template); - if (error) - return "template." + error; - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { - var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); - if (error) - return "terminalCondition." + error; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.executionCount != null && message.hasOwnProperty("executionCount")) - if (!$util.isInteger(message.executionCount)) - return "executionCount: integer expected"; - if (message.latestCreatedExecution != null && message.hasOwnProperty("latestCreatedExecution")) { - var error = $root.google.cloud.run.v2.ExecutionReference.verify(message.latestCreatedExecution); - if (error) - return "latestCreatedExecution." + error; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.startExecutionToken != null && message.hasOwnProperty("startExecutionToken")) { - properties.createExecution = 1; - if (!$util.isString(message.startExecutionToken)) - return "startExecutionToken: string expected"; - } - if (message.runExecutionToken != null && message.hasOwnProperty("runExecutionToken")) { - if (properties.createExecution === 1) - return "createExecution: multiple values"; - properties.createExecution = 1; - if (!$util.isString(message.runExecutionToken)) - return "runExecutionToken: string expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Job - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Job} Job - */ - Job.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Job) - return object; - var message = new $root.google.cloud.run.v2.Job(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Job.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.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.run.v2.Job.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Job.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Job.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.lastModifier != null) - message.lastModifier = String(object.lastModifier); - if (object.client != null) - message.client = String(object.client); - if (object.clientVersion != null) - message.clientVersion = String(object.clientVersion); - 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.binaryAuthorization != null) { - if (typeof object.binaryAuthorization !== "object") - throw TypeError(".google.cloud.run.v2.Job.binaryAuthorization: object expected"); - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); - } - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.run.v2.Job.template: object expected"); - message.template = $root.google.cloud.run.v2.ExecutionTemplate.fromObject(object.template); - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.terminalCondition != null) { - if (typeof object.terminalCondition !== "object") - throw TypeError(".google.cloud.run.v2.Job.terminalCondition: object expected"); - message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Job.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Job.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.executionCount != null) - message.executionCount = object.executionCount | 0; - if (object.latestCreatedExecution != null) { - if (typeof object.latestCreatedExecution !== "object") - throw TypeError(".google.cloud.run.v2.Job.latestCreatedExecution: object expected"); - message.latestCreatedExecution = $root.google.cloud.run.v2.ExecutionReference.fromObject(object.latestCreatedExecution); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.startExecutionToken != null) - message.startExecutionToken = String(object.startExecutionToken); - if (object.runExecutionToken != null) - message.runExecutionToken = String(object.runExecutionToken); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Job - * @static - * @param {google.cloud.run.v2.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.conditions = []; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.creator = ""; - object.lastModifier = ""; - object.client = ""; - object.clientVersion = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.binaryAuthorization = null; - object.template = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.terminalCondition = null; - object.executionCount = 0; - object.latestCreatedExecution = null; - object.reconciling = false; - object.satisfiesPzs = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - object.lastModifier = message.lastModifier; - if (message.client != null && message.hasOwnProperty("client")) - object.client = message.client; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - object.clientVersion = message.clientVersion; - 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) - object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.run.v2.ExecutionTemplate.toObject(message.template, options); - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) - object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.executionCount != null && message.hasOwnProperty("executionCount")) - object.executionCount = message.executionCount; - if (message.latestCreatedExecution != null && message.hasOwnProperty("latestCreatedExecution")) - object.latestCreatedExecution = $root.google.cloud.run.v2.ExecutionReference.toObject(message.latestCreatedExecution, options); - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.startExecutionToken != null && message.hasOwnProperty("startExecutionToken")) { - object.startExecutionToken = message.startExecutionToken; - if (options.oneofs) - object.createExecution = "startExecutionToken"; - } - if (message.runExecutionToken != null && message.hasOwnProperty("runExecutionToken")) { - object.runExecutionToken = message.runExecutionToken; - if (options.oneofs) - object.createExecution = "runExecutionToken"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Job to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Job"; - }; - - return Job; - })(); - - v2.ExecutionReference = (function() { - - /** - * Properties of an ExecutionReference. - * @memberof google.cloud.run.v2 - * @interface IExecutionReference - * @property {string|null} [name] ExecutionReference name - * @property {google.protobuf.ITimestamp|null} [createTime] ExecutionReference createTime - * @property {google.protobuf.ITimestamp|null} [completionTime] ExecutionReference completionTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] ExecutionReference deleteTime - * @property {google.cloud.run.v2.ExecutionReference.CompletionStatus|null} [completionStatus] ExecutionReference completionStatus - */ - - /** - * Constructs a new ExecutionReference. - * @memberof google.cloud.run.v2 - * @classdesc Represents an ExecutionReference. - * @implements IExecutionReference - * @constructor - * @param {google.cloud.run.v2.IExecutionReference=} [properties] Properties to set - */ - function ExecutionReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecutionReference name. - * @member {string} name - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - */ - ExecutionReference.prototype.name = ""; - - /** - * ExecutionReference createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - */ - ExecutionReference.prototype.createTime = null; - - /** - * ExecutionReference completionTime. - * @member {google.protobuf.ITimestamp|null|undefined} completionTime - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - */ - ExecutionReference.prototype.completionTime = null; - - /** - * ExecutionReference deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - */ - ExecutionReference.prototype.deleteTime = null; - - /** - * ExecutionReference completionStatus. - * @member {google.cloud.run.v2.ExecutionReference.CompletionStatus} completionStatus - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - */ - ExecutionReference.prototype.completionStatus = 0; - - /** - * Creates a new ExecutionReference instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {google.cloud.run.v2.IExecutionReference=} [properties] Properties to set - * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference instance - */ - ExecutionReference.create = function create(properties) { - return new ExecutionReference(properties); - }; - - /** - * Encodes the specified ExecutionReference message. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {google.cloud.run.v2.IExecutionReference} message ExecutionReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) - $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.completionStatus != null && Object.hasOwnProperty.call(message, "completionStatus")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.completionStatus); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecutionReference message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {google.cloud.run.v2.IExecutionReference} message ExecutionReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecutionReference message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ExecutionReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.completionStatus = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecutionReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecutionReference message. - * @function verify - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecutionReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.completionTime != null && message.hasOwnProperty("completionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.completionTime); - if (error) - return "completionTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.completionStatus != null && message.hasOwnProperty("completionStatus")) - switch (message.completionStatus) { - default: - return "completionStatus: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates an ExecutionReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference - */ - ExecutionReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ExecutionReference) - return object; - var message = new $root.google.cloud.run.v2.ExecutionReference(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionReference.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.completionTime != null) { - if (typeof object.completionTime !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionReference.completionTime: object expected"); - message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionReference.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - switch (object.completionStatus) { - default: - if (typeof object.completionStatus === "number") { - message.completionStatus = object.completionStatus; - break; - } - break; - case "COMPLETION_STATUS_UNSPECIFIED": - case 0: - message.completionStatus = 0; - break; - case "EXECUTION_SUCCEEDED": - case 1: - message.completionStatus = 1; - break; - case "EXECUTION_FAILED": - case 2: - message.completionStatus = 2; - break; - case "EXECUTION_RUNNING": - case 3: - message.completionStatus = 3; - break; - case "EXECUTION_PENDING": - case 4: - message.completionStatus = 4; - break; - case "EXECUTION_CANCELLED": - case 5: - message.completionStatus = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExecutionReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {google.cloud.run.v2.ExecutionReference} message ExecutionReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecutionReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.completionTime = null; - object.completionStatus = options.enums === String ? "COMPLETION_STATUS_UNSPECIFIED" : 0; - object.deleteTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.completionTime != null && message.hasOwnProperty("completionTime")) - object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); - if (message.completionStatus != null && message.hasOwnProperty("completionStatus")) - object.completionStatus = options.enums === String ? $root.google.cloud.run.v2.ExecutionReference.CompletionStatus[message.completionStatus] === undefined ? message.completionStatus : $root.google.cloud.run.v2.ExecutionReference.CompletionStatus[message.completionStatus] : message.completionStatus; - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - return object; - }; - - /** - * Converts this ExecutionReference to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - * @returns {Object.} JSON object - */ - ExecutionReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecutionReference - * @function getTypeUrl - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecutionReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ExecutionReference"; - }; - - /** - * CompletionStatus enum. - * @name google.cloud.run.v2.ExecutionReference.CompletionStatus - * @enum {number} - * @property {number} COMPLETION_STATUS_UNSPECIFIED=0 COMPLETION_STATUS_UNSPECIFIED value - * @property {number} EXECUTION_SUCCEEDED=1 EXECUTION_SUCCEEDED value - * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value - * @property {number} EXECUTION_RUNNING=3 EXECUTION_RUNNING value - * @property {number} EXECUTION_PENDING=4 EXECUTION_PENDING value - * @property {number} EXECUTION_CANCELLED=5 EXECUTION_CANCELLED value - */ - ExecutionReference.CompletionStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMPLETION_STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXECUTION_SUCCEEDED"] = 1; - values[valuesById[2] = "EXECUTION_FAILED"] = 2; - values[valuesById[3] = "EXECUTION_RUNNING"] = 3; - values[valuesById[4] = "EXECUTION_PENDING"] = 4; - values[valuesById[5] = "EXECUTION_CANCELLED"] = 5; - return values; - })(); - - return ExecutionReference; - })(); - - v2.Revisions = (function() { - - /** - * Constructs a new Revisions service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Revisions - * @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 Revisions(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Revisions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Revisions; - - /** - * Creates new Revisions service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Revisions - * @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 {Revisions} RPC service. Useful where requests and/or responses are streamed. - */ - Revisions.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|getRevision}. - * @memberof google.cloud.run.v2.Revisions - * @typedef GetRevisionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Revision} [response] Revision - */ - - /** - * Calls GetRevision. - * @function getRevision - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IGetRevisionRequest} request GetRevisionRequest message or plain object - * @param {google.cloud.run.v2.Revisions.GetRevisionCallback} callback Node-style callback called with the error, if any, and Revision - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Revisions.prototype.getRevision = function getRevision(request, callback) { - return this.rpcCall(getRevision, $root.google.cloud.run.v2.GetRevisionRequest, $root.google.cloud.run.v2.Revision, request, callback); - }, "name", { value: "GetRevision" }); - - /** - * Calls GetRevision. - * @function getRevision - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IGetRevisionRequest} request GetRevisionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|listRevisions}. - * @memberof google.cloud.run.v2.Revisions - * @typedef ListRevisionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListRevisionsResponse} [response] ListRevisionsResponse - */ - - /** - * Calls ListRevisions. - * @function listRevisions - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IListRevisionsRequest} request ListRevisionsRequest message or plain object - * @param {google.cloud.run.v2.Revisions.ListRevisionsCallback} callback Node-style callback called with the error, if any, and ListRevisionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Revisions.prototype.listRevisions = function listRevisions(request, callback) { - return this.rpcCall(listRevisions, $root.google.cloud.run.v2.ListRevisionsRequest, $root.google.cloud.run.v2.ListRevisionsResponse, request, callback); - }, "name", { value: "ListRevisions" }); - - /** - * Calls ListRevisions. - * @function listRevisions - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IListRevisionsRequest} request ListRevisionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|deleteRevision}. - * @memberof google.cloud.run.v2.Revisions - * @typedef DeleteRevisionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteRevision. - * @function deleteRevision - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IDeleteRevisionRequest} request DeleteRevisionRequest message or plain object - * @param {google.cloud.run.v2.Revisions.DeleteRevisionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Revisions.prototype.deleteRevision = function deleteRevision(request, callback) { - return this.rpcCall(deleteRevision, $root.google.cloud.run.v2.DeleteRevisionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteRevision" }); - - /** - * Calls DeleteRevision. - * @function deleteRevision - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IDeleteRevisionRequest} request DeleteRevisionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Revisions; - })(); - - v2.GetRevisionRequest = (function() { - - /** - * Properties of a GetRevisionRequest. - * @memberof google.cloud.run.v2 - * @interface IGetRevisionRequest - * @property {string|null} [name] GetRevisionRequest name - */ - - /** - * Constructs a new GetRevisionRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetRevisionRequest. - * @implements IGetRevisionRequest - * @constructor - * @param {google.cloud.run.v2.IGetRevisionRequest=} [properties] Properties to set - */ - function GetRevisionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetRevisionRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.GetRevisionRequest - * @instance - */ - GetRevisionRequest.prototype.name = ""; - - /** - * Creates a new GetRevisionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {google.cloud.run.v2.IGetRevisionRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest instance - */ - GetRevisionRequest.create = function create(properties) { - return new GetRevisionRequest(properties); - }; - - /** - * Encodes the specified GetRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {google.cloud.run.v2.IGetRevisionRequest} message GetRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetRevisionRequest.encode = function encode(message, writer) { - 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 GetRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {google.cloud.run.v2.IGetRevisionRequest} message GetRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetRevisionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetRevisionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetRevisionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetRevisionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetRevisionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetRevisionRequest message. - * @function verify - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetRevisionRequest.verify = function verify(message) { - if (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 GetRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest - */ - GetRevisionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetRevisionRequest) - return object; - var message = new $root.google.cloud.run.v2.GetRevisionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetRevisionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {google.cloud.run.v2.GetRevisionRequest} message GetRevisionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetRevisionRequest.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 GetRevisionRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GetRevisionRequest - * @instance - * @returns {Object.} JSON object - */ - GetRevisionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetRevisionRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GetRevisionRequest"; - }; - - return GetRevisionRequest; - })(); - - v2.ListRevisionsRequest = (function() { - - /** - * Properties of a ListRevisionsRequest. - * @memberof google.cloud.run.v2 - * @interface IListRevisionsRequest - * @property {string|null} [parent] ListRevisionsRequest parent - * @property {number|null} [pageSize] ListRevisionsRequest pageSize - * @property {string|null} [pageToken] ListRevisionsRequest pageToken - * @property {boolean|null} [showDeleted] ListRevisionsRequest showDeleted - */ - - /** - * Constructs a new ListRevisionsRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListRevisionsRequest. - * @implements IListRevisionsRequest - * @constructor - * @param {google.cloud.run.v2.IListRevisionsRequest=} [properties] Properties to set - */ - function ListRevisionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListRevisionsRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @instance - */ - ListRevisionsRequest.prototype.parent = ""; - - /** - * ListRevisionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @instance - */ - ListRevisionsRequest.prototype.pageSize = 0; - - /** - * ListRevisionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @instance - */ - ListRevisionsRequest.prototype.pageToken = ""; - - /** - * ListRevisionsRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @instance - */ - ListRevisionsRequest.prototype.showDeleted = false; - - /** - * Creates a new ListRevisionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {google.cloud.run.v2.IListRevisionsRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest instance - */ - ListRevisionsRequest.create = function create(properties) { - return new ListRevisionsRequest(properties); - }; - - /** - * Encodes the specified ListRevisionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {google.cloud.run.v2.IListRevisionsRequest} message ListRevisionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRevisionsRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {google.cloud.run.v2.IListRevisionsRequest} message ListRevisionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListRevisionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRevisionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListRevisionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListRevisionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListRevisionsRequest message. - * @function verify - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListRevisionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListRevisionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest - */ - ListRevisionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListRevisionsRequest) - return object; - var message = new $root.google.cloud.run.v2.ListRevisionsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListRevisionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {google.cloud.run.v2.ListRevisionsRequest} message ListRevisionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListRevisionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListRevisionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListRevisionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListRevisionsRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListRevisionsRequest"; - }; - - return ListRevisionsRequest; - })(); - - v2.ListRevisionsResponse = (function() { - - /** - * Properties of a ListRevisionsResponse. - * @memberof google.cloud.run.v2 - * @interface IListRevisionsResponse - * @property {Array.|null} [revisions] ListRevisionsResponse revisions - * @property {string|null} [nextPageToken] ListRevisionsResponse nextPageToken - */ - - /** - * Constructs a new ListRevisionsResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListRevisionsResponse. - * @implements IListRevisionsResponse - * @constructor - * @param {google.cloud.run.v2.IListRevisionsResponse=} [properties] Properties to set - */ - function ListRevisionsResponse(properties) { - this.revisions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListRevisionsResponse revisions. - * @member {Array.} revisions - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @instance - */ - ListRevisionsResponse.prototype.revisions = $util.emptyArray; - - /** - * ListRevisionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @instance - */ - ListRevisionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListRevisionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {google.cloud.run.v2.IListRevisionsResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse instance - */ - ListRevisionsResponse.create = function create(properties) { - return new ListRevisionsResponse(properties); - }; - - /** - * Encodes the specified ListRevisionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {google.cloud.run.v2.IListRevisionsResponse} message ListRevisionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRevisionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revisions != null && message.revisions.length) - for (var i = 0; i < message.revisions.length; ++i) - $root.google.cloud.run.v2.Revision.encode(message.revisions[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 ListRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {google.cloud.run.v2.IListRevisionsResponse} message ListRevisionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListRevisionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRevisionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListRevisionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.revisions && message.revisions.length)) - message.revisions = []; - message.revisions.push($root.google.cloud.run.v2.Revision.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListRevisionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListRevisionsResponse message. - * @function verify - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListRevisionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revisions != null && message.hasOwnProperty("revisions")) { - if (!Array.isArray(message.revisions)) - return "revisions: array expected"; - for (var i = 0; i < message.revisions.length; ++i) { - var error = $root.google.cloud.run.v2.Revision.verify(message.revisions[i]); - if (error) - return "revisions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListRevisionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse - */ - ListRevisionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListRevisionsResponse) - return object; - var message = new $root.google.cloud.run.v2.ListRevisionsResponse(); - if (object.revisions) { - if (!Array.isArray(object.revisions)) - throw TypeError(".google.cloud.run.v2.ListRevisionsResponse.revisions: array expected"); - message.revisions = []; - for (var i = 0; i < object.revisions.length; ++i) { - if (typeof object.revisions[i] !== "object") - throw TypeError(".google.cloud.run.v2.ListRevisionsResponse.revisions: object expected"); - message.revisions[i] = $root.google.cloud.run.v2.Revision.fromObject(object.revisions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListRevisionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {google.cloud.run.v2.ListRevisionsResponse} message ListRevisionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListRevisionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.revisions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.revisions && message.revisions.length) { - object.revisions = []; - for (var j = 0; j < message.revisions.length; ++j) - object.revisions[j] = $root.google.cloud.run.v2.Revision.toObject(message.revisions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListRevisionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListRevisionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListRevisionsResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListRevisionsResponse"; - }; - - return ListRevisionsResponse; - })(); - - v2.DeleteRevisionRequest = (function() { - - /** - * Properties of a DeleteRevisionRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteRevisionRequest - * @property {string|null} [name] DeleteRevisionRequest name - * @property {boolean|null} [validateOnly] DeleteRevisionRequest validateOnly - * @property {string|null} [etag] DeleteRevisionRequest etag - */ - - /** - * Constructs a new DeleteRevisionRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteRevisionRequest. - * @implements IDeleteRevisionRequest - * @constructor - * @param {google.cloud.run.v2.IDeleteRevisionRequest=} [properties] Properties to set - */ - function DeleteRevisionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteRevisionRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @instance - */ - DeleteRevisionRequest.prototype.name = ""; - - /** - * DeleteRevisionRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @instance - */ - DeleteRevisionRequest.prototype.validateOnly = false; - - /** - * DeleteRevisionRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @instance - */ - DeleteRevisionRequest.prototype.etag = ""; - - /** - * Creates a new DeleteRevisionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {google.cloud.run.v2.IDeleteRevisionRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest instance - */ - DeleteRevisionRequest.create = function create(properties) { - return new DeleteRevisionRequest(properties); - }; - - /** - * Encodes the specified DeleteRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {google.cloud.run.v2.IDeleteRevisionRequest} message DeleteRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteRevisionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {google.cloud.run.v2.IDeleteRevisionRequest} message DeleteRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteRevisionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteRevisionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteRevisionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteRevisionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteRevisionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteRevisionRequest message. - * @function verify - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteRevisionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest - */ - DeleteRevisionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteRevisionRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteRevisionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteRevisionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {google.cloud.run.v2.DeleteRevisionRequest} message DeleteRevisionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteRevisionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteRevisionRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteRevisionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteRevisionRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.DeleteRevisionRequest"; - }; - - return DeleteRevisionRequest; - })(); - - v2.Revision = (function() { - - /** - * Properties of a Revision. - * @memberof google.cloud.run.v2 - * @interface IRevision - * @property {string|null} [name] Revision name - * @property {string|null} [uid] Revision uid - * @property {number|Long|null} [generation] Revision generation - * @property {Object.|null} [labels] Revision labels - * @property {Object.|null} [annotations] Revision annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Revision createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Revision updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Revision deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Revision expireTime - * @property {google.api.LaunchStage|null} [launchStage] Revision launchStage - * @property {string|null} [service] Revision service - * @property {google.cloud.run.v2.IRevisionScaling|null} [scaling] Revision scaling - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Revision vpcAccess - * @property {number|null} [maxInstanceRequestConcurrency] Revision maxInstanceRequestConcurrency - * @property {google.protobuf.IDuration|null} [timeout] Revision timeout - * @property {string|null} [serviceAccount] Revision serviceAccount - * @property {Array.|null} [containers] Revision containers - * @property {Array.|null} [volumes] Revision volumes - * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] Revision executionEnvironment - * @property {string|null} [encryptionKey] Revision encryptionKey - * @property {google.cloud.run.v2.IServiceMesh|null} [serviceMesh] Revision serviceMesh - * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] Revision encryptionKeyRevocationAction - * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] Revision encryptionKeyShutdownDuration - * @property {boolean|null} [reconciling] Revision reconciling - * @property {Array.|null} [conditions] Revision conditions - * @property {number|Long|null} [observedGeneration] Revision observedGeneration - * @property {string|null} [logUri] Revision logUri - * @property {boolean|null} [satisfiesPzs] Revision satisfiesPzs - * @property {boolean|null} [sessionAffinity] Revision sessionAffinity - * @property {google.cloud.run.v2.IRevisionScalingStatus|null} [scalingStatus] Revision scalingStatus - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Revision nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] Revision gpuZonalRedundancyDisabled - * @property {string|null} [creator] Revision creator - * @property {string|null} [etag] Revision etag - */ - - /** - * Constructs a new Revision. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Revision. - * @implements IRevision - * @constructor - * @param {google.cloud.run.v2.IRevision=} [properties] Properties to set - */ - function Revision(properties) { - this.labels = {}; - this.annotations = {}; - this.containers = []; - this.volumes = []; - this.conditions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Revision name. - * @member {string} name - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.name = ""; - - /** - * Revision uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.uid = ""; - - /** - * Revision generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Revision labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.labels = $util.emptyObject; - - /** - * Revision annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.annotations = $util.emptyObject; - - /** - * Revision createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.createTime = null; - - /** - * Revision updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.updateTime = null; - - /** - * Revision deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.deleteTime = null; - - /** - * Revision expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.expireTime = null; - - /** - * Revision launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.launchStage = 0; - - /** - * Revision service. - * @member {string} service - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.service = ""; - - /** - * Revision scaling. - * @member {google.cloud.run.v2.IRevisionScaling|null|undefined} scaling - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.scaling = null; - - /** - * Revision vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.vpcAccess = null; - - /** - * Revision maxInstanceRequestConcurrency. - * @member {number} maxInstanceRequestConcurrency - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.maxInstanceRequestConcurrency = 0; - - /** - * Revision timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.timeout = null; - - /** - * Revision serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.serviceAccount = ""; - - /** - * Revision containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.containers = $util.emptyArray; - - /** - * Revision volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.volumes = $util.emptyArray; - - /** - * Revision executionEnvironment. - * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.executionEnvironment = 0; - - /** - * Revision encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.encryptionKey = ""; - - /** - * Revision serviceMesh. - * @member {google.cloud.run.v2.IServiceMesh|null|undefined} serviceMesh - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.serviceMesh = null; - - /** - * Revision encryptionKeyRevocationAction. - * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.encryptionKeyRevocationAction = 0; - - /** - * Revision encryptionKeyShutdownDuration. - * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.encryptionKeyShutdownDuration = null; - - /** - * Revision reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.reconciling = false; - - /** - * Revision conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.conditions = $util.emptyArray; - - /** - * Revision observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Revision logUri. - * @member {string} logUri - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.logUri = ""; - - /** - * Revision satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.satisfiesPzs = false; - - /** - * Revision sessionAffinity. - * @member {boolean} sessionAffinity - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.sessionAffinity = false; - - /** - * Revision scalingStatus. - * @member {google.cloud.run.v2.IRevisionScalingStatus|null|undefined} scalingStatus - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.scalingStatus = null; - - /** - * Revision nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.nodeSelector = null; - - /** - * Revision gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.gpuZonalRedundancyDisabled = null; - - /** - * Revision creator. - * @member {string} creator - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.creator = ""; - - /** - * Revision etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Revision.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Revision instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Revision - * @static - * @param {google.cloud.run.v2.IRevision=} [properties] Properties to set - * @returns {google.cloud.run.v2.Revision} Revision instance - */ - Revision.create = function create(properties) { - return new Revision(properties); - }; - - /** - * Encodes the specified Revision message. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Revision - * @static - * @param {google.cloud.run.v2.IRevision} message Revision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Revision.encode = function encode(message, writer) { - if (!writer) - 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.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.launchStage); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.service); - if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) - $root.google.cloud.run.v2.RevisionScaling.encode(message.scaling, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.serviceAccount); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.executionEnvironment); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 21, wireType 2 =*/170).string(message.encryptionKey); - if (message.serviceMesh != null && Object.hasOwnProperty.call(message, "serviceMesh")) - $root.google.cloud.run.v2.ServiceMesh.encode(message.serviceMesh, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) - writer.uint32(/* id 23, wireType 0 =*/184).int32(message.encryptionKeyRevocationAction); - if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) - $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 30, wireType 0 =*/240).bool(message.reconciling); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 32, wireType 0 =*/256).int64(message.observedGeneration); - if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) - writer.uint32(/* id 33, wireType 2 =*/266).string(message.logUri); - if (message.maxInstanceRequestConcurrency != null && Object.hasOwnProperty.call(message, "maxInstanceRequestConcurrency")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.maxInstanceRequestConcurrency); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 37, wireType 0 =*/296).bool(message.satisfiesPzs); - if (message.sessionAffinity != null && Object.hasOwnProperty.call(message, "sessionAffinity")) - writer.uint32(/* id 38, wireType 0 =*/304).bool(message.sessionAffinity); - if (message.scalingStatus != null && Object.hasOwnProperty.call(message, "scalingStatus")) - $root.google.cloud.run.v2.RevisionScalingStatus.encode(message.scalingStatus, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 48, wireType 0 =*/384).bool(message.gpuZonalRedundancyDisabled); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 49, wireType 2 =*/394).string(message.creator); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Revision - * @static - * @param {google.cloud.run.v2.IRevision} message Revision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Revision.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Revision message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Revision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Revision} Revision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Revision.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Revision(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 5: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.launchStage = reader.int32(); - break; - } - case 11: { - message.service = reader.string(); - break; - } - case 12: { - message.scaling = $root.google.cloud.run.v2.RevisionScaling.decode(reader, reader.uint32()); - break; - } - case 13: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 34: { - message.maxInstanceRequestConcurrency = reader.int32(); - break; - } - case 15: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 16: { - message.serviceAccount = reader.string(); - break; - } - case 17: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 18: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 20: { - message.executionEnvironment = reader.int32(); - break; - } - case 21: { - message.encryptionKey = reader.string(); - break; - } - case 22: { - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.decode(reader, reader.uint32()); - break; - } - case 23: { - message.encryptionKeyRevocationAction = reader.int32(); - break; - } - case 24: { - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 30: { - message.reconciling = reader.bool(); - break; - } - case 31: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 32: { - message.observedGeneration = reader.int64(); - break; - } - case 33: { - message.logUri = reader.string(); - break; - } - case 37: { - message.satisfiesPzs = reader.bool(); - break; - } - case 38: { - message.sessionAffinity = reader.bool(); - break; - } - case 39: { - message.scalingStatus = $root.google.cloud.run.v2.RevisionScalingStatus.decode(reader, reader.uint32()); - break; - } - case 40: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 48: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - case 49: { - message.creator = reader.string(); - break; - } - case 99: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Revision message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Revision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Revision} Revision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Revision.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Revision message. - * @function verify - * @memberof google.cloud.run.v2.Revision - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Revision.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.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - 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.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.scaling != null && message.hasOwnProperty("scaling")) { - var error = $root.google.cloud.run.v2.RevisionScaling.verify(message.scaling); - if (error) - return "scaling." + error; - } - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) - if (!$util.isInteger(message.maxInstanceRequestConcurrency)) - return "maxInstanceRequestConcurrency: integer expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - switch (message.executionEnvironment) { - default: - return "executionEnvironment: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) { - var error = $root.google.cloud.run.v2.ServiceMesh.verify(message.serviceMesh); - if (error) - return "serviceMesh." + error; - } - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - switch (message.encryptionKeyRevocationAction) { - default: - return "encryptionKeyRevocationAction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { - var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); - if (error) - return "encryptionKeyShutdownDuration." + error; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.logUri != null && message.hasOwnProperty("logUri")) - if (!$util.isString(message.logUri)) - return "logUri: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) - if (typeof message.sessionAffinity !== "boolean") - return "sessionAffinity: boolean expected"; - if (message.scalingStatus != null && message.hasOwnProperty("scalingStatus")) { - var error = $root.google.cloud.run.v2.RevisionScalingStatus.verify(message.scalingStatus); - if (error) - return "scalingStatus." + error; - } - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Revision message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Revision - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Revision} Revision - */ - Revision.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Revision) - return object; - var message = new $root.google.cloud.run.v2.Revision(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.Revision.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Revision.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.Revision.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.run.v2.Revision.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Revision.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Revision.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - 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.service != null) - message.service = String(object.service); - if (object.scaling != null) { - if (typeof object.scaling !== "object") - throw TypeError(".google.cloud.run.v2.Revision.scaling: object expected"); - message.scaling = $root.google.cloud.run.v2.RevisionScaling.fromObject(object.scaling); - } - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.Revision.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.maxInstanceRequestConcurrency != null) - message.maxInstanceRequestConcurrency = object.maxInstanceRequestConcurrency | 0; - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.run.v2.Revision.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.Revision.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.Revision.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.Revision.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.Revision.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - switch (object.executionEnvironment) { - default: - if (typeof object.executionEnvironment === "number") { - message.executionEnvironment = object.executionEnvironment; - break; - } - break; - case "EXECUTION_ENVIRONMENT_UNSPECIFIED": - case 0: - message.executionEnvironment = 0; - break; - case "EXECUTION_ENVIRONMENT_GEN1": - case 1: - message.executionEnvironment = 1; - break; - case "EXECUTION_ENVIRONMENT_GEN2": - case 2: - message.executionEnvironment = 2; - break; - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - if (object.serviceMesh != null) { - if (typeof object.serviceMesh !== "object") - throw TypeError(".google.cloud.run.v2.Revision.serviceMesh: object expected"); - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.fromObject(object.serviceMesh); - } - switch (object.encryptionKeyRevocationAction) { - default: - if (typeof object.encryptionKeyRevocationAction === "number") { - message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; - break; - } - break; - case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": - case 0: - message.encryptionKeyRevocationAction = 0; - break; - case "PREVENT_NEW": - case 1: - message.encryptionKeyRevocationAction = 1; - break; - case "SHUTDOWN": - case 2: - message.encryptionKeyRevocationAction = 2; - break; - } - if (object.encryptionKeyShutdownDuration != null) { - if (typeof object.encryptionKeyShutdownDuration !== "object") - throw TypeError(".google.cloud.run.v2.Revision.encryptionKeyShutdownDuration: object expected"); - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Revision.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Revision.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.logUri != null) - message.logUri = String(object.logUri); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.sessionAffinity != null) - message.sessionAffinity = Boolean(object.sessionAffinity); - if (object.scalingStatus != null) { - if (typeof object.scalingStatus !== "object") - throw TypeError(".google.cloud.run.v2.Revision.scalingStatus: object expected"); - message.scalingStatus = $root.google.cloud.run.v2.RevisionScalingStatus.fromObject(object.scalingStatus); - } - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.Revision.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - if (object.creator != null) - message.creator = String(object.creator); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Revision message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Revision - * @static - * @param {google.cloud.run.v2.Revision} message Revision - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Revision.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - object.conditions = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.service = ""; - object.scaling = null; - object.vpcAccess = null; - object.timeout = null; - object.serviceAccount = ""; - object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; - object.encryptionKey = ""; - object.serviceMesh = null; - object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; - object.encryptionKeyShutdownDuration = null; - object.reconciling = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.logUri = ""; - object.maxInstanceRequestConcurrency = 0; - object.satisfiesPzs = false; - object.sessionAffinity = false; - object.scalingStatus = null; - object.nodeSelector = null; - object.creator = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - 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.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.scaling != null && message.hasOwnProperty("scaling")) - object.scaling = $root.google.cloud.run.v2.RevisionScaling.toObject(message.scaling, options); - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) - object.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.toObject(message.serviceMesh, options); - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) - object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.logUri != null && message.hasOwnProperty("logUri")) - object.logUri = message.logUri; - if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) - object.maxInstanceRequestConcurrency = message.maxInstanceRequestConcurrency; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) - object.sessionAffinity = message.sessionAffinity; - if (message.scalingStatus != null && message.hasOwnProperty("scalingStatus")) - object.scalingStatus = $root.google.cloud.run.v2.RevisionScalingStatus.toObject(message.scalingStatus, options); - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Revision to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Revision - * @instance - * @returns {Object.} JSON object - */ - Revision.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Revision - * @function getTypeUrl - * @memberof google.cloud.run.v2.Revision - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Revision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Revision"; - }; - - return Revision; - })(); - - v2.RevisionScalingStatus = (function() { - - /** - * Properties of a RevisionScalingStatus. - * @memberof google.cloud.run.v2 - * @interface IRevisionScalingStatus - * @property {number|null} [desiredMinInstanceCount] RevisionScalingStatus desiredMinInstanceCount - */ - - /** - * Constructs a new RevisionScalingStatus. - * @memberof google.cloud.run.v2 - * @classdesc Represents a RevisionScalingStatus. - * @implements IRevisionScalingStatus - * @constructor - * @param {google.cloud.run.v2.IRevisionScalingStatus=} [properties] Properties to set - */ - function RevisionScalingStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RevisionScalingStatus desiredMinInstanceCount. - * @member {number} desiredMinInstanceCount - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @instance - */ - RevisionScalingStatus.prototype.desiredMinInstanceCount = 0; - - /** - * Creates a new RevisionScalingStatus instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {google.cloud.run.v2.IRevisionScalingStatus=} [properties] Properties to set - * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus instance - */ - RevisionScalingStatus.create = function create(properties) { - return new RevisionScalingStatus(properties); - }; - - /** - * Encodes the specified RevisionScalingStatus message. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {google.cloud.run.v2.IRevisionScalingStatus} message RevisionScalingStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionScalingStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.desiredMinInstanceCount != null && Object.hasOwnProperty.call(message, "desiredMinInstanceCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.desiredMinInstanceCount); - return writer; - }; - - /** - * Encodes the specified RevisionScalingStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {google.cloud.run.v2.IRevisionScalingStatus} message RevisionScalingStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionScalingStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevisionScalingStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionScalingStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RevisionScalingStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.desiredMinInstanceCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevisionScalingStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionScalingStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevisionScalingStatus message. - * @function verify - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevisionScalingStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.desiredMinInstanceCount != null && message.hasOwnProperty("desiredMinInstanceCount")) - if (!$util.isInteger(message.desiredMinInstanceCount)) - return "desiredMinInstanceCount: integer expected"; - return null; - }; - - /** - * Creates a RevisionScalingStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus - */ - RevisionScalingStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RevisionScalingStatus) - return object; - var message = new $root.google.cloud.run.v2.RevisionScalingStatus(); - if (object.desiredMinInstanceCount != null) - message.desiredMinInstanceCount = object.desiredMinInstanceCount | 0; - return message; - }; - - /** - * Creates a plain object from a RevisionScalingStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {google.cloud.run.v2.RevisionScalingStatus} message RevisionScalingStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevisionScalingStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.desiredMinInstanceCount = 0; - if (message.desiredMinInstanceCount != null && message.hasOwnProperty("desiredMinInstanceCount")) - object.desiredMinInstanceCount = message.desiredMinInstanceCount; - return object; - }; - - /** - * Converts this RevisionScalingStatus to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @instance - * @returns {Object.} JSON object - */ - RevisionScalingStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevisionScalingStatus - * @function getTypeUrl - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevisionScalingStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RevisionScalingStatus"; - }; - - return RevisionScalingStatus; - })(); - - v2.RevisionTemplate = (function() { - - /** - * Properties of a RevisionTemplate. - * @memberof google.cloud.run.v2 - * @interface IRevisionTemplate - * @property {string|null} [revision] RevisionTemplate revision - * @property {Object.|null} [labels] RevisionTemplate labels - * @property {Object.|null} [annotations] RevisionTemplate annotations - * @property {google.cloud.run.v2.IRevisionScaling|null} [scaling] RevisionTemplate scaling - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] RevisionTemplate vpcAccess - * @property {google.protobuf.IDuration|null} [timeout] RevisionTemplate timeout - * @property {string|null} [serviceAccount] RevisionTemplate serviceAccount - * @property {Array.|null} [containers] RevisionTemplate containers - * @property {Array.|null} [volumes] RevisionTemplate volumes - * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] RevisionTemplate executionEnvironment - * @property {string|null} [encryptionKey] RevisionTemplate encryptionKey - * @property {number|null} [maxInstanceRequestConcurrency] RevisionTemplate maxInstanceRequestConcurrency - * @property {google.cloud.run.v2.IServiceMesh|null} [serviceMesh] RevisionTemplate serviceMesh - * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] RevisionTemplate encryptionKeyRevocationAction - * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] RevisionTemplate encryptionKeyShutdownDuration - * @property {boolean|null} [sessionAffinity] RevisionTemplate sessionAffinity - * @property {boolean|null} [healthCheckDisabled] RevisionTemplate healthCheckDisabled - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] RevisionTemplate nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] RevisionTemplate gpuZonalRedundancyDisabled - */ - - /** - * Constructs a new RevisionTemplate. - * @memberof google.cloud.run.v2 - * @classdesc Represents a RevisionTemplate. - * @implements IRevisionTemplate - * @constructor - * @param {google.cloud.run.v2.IRevisionTemplate=} [properties] Properties to set - */ - function RevisionTemplate(properties) { - this.labels = {}; - this.annotations = {}; - this.containers = []; - 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]]; - } - - /** - * RevisionTemplate revision. - * @member {string} revision - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.revision = ""; - - /** - * RevisionTemplate labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.labels = $util.emptyObject; - - /** - * RevisionTemplate annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.annotations = $util.emptyObject; - - /** - * RevisionTemplate scaling. - * @member {google.cloud.run.v2.IRevisionScaling|null|undefined} scaling - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.scaling = null; - - /** - * RevisionTemplate vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.vpcAccess = null; - - /** - * RevisionTemplate timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.timeout = null; - - /** - * RevisionTemplate serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.serviceAccount = ""; - - /** - * RevisionTemplate containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.containers = $util.emptyArray; - - /** - * RevisionTemplate volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.volumes = $util.emptyArray; - - /** - * RevisionTemplate executionEnvironment. - * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.executionEnvironment = 0; - - /** - * RevisionTemplate encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.encryptionKey = ""; - - /** - * RevisionTemplate maxInstanceRequestConcurrency. - * @member {number} maxInstanceRequestConcurrency - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.maxInstanceRequestConcurrency = 0; - - /** - * RevisionTemplate serviceMesh. - * @member {google.cloud.run.v2.IServiceMesh|null|undefined} serviceMesh - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.serviceMesh = null; - - /** - * RevisionTemplate encryptionKeyRevocationAction. - * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.encryptionKeyRevocationAction = 0; - - /** - * RevisionTemplate encryptionKeyShutdownDuration. - * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.encryptionKeyShutdownDuration = null; - - /** - * RevisionTemplate sessionAffinity. - * @member {boolean} sessionAffinity - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.sessionAffinity = false; - - /** - * RevisionTemplate healthCheckDisabled. - * @member {boolean} healthCheckDisabled - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.healthCheckDisabled = false; - - /** - * RevisionTemplate nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.nodeSelector = null; - - /** - * RevisionTemplate gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.gpuZonalRedundancyDisabled = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(RevisionTemplate.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RevisionTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {google.cloud.run.v2.IRevisionTemplate=} [properties] Properties to set - * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate instance - */ - RevisionTemplate.create = function create(properties) { - return new RevisionTemplate(properties); - }; - - /** - * Encodes the specified RevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {google.cloud.run.v2.IRevisionTemplate} message RevisionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.revision); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) - $root.google.cloud.run.v2.RevisionScaling.encode(message.scaling, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 6, wireType 2 =*/50).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.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccount); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.executionEnvironment); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.encryptionKey); - if (message.maxInstanceRequestConcurrency != null && Object.hasOwnProperty.call(message, "maxInstanceRequestConcurrency")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.maxInstanceRequestConcurrency); - if (message.serviceMesh != null && Object.hasOwnProperty.call(message, "serviceMesh")) - $root.google.cloud.run.v2.ServiceMesh.encode(message.serviceMesh, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.encryptionKeyRevocationAction); - if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) - $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.sessionAffinity != null && Object.hasOwnProperty.call(message, "sessionAffinity")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.sessionAffinity); - if (message.healthCheckDisabled != null && Object.hasOwnProperty.call(message, "healthCheckDisabled")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.healthCheckDisabled); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 24, wireType 0 =*/192).bool(message.gpuZonalRedundancyDisabled); - return writer; - }; - - /** - * Encodes the specified RevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {google.cloud.run.v2.IRevisionTemplate} message RevisionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevisionTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RevisionTemplate(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revision = reader.string(); - break; - } - case 2: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 3: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 4: { - message.scaling = $root.google.cloud.run.v2.RevisionScaling.decode(reader, reader.uint32()); - break; - } - case 6: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 8: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - message.serviceAccount = reader.string(); - break; - } - case 10: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 11: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 13: { - message.executionEnvironment = reader.int32(); - break; - } - case 14: { - message.encryptionKey = reader.string(); - break; - } - case 15: { - message.maxInstanceRequestConcurrency = reader.int32(); - break; - } - case 16: { - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.decode(reader, reader.uint32()); - break; - } - case 17: { - message.encryptionKeyRevocationAction = reader.int32(); - break; - } - case 18: { - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 19: { - message.sessionAffinity = reader.bool(); - break; - } - case 20: { - message.healthCheckDisabled = reader.bool(); - break; - } - case 21: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 24: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevisionTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevisionTemplate message. - * @function verify - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevisionTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.scaling != null && message.hasOwnProperty("scaling")) { - var error = $root.google.cloud.run.v2.RevisionScaling.verify(message.scaling); - if (error) - return "scaling." + error; - } - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - switch (message.executionEnvironment) { - default: - return "executionEnvironment: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) - if (!$util.isInteger(message.maxInstanceRequestConcurrency)) - return "maxInstanceRequestConcurrency: integer expected"; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) { - var error = $root.google.cloud.run.v2.ServiceMesh.verify(message.serviceMesh); - if (error) - return "serviceMesh." + error; - } - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - switch (message.encryptionKeyRevocationAction) { - default: - return "encryptionKeyRevocationAction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { - var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); - if (error) - return "encryptionKeyShutdownDuration." + error; - } - if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) - if (typeof message.sessionAffinity !== "boolean") - return "sessionAffinity: boolean expected"; - if (message.healthCheckDisabled != null && message.hasOwnProperty("healthCheckDisabled")) - if (typeof message.healthCheckDisabled !== "boolean") - return "healthCheckDisabled: boolean expected"; - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - return null; - }; - - /** - * Creates a RevisionTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate - */ - RevisionTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RevisionTemplate) - return object; - var message = new $root.google.cloud.run.v2.RevisionTemplate(); - if (object.revision != null) - message.revision = String(object.revision); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.scaling != null) { - if (typeof object.scaling !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.scaling: object expected"); - message.scaling = $root.google.cloud.run.v2.RevisionScaling.fromObject(object.scaling); - } - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.RevisionTemplate.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.RevisionTemplate.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - switch (object.executionEnvironment) { - default: - if (typeof object.executionEnvironment === "number") { - message.executionEnvironment = object.executionEnvironment; - break; - } - break; - case "EXECUTION_ENVIRONMENT_UNSPECIFIED": - case 0: - message.executionEnvironment = 0; - break; - case "EXECUTION_ENVIRONMENT_GEN1": - case 1: - message.executionEnvironment = 1; - break; - case "EXECUTION_ENVIRONMENT_GEN2": - case 2: - message.executionEnvironment = 2; - break; - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - if (object.maxInstanceRequestConcurrency != null) - message.maxInstanceRequestConcurrency = object.maxInstanceRequestConcurrency | 0; - if (object.serviceMesh != null) { - if (typeof object.serviceMesh !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.serviceMesh: object expected"); - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.fromObject(object.serviceMesh); - } - switch (object.encryptionKeyRevocationAction) { - default: - if (typeof object.encryptionKeyRevocationAction === "number") { - message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; - break; - } - break; - case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": - case 0: - message.encryptionKeyRevocationAction = 0; - break; - case "PREVENT_NEW": - case 1: - message.encryptionKeyRevocationAction = 1; - break; - case "SHUTDOWN": - case 2: - message.encryptionKeyRevocationAction = 2; - break; - } - if (object.encryptionKeyShutdownDuration != null) { - if (typeof object.encryptionKeyShutdownDuration !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.encryptionKeyShutdownDuration: object expected"); - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); - } - if (object.sessionAffinity != null) - message.sessionAffinity = Boolean(object.sessionAffinity); - if (object.healthCheckDisabled != null) - message.healthCheckDisabled = Boolean(object.healthCheckDisabled); - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - return message; - }; - - /** - * Creates a plain object from a RevisionTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {google.cloud.run.v2.RevisionTemplate} message RevisionTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevisionTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.revision = ""; - object.scaling = null; - object.vpcAccess = null; - object.timeout = null; - object.serviceAccount = ""; - object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; - object.encryptionKey = ""; - object.maxInstanceRequestConcurrency = 0; - object.serviceMesh = null; - object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; - object.encryptionKeyShutdownDuration = null; - object.sessionAffinity = false; - object.healthCheckDisabled = false; - object.nodeSelector = null; - } - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.scaling != null && message.hasOwnProperty("scaling")) - object.scaling = $root.google.cloud.run.v2.RevisionScaling.toObject(message.scaling, options); - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) - object.maxInstanceRequestConcurrency = message.maxInstanceRequestConcurrency; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) - object.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.toObject(message.serviceMesh, options); - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) - object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); - if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) - object.sessionAffinity = message.sessionAffinity; - if (message.healthCheckDisabled != null && message.hasOwnProperty("healthCheckDisabled")) - object.healthCheckDisabled = message.healthCheckDisabled; - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - return object; - }; - - /** - * Converts this RevisionTemplate to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - * @returns {Object.} JSON object - */ - RevisionTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevisionTemplate - * @function getTypeUrl - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevisionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RevisionTemplate"; - }; - - return RevisionTemplate; - })(); - - v2.Services = (function() { - - /** - * Constructs a new Services service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Services - * @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 Services(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Services.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Services; - - /** - * Creates new Services service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Services - * @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 {Services} RPC service. Useful where requests and/or responses are streamed. - */ - Services.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|createService}. - * @memberof google.cloud.run.v2.Services - * @typedef CreateServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateService. - * @function createService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.ICreateServiceRequest} request CreateServiceRequest message or plain object - * @param {google.cloud.run.v2.Services.CreateServiceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.createService = function createService(request, callback) { - return this.rpcCall(createService, $root.google.cloud.run.v2.CreateServiceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateService" }); - - /** - * Calls CreateService. - * @function createService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.ICreateServiceRequest} request CreateServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|getService}. - * @memberof google.cloud.run.v2.Services - * @typedef GetServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Service} [response] Service - */ - - /** - * Calls GetService. - * @function getService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IGetServiceRequest} request GetServiceRequest message or plain object - * @param {google.cloud.run.v2.Services.GetServiceCallback} callback Node-style callback called with the error, if any, and Service - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.getService = function getService(request, callback) { - return this.rpcCall(getService, $root.google.cloud.run.v2.GetServiceRequest, $root.google.cloud.run.v2.Service, request, callback); - }, "name", { value: "GetService" }); - - /** - * Calls GetService. - * @function getService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IGetServiceRequest} request GetServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|listServices}. - * @memberof google.cloud.run.v2.Services - * @typedef ListServicesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListServicesResponse} [response] ListServicesResponse - */ - - /** - * Calls ListServices. - * @function listServices - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IListServicesRequest} request ListServicesRequest message or plain object - * @param {google.cloud.run.v2.Services.ListServicesCallback} callback Node-style callback called with the error, if any, and ListServicesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.listServices = function listServices(request, callback) { - return this.rpcCall(listServices, $root.google.cloud.run.v2.ListServicesRequest, $root.google.cloud.run.v2.ListServicesResponse, request, callback); - }, "name", { value: "ListServices" }); - - /** - * Calls ListServices. - * @function listServices - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IListServicesRequest} request ListServicesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|updateService}. - * @memberof google.cloud.run.v2.Services - * @typedef UpdateServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateService. - * @function updateService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IUpdateServiceRequest} request UpdateServiceRequest message or plain object - * @param {google.cloud.run.v2.Services.UpdateServiceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.updateService = function updateService(request, callback) { - return this.rpcCall(updateService, $root.google.cloud.run.v2.UpdateServiceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateService" }); - - /** - * Calls UpdateService. - * @function updateService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IUpdateServiceRequest} request UpdateServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|deleteService}. - * @memberof google.cloud.run.v2.Services - * @typedef DeleteServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteService. - * @function deleteService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IDeleteServiceRequest} request DeleteServiceRequest message or plain object - * @param {google.cloud.run.v2.Services.DeleteServiceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.deleteService = function deleteService(request, callback) { - return this.rpcCall(deleteService, $root.google.cloud.run.v2.DeleteServiceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteService" }); - - /** - * Calls DeleteService. - * @function deleteService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IDeleteServiceRequest} request DeleteServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|getIamPolicy}. - * @memberof google.cloud.run.v2.Services - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.Services.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|setIamPolicy}. - * @memberof google.cloud.run.v2.Services - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.Services.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|testIamPermissions}. - * @memberof google.cloud.run.v2.Services - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.run.v2.Services.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Services; - })(); - - v2.CreateServiceRequest = (function() { - - /** - * Properties of a CreateServiceRequest. - * @memberof google.cloud.run.v2 - * @interface ICreateServiceRequest - * @property {string|null} [parent] CreateServiceRequest parent - * @property {google.cloud.run.v2.IService|null} [service] CreateServiceRequest service - * @property {string|null} [serviceId] CreateServiceRequest serviceId - * @property {boolean|null} [validateOnly] CreateServiceRequest validateOnly - */ - - /** - * Constructs a new CreateServiceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CreateServiceRequest. - * @implements ICreateServiceRequest - * @constructor - * @param {google.cloud.run.v2.ICreateServiceRequest=} [properties] Properties to set - */ - function CreateServiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateServiceRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.parent = ""; - - /** - * CreateServiceRequest service. - * @member {google.cloud.run.v2.IService|null|undefined} service - * @memberof google.cloud.run.v2.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.service = null; - - /** - * CreateServiceRequest serviceId. - * @member {string} serviceId - * @memberof google.cloud.run.v2.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.serviceId = ""; - - /** - * CreateServiceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateServiceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {google.cloud.run.v2.ICreateServiceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest instance - */ - CreateServiceRequest.create = function create(properties) { - return new CreateServiceRequest(properties); - }; - - /** - * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {google.cloud.run.v2.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateServiceRequest.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.service != null && Object.hasOwnProperty.call(message, "service")) - $root.google.cloud.run.v2.Service.encode(message.service, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.serviceId != null && Object.hasOwnProperty.call(message, "serviceId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {google.cloud.run.v2.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateServiceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.service = $root.google.cloud.run.v2.Service.decode(reader, reader.uint32()); - break; - } - case 3: { - message.serviceId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateServiceRequest message. - * @function verify - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateServiceRequest.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.service != null && message.hasOwnProperty("service")) { - var error = $root.google.cloud.run.v2.Service.verify(message.service); - if (error) - return "service." + error; - } - if (message.serviceId != null && message.hasOwnProperty("serviceId")) - if (!$util.isString(message.serviceId)) - return "serviceId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest - */ - CreateServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CreateServiceRequest) - return object; - var message = new $root.google.cloud.run.v2.CreateServiceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.service != null) { - if (typeof object.service !== "object") - throw TypeError(".google.cloud.run.v2.CreateServiceRequest.service: object expected"); - message.service = $root.google.cloud.run.v2.Service.fromObject(object.service); - } - if (object.serviceId != null) - message.serviceId = String(object.serviceId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {google.cloud.run.v2.CreateServiceRequest} message CreateServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateServiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.service = null; - object.serviceId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.service != null && message.hasOwnProperty("service")) - object.service = $root.google.cloud.run.v2.Service.toObject(message.service, options); - if (message.serviceId != null && message.hasOwnProperty("serviceId")) - object.serviceId = message.serviceId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateServiceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.CreateServiceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateServiceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.CreateServiceRequest"; - }; - - return CreateServiceRequest; - })(); - - v2.UpdateServiceRequest = (function() { - - /** - * Properties of an UpdateServiceRequest. - * @memberof google.cloud.run.v2 - * @interface IUpdateServiceRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServiceRequest updateMask - * @property {google.cloud.run.v2.IService|null} [service] UpdateServiceRequest service - * @property {boolean|null} [validateOnly] UpdateServiceRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateServiceRequest allowMissing - */ - - /** - * Constructs a new UpdateServiceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents an UpdateServiceRequest. - * @implements IUpdateServiceRequest - * @constructor - * @param {google.cloud.run.v2.IUpdateServiceRequest=} [properties] Properties to set - */ - function UpdateServiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateServiceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @instance - */ - UpdateServiceRequest.prototype.updateMask = null; - - /** - * UpdateServiceRequest service. - * @member {google.cloud.run.v2.IService|null|undefined} service - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @instance - */ - UpdateServiceRequest.prototype.service = null; - - /** - * UpdateServiceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @instance - */ - UpdateServiceRequest.prototype.validateOnly = false; - - /** - * UpdateServiceRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @instance - */ - UpdateServiceRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateServiceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {google.cloud.run.v2.IUpdateServiceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest instance - */ - UpdateServiceRequest.create = function create(properties) { - return new UpdateServiceRequest(properties); - }; - - /** - * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {google.cloud.run.v2.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateServiceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - $root.google.cloud.run.v2.Service.encode(message.service, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {google.cloud.run.v2.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateServiceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.UpdateServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 1: { - message.service = $root.google.cloud.run.v2.Service.decode(reader, reader.uint32()); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateServiceRequest message. - * @function verify - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.service != null && message.hasOwnProperty("service")) { - var error = $root.google.cloud.run.v2.Service.verify(message.service); - if (error) - return "service." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest - */ - UpdateServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.UpdateServiceRequest) - return object; - var message = new $root.google.cloud.run.v2.UpdateServiceRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.run.v2.UpdateServiceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.service != null) { - if (typeof object.service !== "object") - throw TypeError(".google.cloud.run.v2.UpdateServiceRequest.service: object expected"); - message.service = $root.google.cloud.run.v2.Service.fromObject(object.service); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {google.cloud.run.v2.UpdateServiceRequest} message UpdateServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateServiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.service = null; - object.updateMask = null; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.service != null && message.hasOwnProperty("service")) - object.service = $root.google.cloud.run.v2.Service.toObject(message.service, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateServiceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateServiceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.UpdateServiceRequest"; - }; - - return UpdateServiceRequest; - })(); - - v2.ListServicesRequest = (function() { - - /** - * Properties of a ListServicesRequest. - * @memberof google.cloud.run.v2 - * @interface IListServicesRequest - * @property {string|null} [parent] ListServicesRequest parent - * @property {number|null} [pageSize] ListServicesRequest pageSize - * @property {string|null} [pageToken] ListServicesRequest pageToken - * @property {boolean|null} [showDeleted] ListServicesRequest showDeleted - */ - - /** - * Constructs a new ListServicesRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListServicesRequest. - * @implements IListServicesRequest - * @constructor - * @param {google.cloud.run.v2.IListServicesRequest=} [properties] Properties to set - */ - function ListServicesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListServicesRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.ListServicesRequest - * @instance - */ - ListServicesRequest.prototype.parent = ""; - - /** - * ListServicesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListServicesRequest - * @instance - */ - ListServicesRequest.prototype.pageSize = 0; - - /** - * ListServicesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListServicesRequest - * @instance - */ - ListServicesRequest.prototype.pageToken = ""; - - /** - * ListServicesRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListServicesRequest - * @instance - */ - ListServicesRequest.prototype.showDeleted = false; - - /** - * Creates a new ListServicesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {google.cloud.run.v2.IListServicesRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest instance - */ - ListServicesRequest.create = function create(properties) { - return new ListServicesRequest(properties); - }; - - /** - * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {google.cloud.run.v2.IListServicesRequest} message ListServicesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServicesRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {google.cloud.run.v2.IListServicesRequest} message ListServicesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListServicesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServicesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListServicesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServicesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListServicesRequest message. - * @function verify - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListServicesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest - */ - ListServicesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListServicesRequest) - return object; - var message = new $root.google.cloud.run.v2.ListServicesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {google.cloud.run.v2.ListServicesRequest} message ListServicesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListServicesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListServicesRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListServicesRequest - * @instance - * @returns {Object.} JSON object - */ - ListServicesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListServicesRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListServicesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListServicesRequest"; - }; - - return ListServicesRequest; - })(); - - v2.ListServicesResponse = (function() { - - /** - * Properties of a ListServicesResponse. - * @memberof google.cloud.run.v2 - * @interface IListServicesResponse - * @property {Array.|null} [services] ListServicesResponse services - * @property {string|null} [nextPageToken] ListServicesResponse nextPageToken - * @property {Array.|null} [unreachable] ListServicesResponse unreachable - */ - - /** - * Constructs a new ListServicesResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListServicesResponse. - * @implements IListServicesResponse - * @constructor - * @param {google.cloud.run.v2.IListServicesResponse=} [properties] Properties to set - */ - function ListServicesResponse(properties) { - this.services = []; - 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]]; - } - - /** - * ListServicesResponse services. - * @member {Array.} services - * @memberof google.cloud.run.v2.ListServicesResponse - * @instance - */ - ListServicesResponse.prototype.services = $util.emptyArray; - - /** - * ListServicesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListServicesResponse - * @instance - */ - ListServicesResponse.prototype.nextPageToken = ""; - - /** - * ListServicesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.run.v2.ListServicesResponse - * @instance - */ - ListServicesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListServicesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {google.cloud.run.v2.IListServicesResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse instance - */ - ListServicesResponse.create = function create(properties) { - return new ListServicesResponse(properties); - }; - - /** - * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {google.cloud.run.v2.IListServicesResponse} message ListServicesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServicesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.services != null && message.services.length) - for (var i = 0; i < message.services.length; ++i) - $root.google.cloud.run.v2.Service.encode(message.services[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 ListServicesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {google.cloud.run.v2.IListServicesResponse} message ListServicesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServicesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListServicesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServicesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListServicesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.services && message.services.length)) - message.services = []; - message.services.push($root.google.cloud.run.v2.Service.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 ListServicesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServicesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListServicesResponse message. - * @function verify - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListServicesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.services != null && message.hasOwnProperty("services")) { - if (!Array.isArray(message.services)) - return "services: array expected"; - for (var i = 0; i < message.services.length; ++i) { - var error = $root.google.cloud.run.v2.Service.verify(message.services[i]); - if (error) - return "services." + 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 ListServicesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse - */ - ListServicesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListServicesResponse) - return object; - var message = new $root.google.cloud.run.v2.ListServicesResponse(); - if (object.services) { - if (!Array.isArray(object.services)) - throw TypeError(".google.cloud.run.v2.ListServicesResponse.services: array expected"); - message.services = []; - for (var i = 0; i < object.services.length; ++i) { - if (typeof object.services[i] !== "object") - throw TypeError(".google.cloud.run.v2.ListServicesResponse.services: object expected"); - message.services[i] = $root.google.cloud.run.v2.Service.fromObject(object.services[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.run.v2.ListServicesResponse.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 ListServicesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {google.cloud.run.v2.ListServicesResponse} message ListServicesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListServicesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.services = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.services && message.services.length) { - object.services = []; - for (var j = 0; j < message.services.length; ++j) - object.services[j] = $root.google.cloud.run.v2.Service.toObject(message.services[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 ListServicesResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListServicesResponse - * @instance - * @returns {Object.} JSON object - */ - ListServicesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListServicesResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListServicesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListServicesResponse"; - }; - - return ListServicesResponse; - })(); - - v2.GetServiceRequest = (function() { - - /** - * Properties of a GetServiceRequest. - * @memberof google.cloud.run.v2 - * @interface IGetServiceRequest - * @property {string|null} [name] GetServiceRequest name - */ - - /** - * Constructs a new GetServiceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetServiceRequest. - * @implements IGetServiceRequest - * @constructor - * @param {google.cloud.run.v2.IGetServiceRequest=} [properties] Properties to set - */ - function GetServiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetServiceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.GetServiceRequest - * @instance - */ - GetServiceRequest.prototype.name = ""; - - /** - * Creates a new GetServiceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {google.cloud.run.v2.IGetServiceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest instance - */ - GetServiceRequest.create = function create(properties) { - return new GetServiceRequest(properties); - }; - - /** - * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {google.cloud.run.v2.IGetServiceRequest} message GetServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetServiceRequest.encode = function encode(message, writer) { - 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 GetServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {google.cloud.run.v2.IGetServiceRequest} message GetServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetServiceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetServiceRequest message. - * @function verify - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetServiceRequest.verify = function verify(message) { - if (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 GetServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest - */ - GetServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetServiceRequest) - return object; - var message = new $root.google.cloud.run.v2.GetServiceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {google.cloud.run.v2.GetServiceRequest} message GetServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetServiceRequest.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 GetServiceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GetServiceRequest - * @instance - * @returns {Object.} JSON object - */ - GetServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetServiceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GetServiceRequest"; - }; - - return GetServiceRequest; - })(); - - v2.DeleteServiceRequest = (function() { - - /** - * Properties of a DeleteServiceRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteServiceRequest - * @property {string|null} [name] DeleteServiceRequest name - * @property {boolean|null} [validateOnly] DeleteServiceRequest validateOnly - * @property {string|null} [etag] DeleteServiceRequest etag - */ - - /** - * Constructs a new DeleteServiceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteServiceRequest. - * @implements IDeleteServiceRequest - * @constructor - * @param {google.cloud.run.v2.IDeleteServiceRequest=} [properties] Properties to set - */ - function DeleteServiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteServiceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @instance - */ - DeleteServiceRequest.prototype.name = ""; - - /** - * DeleteServiceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @instance - */ - DeleteServiceRequest.prototype.validateOnly = false; - - /** - * DeleteServiceRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @instance - */ - DeleteServiceRequest.prototype.etag = ""; - - /** - * Creates a new DeleteServiceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {google.cloud.run.v2.IDeleteServiceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest instance - */ - DeleteServiceRequest.create = function create(properties) { - return new DeleteServiceRequest(properties); - }; - - /** - * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {google.cloud.run.v2.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteServiceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {google.cloud.run.v2.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteServiceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteServiceRequest message. - * @function verify - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest - */ - DeleteServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteServiceRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteServiceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {google.cloud.run.v2.DeleteServiceRequest} message DeleteServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteServiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteServiceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteServiceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.DeleteServiceRequest"; - }; - - return DeleteServiceRequest; - })(); - - v2.Service = (function() { - - /** - * Properties of a Service. - * @memberof google.cloud.run.v2 - * @interface IService - * @property {string|null} [name] Service name - * @property {string|null} [description] Service description - * @property {string|null} [uid] Service uid - * @property {number|Long|null} [generation] Service generation - * @property {Object.|null} [labels] Service labels - * @property {Object.|null} [annotations] Service annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Service createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Service updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Service deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Service expireTime - * @property {string|null} [creator] Service creator - * @property {string|null} [lastModifier] Service lastModifier - * @property {string|null} [client] Service client - * @property {string|null} [clientVersion] Service clientVersion - * @property {google.cloud.run.v2.IngressTraffic|null} [ingress] Service ingress - * @property {google.api.LaunchStage|null} [launchStage] Service launchStage - * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Service binaryAuthorization - * @property {google.cloud.run.v2.IRevisionTemplate|null} [template] Service template - * @property {Array.|null} [traffic] Service traffic - * @property {google.cloud.run.v2.IServiceScaling|null} [scaling] Service scaling - * @property {boolean|null} [invokerIamDisabled] Service invokerIamDisabled - * @property {boolean|null} [defaultUriDisabled] Service defaultUriDisabled - * @property {Array.|null} [urls] Service urls - * @property {boolean|null} [iapEnabled] Service iapEnabled - * @property {google.cloud.run.v2.Service.IMultiRegionSettings|null} [multiRegionSettings] Service multiRegionSettings - * @property {Array.|null} [customAudiences] Service customAudiences - * @property {number|Long|null} [observedGeneration] Service observedGeneration - * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Service terminalCondition - * @property {Array.|null} [conditions] Service conditions - * @property {string|null} [latestReadyRevision] Service latestReadyRevision - * @property {string|null} [latestCreatedRevision] Service latestCreatedRevision - * @property {Array.|null} [trafficStatuses] Service trafficStatuses - * @property {string|null} [uri] Service uri - * @property {boolean|null} [satisfiesPzs] Service satisfiesPzs - * @property {boolean|null} [threatDetectionEnabled] Service threatDetectionEnabled - * @property {google.cloud.run.v2.IBuildConfig|null} [buildConfig] Service buildConfig - * @property {boolean|null} [reconciling] Service reconciling - * @property {string|null} [etag] Service etag - */ - - /** - * Constructs a new Service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Service. - * @implements IService - * @constructor - * @param {google.cloud.run.v2.IService=} [properties] Properties to set - */ - function Service(properties) { - this.labels = {}; - this.annotations = {}; - this.traffic = []; - this.urls = []; - this.customAudiences = []; - this.conditions = []; - this.trafficStatuses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Service name. - * @member {string} name - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.name = ""; - - /** - * Service description. - * @member {string} description - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.description = ""; - - /** - * Service uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.uid = ""; - - /** - * Service generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Service labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.labels = $util.emptyObject; - - /** - * Service annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.annotations = $util.emptyObject; - - /** - * Service createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.createTime = null; - - /** - * Service updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.updateTime = null; - - /** - * Service deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.deleteTime = null; - - /** - * Service expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.expireTime = null; - - /** - * Service creator. - * @member {string} creator - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.creator = ""; - - /** - * Service lastModifier. - * @member {string} lastModifier - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.lastModifier = ""; - - /** - * Service client. - * @member {string} client - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.client = ""; - - /** - * Service clientVersion. - * @member {string} clientVersion - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.clientVersion = ""; - - /** - * Service ingress. - * @member {google.cloud.run.v2.IngressTraffic} ingress - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.ingress = 0; - - /** - * Service launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.launchStage = 0; - - /** - * Service binaryAuthorization. - * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.binaryAuthorization = null; - - /** - * Service template. - * @member {google.cloud.run.v2.IRevisionTemplate|null|undefined} template - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.template = null; - - /** - * Service traffic. - * @member {Array.} traffic - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.traffic = $util.emptyArray; - - /** - * Service scaling. - * @member {google.cloud.run.v2.IServiceScaling|null|undefined} scaling - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.scaling = null; - - /** - * Service invokerIamDisabled. - * @member {boolean} invokerIamDisabled - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.invokerIamDisabled = false; - - /** - * Service defaultUriDisabled. - * @member {boolean} defaultUriDisabled - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.defaultUriDisabled = false; - - /** - * Service urls. - * @member {Array.} urls - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.urls = $util.emptyArray; - - /** - * Service iapEnabled. - * @member {boolean} iapEnabled - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.iapEnabled = false; - - /** - * Service multiRegionSettings. - * @member {google.cloud.run.v2.Service.IMultiRegionSettings|null|undefined} multiRegionSettings - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.multiRegionSettings = null; - - /** - * Service customAudiences. - * @member {Array.} customAudiences - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.customAudiences = $util.emptyArray; - - /** - * Service observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Service terminalCondition. - * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.terminalCondition = null; - - /** - * Service conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.conditions = $util.emptyArray; - - /** - * Service latestReadyRevision. - * @member {string} latestReadyRevision - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.latestReadyRevision = ""; - - /** - * Service latestCreatedRevision. - * @member {string} latestCreatedRevision - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.latestCreatedRevision = ""; - - /** - * Service trafficStatuses. - * @member {Array.} trafficStatuses - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.trafficStatuses = $util.emptyArray; - - /** - * Service uri. - * @member {string} uri - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.uri = ""; - - /** - * Service satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.satisfiesPzs = false; - - /** - * Service threatDetectionEnabled. - * @member {boolean} threatDetectionEnabled - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.threatDetectionEnabled = false; - - /** - * Service buildConfig. - * @member {google.cloud.run.v2.IBuildConfig|null|undefined} buildConfig - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.buildConfig = null; - - /** - * Service reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.reconciling = false; - - /** - * Service etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.etag = ""; - - /** - * Creates a new Service instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Service - * @static - * @param {google.cloud.run.v2.IService=} [properties] Properties to set - * @returns {google.cloud.run.v2.Service} Service instance - */ - Service.create = function create(properties) { - return new Service(properties); - }; - - /** - * Encodes the specified Service message. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Service - * @static - * @param {google.cloud.run.v2.IService} message Service message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Service.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.generation); - 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.creator); - if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.lastModifier); - if (message.client != null && Object.hasOwnProperty.call(message, "client")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.client); - if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.clientVersion); - if (message.ingress != null && Object.hasOwnProperty.call(message, "ingress")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.ingress); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); - if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) - $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.run.v2.RevisionTemplate.encode(message.template, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.traffic != null && message.traffic.length) - for (var i = 0; i < message.traffic.length; ++i) - $root.google.cloud.run.v2.TrafficTarget.encode(message.traffic[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) - $root.google.cloud.run.v2.ServiceScaling.encode(message.scaling, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.invokerIamDisabled != null && Object.hasOwnProperty.call(message, "invokerIamDisabled")) - writer.uint32(/* id 21, wireType 0 =*/168).bool(message.invokerIamDisabled); - if (message.defaultUriDisabled != null && Object.hasOwnProperty.call(message, "defaultUriDisabled")) - writer.uint32(/* id 22, wireType 0 =*/176).bool(message.defaultUriDisabled); - if (message.urls != null && message.urls.length) - for (var i = 0; i < message.urls.length; ++i) - writer.uint32(/* id 24, wireType 2 =*/194).string(message.urls[i]); - if (message.iapEnabled != null && Object.hasOwnProperty.call(message, "iapEnabled")) - writer.uint32(/* id 25, wireType 0 =*/200).bool(message.iapEnabled); - if (message.multiRegionSettings != null && Object.hasOwnProperty.call(message, "multiRegionSettings")) - $root.google.cloud.run.v2.Service.MultiRegionSettings.encode(message.multiRegionSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 30, wireType 0 =*/240).int64(message.observedGeneration); - if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) - $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.latestReadyRevision != null && Object.hasOwnProperty.call(message, "latestReadyRevision")) - writer.uint32(/* id 33, wireType 2 =*/266).string(message.latestReadyRevision); - if (message.latestCreatedRevision != null && Object.hasOwnProperty.call(message, "latestCreatedRevision")) - writer.uint32(/* id 34, wireType 2 =*/274).string(message.latestCreatedRevision); - if (message.trafficStatuses != null && message.trafficStatuses.length) - for (var i = 0; i < message.trafficStatuses.length; ++i) - $root.google.cloud.run.v2.TrafficTargetStatus.encode(message.trafficStatuses[i], writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.uri); - if (message.customAudiences != null && message.customAudiences.length) - for (var i = 0; i < message.customAudiences.length; ++i) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.customAudiences[i]); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 38, wireType 0 =*/304).bool(message.satisfiesPzs); - if (message.threatDetectionEnabled != null && Object.hasOwnProperty.call(message, "threatDetectionEnabled")) - writer.uint32(/* id 40, wireType 0 =*/320).bool(message.threatDetectionEnabled); - if (message.buildConfig != null && Object.hasOwnProperty.call(message, "buildConfig")) - $root.google.cloud.run.v2.BuildConfig.encode(message.buildConfig, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Service message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Service - * @static - * @param {google.cloud.run.v2.IService} message Service message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Service.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Service message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Service - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Service} Service - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Service.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Service(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.generation = reader.int64(); - 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.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.creator = reader.string(); - break; - } - case 12: { - message.lastModifier = reader.string(); - break; - } - case 13: { - message.client = reader.string(); - break; - } - case 14: { - message.clientVersion = reader.string(); - break; - } - case 15: { - message.ingress = reader.int32(); - break; - } - case 16: { - message.launchStage = reader.int32(); - break; - } - case 17: { - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); - break; - } - case 18: { - message.template = $root.google.cloud.run.v2.RevisionTemplate.decode(reader, reader.uint32()); - break; - } - case 19: { - if (!(message.traffic && message.traffic.length)) - message.traffic = []; - message.traffic.push($root.google.cloud.run.v2.TrafficTarget.decode(reader, reader.uint32())); - break; - } - case 20: { - message.scaling = $root.google.cloud.run.v2.ServiceScaling.decode(reader, reader.uint32()); - break; - } - case 21: { - message.invokerIamDisabled = reader.bool(); - break; - } - case 22: { - message.defaultUriDisabled = reader.bool(); - break; - } - case 24: { - if (!(message.urls && message.urls.length)) - message.urls = []; - message.urls.push(reader.string()); - break; - } - case 25: { - message.iapEnabled = reader.bool(); - break; - } - case 26: { - message.multiRegionSettings = $root.google.cloud.run.v2.Service.MultiRegionSettings.decode(reader, reader.uint32()); - break; - } - case 37: { - if (!(message.customAudiences && message.customAudiences.length)) - message.customAudiences = []; - message.customAudiences.push(reader.string()); - break; - } - case 30: { - message.observedGeneration = reader.int64(); - break; - } - case 31: { - message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); - break; - } - case 32: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 33: { - message.latestReadyRevision = reader.string(); - break; - } - case 34: { - message.latestCreatedRevision = reader.string(); - break; - } - case 35: { - if (!(message.trafficStatuses && message.trafficStatuses.length)) - message.trafficStatuses = []; - message.trafficStatuses.push($root.google.cloud.run.v2.TrafficTargetStatus.decode(reader, reader.uint32())); - break; - } - case 36: { - message.uri = reader.string(); - break; - } - case 38: { - message.satisfiesPzs = reader.bool(); - break; - } - case 40: { - message.threatDetectionEnabled = reader.bool(); - break; - } - case 41: { - message.buildConfig = $root.google.cloud.run.v2.BuildConfig.decode(reader, reader.uint32()); - break; - } - case 98: { - message.reconciling = reader.bool(); - break; - } - case 99: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Service message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Service - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Service} Service - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Service.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Service message. - * @function verify - * @memberof google.cloud.run.v2.Service - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Service.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - if (!$util.isString(message.lastModifier)) - return "lastModifier: string expected"; - if (message.client != null && message.hasOwnProperty("client")) - if (!$util.isString(message.client)) - return "client: string expected"; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - if (!$util.isString(message.clientVersion)) - return "clientVersion: string expected"; - if (message.ingress != null && message.hasOwnProperty("ingress")) - switch (message.ingress) { - default: - return "ingress: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { - var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); - if (error) - return "binaryAuthorization." + error; - } - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.run.v2.RevisionTemplate.verify(message.template); - if (error) - return "template." + error; - } - if (message.traffic != null && message.hasOwnProperty("traffic")) { - if (!Array.isArray(message.traffic)) - return "traffic: array expected"; - for (var i = 0; i < message.traffic.length; ++i) { - var error = $root.google.cloud.run.v2.TrafficTarget.verify(message.traffic[i]); - if (error) - return "traffic." + error; - } - } - if (message.scaling != null && message.hasOwnProperty("scaling")) { - var error = $root.google.cloud.run.v2.ServiceScaling.verify(message.scaling); - if (error) - return "scaling." + error; - } - if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) - if (typeof message.invokerIamDisabled !== "boolean") - return "invokerIamDisabled: boolean expected"; - if (message.defaultUriDisabled != null && message.hasOwnProperty("defaultUriDisabled")) - if (typeof message.defaultUriDisabled !== "boolean") - return "defaultUriDisabled: boolean expected"; - if (message.urls != null && message.hasOwnProperty("urls")) { - if (!Array.isArray(message.urls)) - return "urls: array expected"; - for (var i = 0; i < message.urls.length; ++i) - if (!$util.isString(message.urls[i])) - return "urls: string[] expected"; - } - if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) - if (typeof message.iapEnabled !== "boolean") - return "iapEnabled: boolean expected"; - if (message.multiRegionSettings != null && message.hasOwnProperty("multiRegionSettings")) { - var error = $root.google.cloud.run.v2.Service.MultiRegionSettings.verify(message.multiRegionSettings); - if (error) - return "multiRegionSettings." + error; - } - if (message.customAudiences != null && message.hasOwnProperty("customAudiences")) { - if (!Array.isArray(message.customAudiences)) - return "customAudiences: array expected"; - for (var i = 0; i < message.customAudiences.length; ++i) - if (!$util.isString(message.customAudiences[i])) - return "customAudiences: string[] expected"; - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { - var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); - if (error) - return "terminalCondition." + error; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) - if (!$util.isString(message.latestReadyRevision)) - return "latestReadyRevision: string expected"; - if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) - if (!$util.isString(message.latestCreatedRevision)) - return "latestCreatedRevision: string expected"; - if (message.trafficStatuses != null && message.hasOwnProperty("trafficStatuses")) { - if (!Array.isArray(message.trafficStatuses)) - return "trafficStatuses: array expected"; - for (var i = 0; i < message.trafficStatuses.length; ++i) { - var error = $root.google.cloud.run.v2.TrafficTargetStatus.verify(message.trafficStatuses[i]); - if (error) - return "trafficStatuses." + error; - } - } - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) - if (typeof message.threatDetectionEnabled !== "boolean") - return "threatDetectionEnabled: boolean expected"; - if (message.buildConfig != null && message.hasOwnProperty("buildConfig")) { - var error = $root.google.cloud.run.v2.BuildConfig.verify(message.buildConfig); - if (error) - return "buildConfig." + error; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Service message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Service - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Service} Service - */ - Service.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Service) - return object; - var message = new $root.google.cloud.run.v2.Service(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.Service.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Service.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.Service.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.run.v2.Service.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Service.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Service.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.lastModifier != null) - message.lastModifier = String(object.lastModifier); - if (object.client != null) - message.client = String(object.client); - if (object.clientVersion != null) - message.clientVersion = String(object.clientVersion); - switch (object.ingress) { - default: - if (typeof object.ingress === "number") { - message.ingress = object.ingress; - break; - } - break; - case "INGRESS_TRAFFIC_UNSPECIFIED": - case 0: - message.ingress = 0; - break; - case "INGRESS_TRAFFIC_ALL": - case 1: - message.ingress = 1; - break; - case "INGRESS_TRAFFIC_INTERNAL_ONLY": - case 2: - message.ingress = 2; - break; - case "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": - case 3: - message.ingress = 3; - break; - case "INGRESS_TRAFFIC_NONE": - case 4: - message.ingress = 4; - break; - } - 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.binaryAuthorization != null) { - if (typeof object.binaryAuthorization !== "object") - throw TypeError(".google.cloud.run.v2.Service.binaryAuthorization: object expected"); - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); - } - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.run.v2.Service.template: object expected"); - message.template = $root.google.cloud.run.v2.RevisionTemplate.fromObject(object.template); - } - if (object.traffic) { - if (!Array.isArray(object.traffic)) - throw TypeError(".google.cloud.run.v2.Service.traffic: array expected"); - message.traffic = []; - for (var i = 0; i < object.traffic.length; ++i) { - if (typeof object.traffic[i] !== "object") - throw TypeError(".google.cloud.run.v2.Service.traffic: object expected"); - message.traffic[i] = $root.google.cloud.run.v2.TrafficTarget.fromObject(object.traffic[i]); - } - } - if (object.scaling != null) { - if (typeof object.scaling !== "object") - throw TypeError(".google.cloud.run.v2.Service.scaling: object expected"); - message.scaling = $root.google.cloud.run.v2.ServiceScaling.fromObject(object.scaling); - } - if (object.invokerIamDisabled != null) - message.invokerIamDisabled = Boolean(object.invokerIamDisabled); - if (object.defaultUriDisabled != null) - message.defaultUriDisabled = Boolean(object.defaultUriDisabled); - if (object.urls) { - if (!Array.isArray(object.urls)) - throw TypeError(".google.cloud.run.v2.Service.urls: array expected"); - message.urls = []; - for (var i = 0; i < object.urls.length; ++i) - message.urls[i] = String(object.urls[i]); - } - if (object.iapEnabled != null) - message.iapEnabled = Boolean(object.iapEnabled); - if (object.multiRegionSettings != null) { - if (typeof object.multiRegionSettings !== "object") - throw TypeError(".google.cloud.run.v2.Service.multiRegionSettings: object expected"); - message.multiRegionSettings = $root.google.cloud.run.v2.Service.MultiRegionSettings.fromObject(object.multiRegionSettings); - } - if (object.customAudiences) { - if (!Array.isArray(object.customAudiences)) - throw TypeError(".google.cloud.run.v2.Service.customAudiences: array expected"); - message.customAudiences = []; - for (var i = 0; i < object.customAudiences.length; ++i) - message.customAudiences[i] = String(object.customAudiences[i]); - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.terminalCondition != null) { - if (typeof object.terminalCondition !== "object") - throw TypeError(".google.cloud.run.v2.Service.terminalCondition: object expected"); - message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Service.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Service.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.latestReadyRevision != null) - message.latestReadyRevision = String(object.latestReadyRevision); - if (object.latestCreatedRevision != null) - message.latestCreatedRevision = String(object.latestCreatedRevision); - if (object.trafficStatuses) { - if (!Array.isArray(object.trafficStatuses)) - throw TypeError(".google.cloud.run.v2.Service.trafficStatuses: array expected"); - message.trafficStatuses = []; - for (var i = 0; i < object.trafficStatuses.length; ++i) { - if (typeof object.trafficStatuses[i] !== "object") - throw TypeError(".google.cloud.run.v2.Service.trafficStatuses: object expected"); - message.trafficStatuses[i] = $root.google.cloud.run.v2.TrafficTargetStatus.fromObject(object.trafficStatuses[i]); - } - } - if (object.uri != null) - message.uri = String(object.uri); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.threatDetectionEnabled != null) - message.threatDetectionEnabled = Boolean(object.threatDetectionEnabled); - if (object.buildConfig != null) { - if (typeof object.buildConfig !== "object") - throw TypeError(".google.cloud.run.v2.Service.buildConfig: object expected"); - message.buildConfig = $root.google.cloud.run.v2.BuildConfig.fromObject(object.buildConfig); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Service message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Service - * @static - * @param {google.cloud.run.v2.Service} message Service - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Service.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.traffic = []; - object.urls = []; - object.conditions = []; - object.trafficStatuses = []; - object.customAudiences = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.description = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.creator = ""; - object.lastModifier = ""; - object.client = ""; - object.clientVersion = ""; - object.ingress = options.enums === String ? "INGRESS_TRAFFIC_UNSPECIFIED" : 0; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.binaryAuthorization = null; - object.template = null; - object.scaling = null; - object.invokerIamDisabled = false; - object.defaultUriDisabled = false; - object.iapEnabled = false; - object.multiRegionSettings = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.terminalCondition = null; - object.latestReadyRevision = ""; - object.latestCreatedRevision = ""; - object.uri = ""; - object.satisfiesPzs = false; - object.threatDetectionEnabled = false; - object.buildConfig = null; - object.reconciling = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - object.lastModifier = message.lastModifier; - if (message.client != null && message.hasOwnProperty("client")) - object.client = message.client; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - object.clientVersion = message.clientVersion; - if (message.ingress != null && message.hasOwnProperty("ingress")) - object.ingress = options.enums === String ? $root.google.cloud.run.v2.IngressTraffic[message.ingress] === undefined ? message.ingress : $root.google.cloud.run.v2.IngressTraffic[message.ingress] : message.ingress; - 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) - object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.run.v2.RevisionTemplate.toObject(message.template, options); - if (message.traffic && message.traffic.length) { - object.traffic = []; - for (var j = 0; j < message.traffic.length; ++j) - object.traffic[j] = $root.google.cloud.run.v2.TrafficTarget.toObject(message.traffic[j], options); - } - if (message.scaling != null && message.hasOwnProperty("scaling")) - object.scaling = $root.google.cloud.run.v2.ServiceScaling.toObject(message.scaling, options); - if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) - object.invokerIamDisabled = message.invokerIamDisabled; - if (message.defaultUriDisabled != null && message.hasOwnProperty("defaultUriDisabled")) - object.defaultUriDisabled = message.defaultUriDisabled; - if (message.urls && message.urls.length) { - object.urls = []; - for (var j = 0; j < message.urls.length; ++j) - object.urls[j] = message.urls[j]; - } - if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) - object.iapEnabled = message.iapEnabled; - if (message.multiRegionSettings != null && message.hasOwnProperty("multiRegionSettings")) - object.multiRegionSettings = $root.google.cloud.run.v2.Service.MultiRegionSettings.toObject(message.multiRegionSettings, options); - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) - object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) - object.latestReadyRevision = message.latestReadyRevision; - if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) - object.latestCreatedRevision = message.latestCreatedRevision; - if (message.trafficStatuses && message.trafficStatuses.length) { - object.trafficStatuses = []; - for (var j = 0; j < message.trafficStatuses.length; ++j) - object.trafficStatuses[j] = $root.google.cloud.run.v2.TrafficTargetStatus.toObject(message.trafficStatuses[j], options); - } - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.customAudiences && message.customAudiences.length) { - object.customAudiences = []; - for (var j = 0; j < message.customAudiences.length; ++j) - object.customAudiences[j] = message.customAudiences[j]; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) - object.threatDetectionEnabled = message.threatDetectionEnabled; - if (message.buildConfig != null && message.hasOwnProperty("buildConfig")) - object.buildConfig = $root.google.cloud.run.v2.BuildConfig.toObject(message.buildConfig, options); - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Service to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Service - * @instance - * @returns {Object.} JSON object - */ - Service.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Service - * @function getTypeUrl - * @memberof google.cloud.run.v2.Service - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Service.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Service"; - }; - - Service.MultiRegionSettings = (function() { - - /** - * Properties of a MultiRegionSettings. - * @memberof google.cloud.run.v2.Service - * @interface IMultiRegionSettings - * @property {Array.|null} [regions] MultiRegionSettings regions - * @property {string|null} [multiRegionId] MultiRegionSettings multiRegionId - */ - - /** - * Constructs a new MultiRegionSettings. - * @memberof google.cloud.run.v2.Service - * @classdesc Represents a MultiRegionSettings. - * @implements IMultiRegionSettings - * @constructor - * @param {google.cloud.run.v2.Service.IMultiRegionSettings=} [properties] Properties to set - */ - function MultiRegionSettings(properties) { - this.regions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MultiRegionSettings regions. - * @member {Array.} regions - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @instance - */ - MultiRegionSettings.prototype.regions = $util.emptyArray; - - /** - * MultiRegionSettings multiRegionId. - * @member {string} multiRegionId - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @instance - */ - MultiRegionSettings.prototype.multiRegionId = ""; - - /** - * Creates a new MultiRegionSettings instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {google.cloud.run.v2.Service.IMultiRegionSettings=} [properties] Properties to set - * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings instance - */ - MultiRegionSettings.create = function create(properties) { - return new MultiRegionSettings(properties); - }; - - /** - * Encodes the specified MultiRegionSettings message. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {google.cloud.run.v2.Service.IMultiRegionSettings} message MultiRegionSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiRegionSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.regions != null && message.regions.length) - for (var i = 0; i < message.regions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.regions[i]); - if (message.multiRegionId != null && Object.hasOwnProperty.call(message, "multiRegionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.multiRegionId); - return writer; - }; - - /** - * Encodes the specified MultiRegionSettings message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {google.cloud.run.v2.Service.IMultiRegionSettings} message MultiRegionSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiRegionSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MultiRegionSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiRegionSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Service.MultiRegionSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.regions && message.regions.length)) - message.regions = []; - message.regions.push(reader.string()); - break; - } - case 2: { - message.multiRegionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MultiRegionSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiRegionSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MultiRegionSettings message. - * @function verify - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MultiRegionSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.regions != null && message.hasOwnProperty("regions")) { - if (!Array.isArray(message.regions)) - return "regions: array expected"; - for (var i = 0; i < message.regions.length; ++i) - if (!$util.isString(message.regions[i])) - return "regions: string[] expected"; - } - if (message.multiRegionId != null && message.hasOwnProperty("multiRegionId")) - if (!$util.isString(message.multiRegionId)) - return "multiRegionId: string expected"; - return null; - }; - - /** - * Creates a MultiRegionSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings - */ - MultiRegionSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Service.MultiRegionSettings) - return object; - var message = new $root.google.cloud.run.v2.Service.MultiRegionSettings(); - if (object.regions) { - if (!Array.isArray(object.regions)) - throw TypeError(".google.cloud.run.v2.Service.MultiRegionSettings.regions: array expected"); - message.regions = []; - for (var i = 0; i < object.regions.length; ++i) - message.regions[i] = String(object.regions[i]); - } - if (object.multiRegionId != null) - message.multiRegionId = String(object.multiRegionId); - return message; - }; - - /** - * Creates a plain object from a MultiRegionSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {google.cloud.run.v2.Service.MultiRegionSettings} message MultiRegionSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MultiRegionSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.regions = []; - if (options.defaults) - object.multiRegionId = ""; - if (message.regions && message.regions.length) { - object.regions = []; - for (var j = 0; j < message.regions.length; ++j) - object.regions[j] = message.regions[j]; - } - if (message.multiRegionId != null && message.hasOwnProperty("multiRegionId")) - object.multiRegionId = message.multiRegionId; - return object; - }; - - /** - * Converts this MultiRegionSettings to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @instance - * @returns {Object.} JSON object - */ - MultiRegionSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MultiRegionSettings - * @function getTypeUrl - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MultiRegionSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Service.MultiRegionSettings"; - }; - - return MultiRegionSettings; - })(); - - return Service; - })(); - - v2.TrafficTarget = (function() { - - /** - * Properties of a TrafficTarget. - * @memberof google.cloud.run.v2 - * @interface ITrafficTarget - * @property {google.cloud.run.v2.TrafficTargetAllocationType|null} [type] TrafficTarget type - * @property {string|null} [revision] TrafficTarget revision - * @property {number|null} [percent] TrafficTarget percent - * @property {string|null} [tag] TrafficTarget tag - */ - - /** - * Constructs a new TrafficTarget. - * @memberof google.cloud.run.v2 - * @classdesc Represents a TrafficTarget. - * @implements ITrafficTarget - * @constructor - * @param {google.cloud.run.v2.ITrafficTarget=} [properties] Properties to set - */ - function TrafficTarget(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrafficTarget type. - * @member {google.cloud.run.v2.TrafficTargetAllocationType} type - * @memberof google.cloud.run.v2.TrafficTarget - * @instance - */ - TrafficTarget.prototype.type = 0; - - /** - * TrafficTarget revision. - * @member {string} revision - * @memberof google.cloud.run.v2.TrafficTarget - * @instance - */ - TrafficTarget.prototype.revision = ""; - - /** - * TrafficTarget percent. - * @member {number} percent - * @memberof google.cloud.run.v2.TrafficTarget - * @instance - */ - TrafficTarget.prototype.percent = 0; - - /** - * TrafficTarget tag. - * @member {string} tag - * @memberof google.cloud.run.v2.TrafficTarget - * @instance - */ - TrafficTarget.prototype.tag = ""; - - /** - * Creates a new TrafficTarget instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {google.cloud.run.v2.ITrafficTarget=} [properties] Properties to set - * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget instance - */ - TrafficTarget.create = function create(properties) { - return new TrafficTarget(properties); - }; - - /** - * Encodes the specified TrafficTarget message. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {google.cloud.run.v2.ITrafficTarget} message TrafficTarget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrafficTarget.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.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); - if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tag); - return writer; - }; - - /** - * Encodes the specified TrafficTarget message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {google.cloud.run.v2.ITrafficTarget} message TrafficTarget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrafficTarget.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrafficTarget message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrafficTarget.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TrafficTarget(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.revision = reader.string(); - break; - } - case 3: { - message.percent = reader.int32(); - break; - } - case 4: { - message.tag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrafficTarget message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrafficTarget.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrafficTarget message. - * @function verify - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrafficTarget.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.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.percent != null && message.hasOwnProperty("percent")) - if (!$util.isInteger(message.percent)) - return "percent: integer expected"; - if (message.tag != null && message.hasOwnProperty("tag")) - if (!$util.isString(message.tag)) - return "tag: string expected"; - return null; - }; - - /** - * Creates a TrafficTarget message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget - */ - TrafficTarget.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.TrafficTarget) - return object; - var message = new $root.google.cloud.run.v2.TrafficTarget(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST": - case 1: - message.type = 1; - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION": - case 2: - message.type = 2; - break; - } - if (object.revision != null) - message.revision = String(object.revision); - if (object.percent != null) - message.percent = object.percent | 0; - if (object.tag != null) - message.tag = String(object.tag); - return message; - }; - - /** - * Creates a plain object from a TrafficTarget message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {google.cloud.run.v2.TrafficTarget} message TrafficTarget - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrafficTarget.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED" : 0; - object.revision = ""; - object.percent = 0; - object.tag = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] : message.type; - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.percent != null && message.hasOwnProperty("percent")) - object.percent = message.percent; - if (message.tag != null && message.hasOwnProperty("tag")) - object.tag = message.tag; - return object; - }; - - /** - * Converts this TrafficTarget to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.TrafficTarget - * @instance - * @returns {Object.} JSON object - */ - TrafficTarget.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrafficTarget - * @function getTypeUrl - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrafficTarget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.TrafficTarget"; - }; - - return TrafficTarget; - })(); - - v2.TrafficTargetStatus = (function() { - - /** - * Properties of a TrafficTargetStatus. - * @memberof google.cloud.run.v2 - * @interface ITrafficTargetStatus - * @property {google.cloud.run.v2.TrafficTargetAllocationType|null} [type] TrafficTargetStatus type - * @property {string|null} [revision] TrafficTargetStatus revision - * @property {number|null} [percent] TrafficTargetStatus percent - * @property {string|null} [tag] TrafficTargetStatus tag - * @property {string|null} [uri] TrafficTargetStatus uri - */ - - /** - * Constructs a new TrafficTargetStatus. - * @memberof google.cloud.run.v2 - * @classdesc Represents a TrafficTargetStatus. - * @implements ITrafficTargetStatus - * @constructor - * @param {google.cloud.run.v2.ITrafficTargetStatus=} [properties] Properties to set - */ - function TrafficTargetStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrafficTargetStatus type. - * @member {google.cloud.run.v2.TrafficTargetAllocationType} type - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - */ - TrafficTargetStatus.prototype.type = 0; - - /** - * TrafficTargetStatus revision. - * @member {string} revision - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - */ - TrafficTargetStatus.prototype.revision = ""; - - /** - * TrafficTargetStatus percent. - * @member {number} percent - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - */ - TrafficTargetStatus.prototype.percent = 0; - - /** - * TrafficTargetStatus tag. - * @member {string} tag - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - */ - TrafficTargetStatus.prototype.tag = ""; - - /** - * TrafficTargetStatus uri. - * @member {string} uri - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - */ - TrafficTargetStatus.prototype.uri = ""; - - /** - * Creates a new TrafficTargetStatus instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {google.cloud.run.v2.ITrafficTargetStatus=} [properties] Properties to set - * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus instance - */ - TrafficTargetStatus.create = function create(properties) { - return new TrafficTargetStatus(properties); - }; - - /** - * Encodes the specified TrafficTargetStatus message. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {google.cloud.run.v2.ITrafficTargetStatus} message TrafficTargetStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrafficTargetStatus.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.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); - if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tag); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.uri); - return writer; - }; - - /** - * Encodes the specified TrafficTargetStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {google.cloud.run.v2.ITrafficTargetStatus} message TrafficTargetStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrafficTargetStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrafficTargetStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrafficTargetStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TrafficTargetStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.revision = reader.string(); - break; - } - case 3: { - message.percent = reader.int32(); - break; - } - case 4: { - message.tag = reader.string(); - break; - } - case 5: { - message.uri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrafficTargetStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrafficTargetStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrafficTargetStatus message. - * @function verify - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrafficTargetStatus.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.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.percent != null && message.hasOwnProperty("percent")) - if (!$util.isInteger(message.percent)) - return "percent: integer expected"; - if (message.tag != null && message.hasOwnProperty("tag")) - if (!$util.isString(message.tag)) - return "tag: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; - - /** - * Creates a TrafficTargetStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus - */ - TrafficTargetStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.TrafficTargetStatus) - return object; - var message = new $root.google.cloud.run.v2.TrafficTargetStatus(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST": - case 1: - message.type = 1; - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION": - case 2: - message.type = 2; - break; - } - if (object.revision != null) - message.revision = String(object.revision); - if (object.percent != null) - message.percent = object.percent | 0; - if (object.tag != null) - message.tag = String(object.tag); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; - - /** - * Creates a plain object from a TrafficTargetStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {google.cloud.run.v2.TrafficTargetStatus} message TrafficTargetStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrafficTargetStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED" : 0; - object.revision = ""; - object.percent = 0; - object.tag = ""; - object.uri = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] : message.type; - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.percent != null && message.hasOwnProperty("percent")) - object.percent = message.percent; - if (message.tag != null && message.hasOwnProperty("tag")) - object.tag = message.tag; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; - - /** - * Converts this TrafficTargetStatus to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - * @returns {Object.} JSON object - */ - TrafficTargetStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrafficTargetStatus - * @function getTypeUrl - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrafficTargetStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.TrafficTargetStatus"; - }; - - return TrafficTargetStatus; - })(); - - /** - * TrafficTargetAllocationType enum. - * @name google.cloud.run.v2.TrafficTargetAllocationType - * @enum {number} - * @property {number} TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED=0 TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED value - * @property {number} TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST=1 TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST value - * @property {number} TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION=2 TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION value - */ - v2.TrafficTargetAllocationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"] = 1; - values[valuesById[2] = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"] = 2; - return values; - })(); - - v2.Tasks = (function() { - - /** - * Constructs a new Tasks service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Tasks - * @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 Tasks(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Tasks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Tasks; - - /** - * Creates new Tasks service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Tasks - * @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 {Tasks} RPC service. Useful where requests and/or responses are streamed. - */ - Tasks.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Tasks|getTask}. - * @memberof google.cloud.run.v2.Tasks - * @typedef GetTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Task} [response] Task - */ - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.run.v2.Tasks - * @instance - * @param {google.cloud.run.v2.IGetTaskRequest} request GetTaskRequest message or plain object - * @param {google.cloud.run.v2.Tasks.GetTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Tasks.prototype.getTask = function getTask(request, callback) { - return this.rpcCall(getTask, $root.google.cloud.run.v2.GetTaskRequest, $root.google.cloud.run.v2.Task, request, callback); - }, "name", { value: "GetTask" }); - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.run.v2.Tasks - * @instance - * @param {google.cloud.run.v2.IGetTaskRequest} request GetTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Tasks|listTasks}. - * @memberof google.cloud.run.v2.Tasks - * @typedef ListTasksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListTasksResponse} [response] ListTasksResponse - */ - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.run.v2.Tasks - * @instance - * @param {google.cloud.run.v2.IListTasksRequest} request ListTasksRequest message or plain object - * @param {google.cloud.run.v2.Tasks.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Tasks.prototype.listTasks = function listTasks(request, callback) { - return this.rpcCall(listTasks, $root.google.cloud.run.v2.ListTasksRequest, $root.google.cloud.run.v2.ListTasksResponse, request, callback); - }, "name", { value: "ListTasks" }); - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.run.v2.Tasks - * @instance - * @param {google.cloud.run.v2.IListTasksRequest} request ListTasksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Tasks; - })(); - - v2.GetTaskRequest = (function() { - - /** - * Properties of a GetTaskRequest. - * @memberof google.cloud.run.v2 - * @interface IGetTaskRequest - * @property {string|null} [name] GetTaskRequest name - */ - - /** - * Constructs a new GetTaskRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetTaskRequest. - * @implements IGetTaskRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.name = ""; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetTaskRequest - * @static - * @param {google.cloud.run.v2.IGetTaskRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetTaskRequest} GetTaskRequest instance - */ - GetTaskRequest.create = function create(properties) { - return new GetTaskRequest(properties); - }; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.run.v2.GetTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetTaskRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.GetTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetTaskRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.GetTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetTaskRequest} GetTaskRequest - */ - GetTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetTaskRequest) - return object; - var message = new $root.google.cloud.run.v2.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.run.v2.GetTaskRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.GetTaskRequest"; - }; - - return GetTaskRequest; - })(); - - v2.ListTasksRequest = (function() { - - /** - * Properties of a ListTasksRequest. - * @memberof google.cloud.run.v2 - * @interface IListTasksRequest - * @property {string|null} [parent] ListTasksRequest parent - * @property {number|null} [pageSize] ListTasksRequest pageSize - * @property {string|null} [pageToken] ListTasksRequest pageToken - * @property {boolean|null} [showDeleted] ListTasksRequest showDeleted - */ - - /** - * Constructs a new ListTasksRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListTasksRequest. - * @implements IListTasksRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.parent = ""; - - /** - * ListTasksRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageSize = 0; - - /** - * ListTasksRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageToken = ""; - - /** - * ListTasksRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.showDeleted = false; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListTasksRequest - * @static - * @param {google.cloud.run.v2.IListTasksRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListTasksRequest} ListTasksRequest instance - */ - ListTasksRequest.create = function create(properties) { - return new ListTasksRequest(properties); - }; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.run.v2.ListTasksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListTasksRequest - * @static - * @param {google.cloud.run.v2.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.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListTasksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListTasksRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListTasksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - 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.run.v2.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListTasksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListTasksRequest} ListTasksRequest - */ - ListTasksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListTasksRequest) - return object; - var message = new $root.google.cloud.run.v2.ListTasksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListTasksRequest - * @static - * @param {google.cloud.run.v2.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.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListTasksRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListTasksRequest"; - }; - - return ListTasksRequest; - })(); - - v2.ListTasksResponse = (function() { - - /** - * Properties of a ListTasksResponse. - * @memberof google.cloud.run.v2 - * @interface IListTasksResponse - * @property {Array.|null} [tasks] ListTasksResponse tasks - * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken - */ - - /** - * Constructs a new ListTasksResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListTasksResponse. - * @implements IListTasksResponse - * @constructor - * @param {google.cloud.run.v2.IListTasksResponse=} [properties] Properties to set - */ - function ListTasksResponse(properties) { - this.tasks = []; - if (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.run.v2.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.tasks = $util.emptyArray; - - /** - * ListTasksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListTasksResponse - * @static - * @param {google.cloud.run.v2.IListTasksResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListTasksResponse} ListTasksResponse instance - */ - ListTasksResponse.create = function create(properties) { - return new ListTasksResponse(properties); - }; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.run.v2.ListTasksResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListTasksResponse - * @static - * @param {google.cloud.run.v2.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.run.v2.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); - return writer; - }; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListTasksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListTasksResponse - * @static - * @param {google.cloud.run.v2.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.run.v2.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListTasksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.tasks && message.tasks.length)) - message.tasks = []; - message.tasks.push($root.google.cloud.run.v2.Task.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = 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.run.v2.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.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"; - return null; - }; - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListTasksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListTasksResponse} ListTasksResponse - */ - ListTasksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListTasksResponse) - return object; - var message = new $root.google.cloud.run.v2.ListTasksResponse(); - if (object.tasks) { - if (!Array.isArray(object.tasks)) - throw TypeError(".google.cloud.run.v2.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.run.v2.ListTasksResponse.tasks: object expected"); - message.tasks[i] = $root.google.cloud.run.v2.Task.fromObject(object.tasks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListTasksResponse - * @static - * @param {google.cloud.run.v2.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 = []; - 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.run.v2.Task.toObject(message.tasks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListTasksResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListTasksResponse"; - }; - - return ListTasksResponse; - })(); - - v2.Task = (function() { - - /** - * Properties of a Task. - * @memberof google.cloud.run.v2 - * @interface ITask - * @property {string|null} [name] Task name - * @property {string|null} [uid] Task uid - * @property {number|Long|null} [generation] Task generation - * @property {Object.|null} [labels] Task labels - * @property {Object.|null} [annotations] Task annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Task createTime - * @property {google.protobuf.ITimestamp|null} [scheduledTime] Task scheduledTime - * @property {google.protobuf.ITimestamp|null} [startTime] Task startTime - * @property {google.protobuf.ITimestamp|null} [completionTime] Task completionTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Task updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Task deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Task expireTime - * @property {string|null} [job] Task job - * @property {string|null} [execution] Task execution - * @property {Array.|null} [containers] Task containers - * @property {Array.|null} [volumes] Task volumes - * @property {number|null} [maxRetries] Task maxRetries - * @property {google.protobuf.IDuration|null} [timeout] Task timeout - * @property {string|null} [serviceAccount] Task serviceAccount - * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] Task executionEnvironment - * @property {boolean|null} [reconciling] Task reconciling - * @property {Array.|null} [conditions] Task conditions - * @property {number|Long|null} [observedGeneration] Task observedGeneration - * @property {number|null} [index] Task index - * @property {number|null} [retried] Task retried - * @property {google.cloud.run.v2.ITaskAttemptResult|null} [lastAttemptResult] Task lastAttemptResult - * @property {string|null} [encryptionKey] Task encryptionKey - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Task vpcAccess - * @property {string|null} [logUri] Task logUri - * @property {boolean|null} [satisfiesPzs] Task satisfiesPzs - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Task nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] Task gpuZonalRedundancyDisabled - * @property {string|null} [etag] Task etag - */ - - /** - * Constructs a new Task. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Task. - * @implements ITask - * @constructor - * @param {google.cloud.run.v2.ITask=} [properties] Properties to set - */ - function Task(properties) { - this.labels = {}; - this.annotations = {}; - this.containers = []; - this.volumes = []; - this.conditions = []; - if (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.run.v2.Task - * @instance - */ - Task.prototype.name = ""; - - /** - * Task uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.uid = ""; - - /** - * Task generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Task labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.labels = $util.emptyObject; - - /** - * Task annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.annotations = $util.emptyObject; - - /** - * Task createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.createTime = null; - - /** - * Task scheduledTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduledTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.scheduledTime = null; - - /** - * Task startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.startTime = null; - - /** - * Task completionTime. - * @member {google.protobuf.ITimestamp|null|undefined} completionTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.completionTime = null; - - /** - * Task updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.updateTime = null; - - /** - * Task deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.deleteTime = null; - - /** - * Task expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.expireTime = null; - - /** - * Task job. - * @member {string} job - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.job = ""; - - /** - * Task execution. - * @member {string} execution - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.execution = ""; - - /** - * Task containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.containers = $util.emptyArray; - - /** - * Task volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.volumes = $util.emptyArray; - - /** - * Task maxRetries. - * @member {number} maxRetries - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.maxRetries = 0; - - /** - * Task timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.timeout = null; - - /** - * Task serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.serviceAccount = ""; - - /** - * Task executionEnvironment. - * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.executionEnvironment = 0; - - /** - * Task reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.reconciling = false; - - /** - * Task conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.conditions = $util.emptyArray; - - /** - * Task observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Task index. - * @member {number} index - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.index = 0; - - /** - * Task retried. - * @member {number} retried - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.retried = 0; - - /** - * Task lastAttemptResult. - * @member {google.cloud.run.v2.ITaskAttemptResult|null|undefined} lastAttemptResult - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.lastAttemptResult = null; - - /** - * Task encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.encryptionKey = ""; - - /** - * Task vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.vpcAccess = null; - - /** - * Task logUri. - * @member {string} logUri - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.logUri = ""; - - /** - * Task satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.satisfiesPzs = false; - - /** - * Task nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.nodeSelector = null; - - /** - * Task gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.gpuZonalRedundancyDisabled = null; - - /** - * Task etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Task.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Task instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Task - * @static - * @param {google.cloud.run.v2.ITask=} [properties] Properties to set - * @returns {google.cloud.run.v2.Task} Task instance - */ - Task.create = function create(properties) { - return new Task(properties); - }; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.run.v2.Task.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Task - * @static - * @param {google.cloud.run.v2.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.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) - $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.job); - if (message.execution != null && Object.hasOwnProperty.call(message, "execution")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.execution); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.maxRetries != null && Object.hasOwnProperty.call(message, "maxRetries")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.maxRetries); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.serviceAccount); - if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.executionEnvironment); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 21, wireType 0 =*/168).bool(message.reconciling); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 23, wireType 0 =*/184).int64(message.observedGeneration); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.index); - if (message.retried != null && Object.hasOwnProperty.call(message, "retried")) - writer.uint32(/* id 25, wireType 0 =*/200).int32(message.retried); - if (message.lastAttemptResult != null && Object.hasOwnProperty.call(message, "lastAttemptResult")) - $root.google.cloud.run.v2.TaskAttemptResult.encode(message.lastAttemptResult, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.encryptionKey); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) - writer.uint32(/* id 32, wireType 2 =*/258).string(message.logUri); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.satisfiesPzs); - if (message.scheduledTime != null && Object.hasOwnProperty.call(message, "scheduledTime")) - $root.google.protobuf.Timestamp.encode(message.scheduledTime, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 37, wireType 0 =*/296).bool(message.gpuZonalRedundancyDisabled); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.run.v2.Task.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Task - * @static - * @param {google.cloud.run.v2.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.run.v2.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Task(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 5: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 34: { - message.scheduledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 27: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.job = reader.string(); - break; - } - case 13: { - message.execution = reader.string(); - break; - } - case 14: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 15: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 16: { - message.maxRetries = reader.int32(); - break; - } - case 17: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 18: { - message.serviceAccount = reader.string(); - break; - } - case 20: { - message.executionEnvironment = reader.int32(); - break; - } - case 21: { - message.reconciling = reader.bool(); - break; - } - case 22: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 23: { - message.observedGeneration = reader.int64(); - break; - } - case 24: { - message.index = reader.int32(); - break; - } - case 25: { - message.retried = reader.int32(); - break; - } - case 26: { - message.lastAttemptResult = $root.google.cloud.run.v2.TaskAttemptResult.decode(reader, reader.uint32()); - break; - } - case 28: { - message.encryptionKey = reader.string(); - break; - } - case 29: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 32: { - message.logUri = reader.string(); - break; - } - case 33: { - message.satisfiesPzs = reader.bool(); - break; - } - case 36: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 37: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - case 99: { - message.etag = reader.string(); - 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.run.v2.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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"; - var properties = {}; - 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.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.scheduledTime != null && message.hasOwnProperty("scheduledTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduledTime); - if (error) - return "scheduledTime." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.completionTime != null && message.hasOwnProperty("completionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.completionTime); - if (error) - return "completionTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.job != null && message.hasOwnProperty("job")) - if (!$util.isString(message.job)) - return "job: string expected"; - if (message.execution != null && message.hasOwnProperty("execution")) - if (!$util.isString(message.execution)) - return "execution: string expected"; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) - if (!$util.isInteger(message.maxRetries)) - return "maxRetries: integer expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - switch (message.executionEnvironment) { - default: - return "executionEnvironment: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.retried != null && message.hasOwnProperty("retried")) - if (!$util.isInteger(message.retried)) - return "retried: integer expected"; - if (message.lastAttemptResult != null && message.hasOwnProperty("lastAttemptResult")) { - var error = $root.google.cloud.run.v2.TaskAttemptResult.verify(message.lastAttemptResult); - if (error) - return "lastAttemptResult." + error; - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.logUri != null && message.hasOwnProperty("logUri")) - if (!$util.isString(message.logUri)) - return "logUri: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Task - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Task} Task - */ - Task.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Task) - return object; - var message = new $root.google.cloud.run.v2.Task(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.Task.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Task.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.scheduledTime != null) { - if (typeof object.scheduledTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.scheduledTime: object expected"); - message.scheduledTime = $root.google.protobuf.Timestamp.fromObject(object.scheduledTime); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.completionTime != null) { - if (typeof object.completionTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.completionTime: object expected"); - message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.job != null) - message.job = String(object.job); - if (object.execution != null) - message.execution = String(object.execution); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.Task.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.Task.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.Task.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.Task.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - if (object.maxRetries != null) - message.maxRetries = object.maxRetries | 0; - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.run.v2.Task.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - switch (object.executionEnvironment) { - default: - if (typeof object.executionEnvironment === "number") { - message.executionEnvironment = object.executionEnvironment; - break; - } - break; - case "EXECUTION_ENVIRONMENT_UNSPECIFIED": - case 0: - message.executionEnvironment = 0; - break; - case "EXECUTION_ENVIRONMENT_GEN1": - case 1: - message.executionEnvironment = 1; - break; - case "EXECUTION_ENVIRONMENT_GEN2": - case 2: - message.executionEnvironment = 2; - break; - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Task.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Task.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.index != null) - message.index = object.index | 0; - if (object.retried != null) - message.retried = object.retried | 0; - if (object.lastAttemptResult != null) { - if (typeof object.lastAttemptResult !== "object") - throw TypeError(".google.cloud.run.v2.Task.lastAttemptResult: object expected"); - message.lastAttemptResult = $root.google.cloud.run.v2.TaskAttemptResult.fromObject(object.lastAttemptResult); - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.Task.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.logUri != null) - message.logUri = String(object.logUri); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.Task.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Task - * @static - * @param {google.cloud.run.v2.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.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - object.conditions = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.completionTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.job = ""; - object.execution = ""; - object.maxRetries = 0; - object.timeout = null; - object.serviceAccount = ""; - object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; - object.reconciling = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.index = 0; - object.retried = 0; - object.lastAttemptResult = null; - object.startTime = null; - object.encryptionKey = ""; - object.vpcAccess = null; - object.logUri = ""; - object.satisfiesPzs = false; - object.scheduledTime = null; - object.nodeSelector = null; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.completionTime != null && message.hasOwnProperty("completionTime")) - object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.job != null && message.hasOwnProperty("job")) - object.job = message.job; - if (message.execution != null && message.hasOwnProperty("execution")) - object.execution = message.execution; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) - object.maxRetries = message.maxRetries; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.retried != null && message.hasOwnProperty("retried")) - object.retried = message.retried; - if (message.lastAttemptResult != null && message.hasOwnProperty("lastAttemptResult")) - object.lastAttemptResult = $root.google.cloud.run.v2.TaskAttemptResult.toObject(message.lastAttemptResult, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.logUri != null && message.hasOwnProperty("logUri")) - object.logUri = message.logUri; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.scheduledTime != null && message.hasOwnProperty("scheduledTime")) - object.scheduledTime = $root.google.protobuf.Timestamp.toObject(message.scheduledTime, options); - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Task to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Task"; - }; - - return Task; - })(); - - v2.TaskAttemptResult = (function() { - - /** - * Properties of a TaskAttemptResult. - * @memberof google.cloud.run.v2 - * @interface ITaskAttemptResult - * @property {google.rpc.IStatus|null} [status] TaskAttemptResult status - * @property {number|null} [exitCode] TaskAttemptResult exitCode - * @property {number|null} [termSignal] TaskAttemptResult termSignal - */ - - /** - * Constructs a new TaskAttemptResult. - * @memberof google.cloud.run.v2 - * @classdesc Represents a TaskAttemptResult. - * @implements ITaskAttemptResult - * @constructor - * @param {google.cloud.run.v2.ITaskAttemptResult=} [properties] Properties to set - */ - function TaskAttemptResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskAttemptResult status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.cloud.run.v2.TaskAttemptResult - * @instance - */ - TaskAttemptResult.prototype.status = null; - - /** - * TaskAttemptResult exitCode. - * @member {number} exitCode - * @memberof google.cloud.run.v2.TaskAttemptResult - * @instance - */ - TaskAttemptResult.prototype.exitCode = 0; - - /** - * TaskAttemptResult termSignal. - * @member {number} termSignal - * @memberof google.cloud.run.v2.TaskAttemptResult - * @instance - */ - TaskAttemptResult.prototype.termSignal = 0; - - /** - * Creates a new TaskAttemptResult instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {google.cloud.run.v2.ITaskAttemptResult=} [properties] Properties to set - * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult instance - */ - TaskAttemptResult.create = function create(properties) { - return new TaskAttemptResult(properties); - }; - - /** - * Encodes the specified TaskAttemptResult message. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {google.cloud.run.v2.ITaskAttemptResult} message TaskAttemptResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskAttemptResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.exitCode); - if (message.termSignal != null && Object.hasOwnProperty.call(message, "termSignal")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.termSignal); - return writer; - }; - - /** - * Encodes the specified TaskAttemptResult message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {google.cloud.run.v2.ITaskAttemptResult} message TaskAttemptResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskAttemptResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskAttemptResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskAttemptResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TaskAttemptResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 2: { - message.exitCode = reader.int32(); - break; - } - case 3: { - message.termSignal = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskAttemptResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskAttemptResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskAttemptResult message. - * @function verify - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskAttemptResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - if (!$util.isInteger(message.exitCode)) - return "exitCode: integer expected"; - if (message.termSignal != null && message.hasOwnProperty("termSignal")) - if (!$util.isInteger(message.termSignal)) - return "termSignal: integer expected"; - return null; - }; - - /** - * Creates a TaskAttemptResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult - */ - TaskAttemptResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.TaskAttemptResult) - return object; - var message = new $root.google.cloud.run.v2.TaskAttemptResult(); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.run.v2.TaskAttemptResult.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.exitCode != null) - message.exitCode = object.exitCode | 0; - if (object.termSignal != null) - message.termSignal = object.termSignal | 0; - return message; - }; - - /** - * Creates a plain object from a TaskAttemptResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {google.cloud.run.v2.TaskAttemptResult} message TaskAttemptResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskAttemptResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.status = null; - object.exitCode = 0; - object.termSignal = 0; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - object.exitCode = message.exitCode; - if (message.termSignal != null && message.hasOwnProperty("termSignal")) - object.termSignal = message.termSignal; - return object; - }; - - /** - * Converts this TaskAttemptResult to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.TaskAttemptResult - * @instance - * @returns {Object.} JSON object - */ - TaskAttemptResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskAttemptResult - * @function getTypeUrl - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskAttemptResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.TaskAttemptResult"; - }; - - return TaskAttemptResult; - })(); - - v2.WorkerPools = (function() { - - /** - * Constructs a new WorkerPools service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a WorkerPools - * @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 WorkerPools(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (WorkerPools.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WorkerPools; - - /** - * Creates new WorkerPools service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.WorkerPools - * @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 {WorkerPools} RPC service. Useful where requests and/or responses are streamed. - */ - WorkerPools.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|createWorkerPool}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef CreateWorkerPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateWorkerPool. - * @function createWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} request CreateWorkerPoolRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.CreateWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.createWorkerPool = function createWorkerPool(request, callback) { - return this.rpcCall(createWorkerPool, $root.google.cloud.run.v2.CreateWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateWorkerPool" }); - - /** - * Calls CreateWorkerPool. - * @function createWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} request CreateWorkerPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|getWorkerPool}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef GetWorkerPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.WorkerPool} [response] WorkerPool - */ - - /** - * Calls GetWorkerPool. - * @function getWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IGetWorkerPoolRequest} request GetWorkerPoolRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.GetWorkerPoolCallback} callback Node-style callback called with the error, if any, and WorkerPool - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.getWorkerPool = function getWorkerPool(request, callback) { - return this.rpcCall(getWorkerPool, $root.google.cloud.run.v2.GetWorkerPoolRequest, $root.google.cloud.run.v2.WorkerPool, request, callback); - }, "name", { value: "GetWorkerPool" }); - - /** - * Calls GetWorkerPool. - * @function getWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IGetWorkerPoolRequest} request GetWorkerPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|listWorkerPools}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef ListWorkerPoolsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListWorkerPoolsResponse} [response] ListWorkerPoolsResponse - */ - - /** - * Calls ListWorkerPools. - * @function listWorkerPools - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IListWorkerPoolsRequest} request ListWorkerPoolsRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.ListWorkerPoolsCallback} callback Node-style callback called with the error, if any, and ListWorkerPoolsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.listWorkerPools = function listWorkerPools(request, callback) { - return this.rpcCall(listWorkerPools, $root.google.cloud.run.v2.ListWorkerPoolsRequest, $root.google.cloud.run.v2.ListWorkerPoolsResponse, request, callback); - }, "name", { value: "ListWorkerPools" }); - - /** - * Calls ListWorkerPools. - * @function listWorkerPools - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IListWorkerPoolsRequest} request ListWorkerPoolsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|updateWorkerPool}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef UpdateWorkerPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateWorkerPool. - * @function updateWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} request UpdateWorkerPoolRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.UpdateWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.updateWorkerPool = function updateWorkerPool(request, callback) { - return this.rpcCall(updateWorkerPool, $root.google.cloud.run.v2.UpdateWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateWorkerPool" }); - - /** - * Calls UpdateWorkerPool. - * @function updateWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} request UpdateWorkerPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|deleteWorkerPool}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef DeleteWorkerPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteWorkerPool. - * @function deleteWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} request DeleteWorkerPoolRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.DeleteWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.deleteWorkerPool = function deleteWorkerPool(request, callback) { - return this.rpcCall(deleteWorkerPool, $root.google.cloud.run.v2.DeleteWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteWorkerPool" }); - - /** - * Calls DeleteWorkerPool. - * @function deleteWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} request DeleteWorkerPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|getIamPolicy}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|setIamPolicy}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|testIamPermissions}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return WorkerPools; - })(); - - v2.CreateWorkerPoolRequest = (function() { - - /** - * Properties of a CreateWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @interface ICreateWorkerPoolRequest - * @property {string|null} [parent] CreateWorkerPoolRequest parent - * @property {google.cloud.run.v2.IWorkerPool|null} [workerPool] CreateWorkerPoolRequest workerPool - * @property {string|null} [workerPoolId] CreateWorkerPoolRequest workerPoolId - * @property {boolean|null} [validateOnly] CreateWorkerPoolRequest validateOnly - */ - - /** - * Constructs a new CreateWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CreateWorkerPoolRequest. - * @implements ICreateWorkerPoolRequest - * @constructor - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest=} [properties] Properties to set - */ - function CreateWorkerPoolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateWorkerPoolRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @instance - */ - CreateWorkerPoolRequest.prototype.parent = ""; - - /** - * CreateWorkerPoolRequest workerPool. - * @member {google.cloud.run.v2.IWorkerPool|null|undefined} workerPool - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @instance - */ - CreateWorkerPoolRequest.prototype.workerPool = null; - - /** - * CreateWorkerPoolRequest workerPoolId. - * @member {string} workerPoolId - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @instance - */ - CreateWorkerPoolRequest.prototype.workerPoolId = ""; - - /** - * CreateWorkerPoolRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @instance - */ - CreateWorkerPoolRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateWorkerPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest instance - */ - CreateWorkerPoolRequest.create = function create(properties) { - return new CreateWorkerPoolRequest(properties); - }; - - /** - * Encodes the specified CreateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateWorkerPoolRequest.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.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - $root.google.cloud.run.v2.WorkerPool.encode(message.workerPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.workerPoolId != null && Object.hasOwnProperty.call(message, "workerPoolId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.workerPoolId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateWorkerPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateWorkerPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.workerPool = $root.google.cloud.run.v2.WorkerPool.decode(reader, reader.uint32()); - break; - } - case 3: { - message.workerPoolId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateWorkerPoolRequest message. - * @function verify - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateWorkerPoolRequest.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.workerPool != null && message.hasOwnProperty("workerPool")) { - var error = $root.google.cloud.run.v2.WorkerPool.verify(message.workerPool); - if (error) - return "workerPool." + error; - } - if (message.workerPoolId != null && message.hasOwnProperty("workerPoolId")) - if (!$util.isString(message.workerPoolId)) - return "workerPoolId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest - */ - CreateWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CreateWorkerPoolRequest) - return object; - var message = new $root.google.cloud.run.v2.CreateWorkerPoolRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.workerPool != null) { - if (typeof object.workerPool !== "object") - throw TypeError(".google.cloud.run.v2.CreateWorkerPoolRequest.workerPool: object expected"); - message.workerPool = $root.google.cloud.run.v2.WorkerPool.fromObject(object.workerPool); - } - if (object.workerPoolId != null) - message.workerPoolId = String(object.workerPoolId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateWorkerPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.CreateWorkerPoolRequest} message CreateWorkerPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateWorkerPoolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.workerPool = null; - object.workerPoolId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - object.workerPool = $root.google.cloud.run.v2.WorkerPool.toObject(message.workerPool, options); - if (message.workerPoolId != null && message.hasOwnProperty("workerPoolId")) - object.workerPoolId = message.workerPoolId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateWorkerPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @instance - * @returns {Object.} JSON object - */ - CreateWorkerPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateWorkerPoolRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.CreateWorkerPoolRequest"; - }; - - return CreateWorkerPoolRequest; - })(); - - v2.UpdateWorkerPoolRequest = (function() { - - /** - * Properties of an UpdateWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @interface IUpdateWorkerPoolRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkerPoolRequest updateMask - * @property {google.cloud.run.v2.IWorkerPool|null} [workerPool] UpdateWorkerPoolRequest workerPool - * @property {boolean|null} [validateOnly] UpdateWorkerPoolRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateWorkerPoolRequest allowMissing - * @property {boolean|null} [forceNewRevision] UpdateWorkerPoolRequest forceNewRevision - */ - - /** - * Constructs a new UpdateWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents an UpdateWorkerPoolRequest. - * @implements IUpdateWorkerPoolRequest - * @constructor - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest=} [properties] Properties to set - */ - function UpdateWorkerPoolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateWorkerPoolRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - */ - UpdateWorkerPoolRequest.prototype.updateMask = null; - - /** - * UpdateWorkerPoolRequest workerPool. - * @member {google.cloud.run.v2.IWorkerPool|null|undefined} workerPool - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - */ - UpdateWorkerPoolRequest.prototype.workerPool = null; - - /** - * UpdateWorkerPoolRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - */ - UpdateWorkerPoolRequest.prototype.validateOnly = false; - - /** - * UpdateWorkerPoolRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - */ - UpdateWorkerPoolRequest.prototype.allowMissing = false; - - /** - * UpdateWorkerPoolRequest forceNewRevision. - * @member {boolean} forceNewRevision - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - */ - UpdateWorkerPoolRequest.prototype.forceNewRevision = false; - - /** - * Creates a new UpdateWorkerPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest instance - */ - UpdateWorkerPoolRequest.create = function create(properties) { - return new UpdateWorkerPoolRequest(properties); - }; - - /** - * Encodes the specified UpdateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateWorkerPoolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - $root.google.cloud.run.v2.WorkerPool.encode(message.workerPool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); - if (message.forceNewRevision != null && Object.hasOwnProperty.call(message, "forceNewRevision")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.forceNewRevision); - return writer; - }; - - /** - * Encodes the specified UpdateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateWorkerPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.UpdateWorkerPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 1: { - message.workerPool = $root.google.cloud.run.v2.WorkerPool.decode(reader, reader.uint32()); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.allowMissing = reader.bool(); - break; - } - case 5: { - message.forceNewRevision = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateWorkerPoolRequest message. - * @function verify - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateWorkerPoolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.workerPool != null && message.hasOwnProperty("workerPool")) { - var error = $root.google.cloud.run.v2.WorkerPool.verify(message.workerPool); - if (error) - return "workerPool." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - if (message.forceNewRevision != null && message.hasOwnProperty("forceNewRevision")) - if (typeof message.forceNewRevision !== "boolean") - return "forceNewRevision: boolean expected"; - return null; - }; - - /** - * Creates an UpdateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest - */ - UpdateWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.UpdateWorkerPoolRequest) - return object; - var message = new $root.google.cloud.run.v2.UpdateWorkerPoolRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.run.v2.UpdateWorkerPoolRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.workerPool != null) { - if (typeof object.workerPool !== "object") - throw TypeError(".google.cloud.run.v2.UpdateWorkerPoolRequest.workerPool: object expected"); - message.workerPool = $root.google.cloud.run.v2.WorkerPool.fromObject(object.workerPool); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - if (object.forceNewRevision != null) - message.forceNewRevision = Boolean(object.forceNewRevision); - return message; - }; - - /** - * Creates a plain object from an UpdateWorkerPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.UpdateWorkerPoolRequest} message UpdateWorkerPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateWorkerPoolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.workerPool = null; - object.updateMask = null; - object.validateOnly = false; - object.allowMissing = false; - object.forceNewRevision = false; - } - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - object.workerPool = $root.google.cloud.run.v2.WorkerPool.toObject(message.workerPool, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - if (message.forceNewRevision != null && message.hasOwnProperty("forceNewRevision")) - object.forceNewRevision = message.forceNewRevision; - return object; - }; - - /** - * Converts this UpdateWorkerPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateWorkerPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateWorkerPoolRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.UpdateWorkerPoolRequest"; - }; - - return UpdateWorkerPoolRequest; - })(); - - v2.ListWorkerPoolsRequest = (function() { - - /** - * Properties of a ListWorkerPoolsRequest. - * @memberof google.cloud.run.v2 - * @interface IListWorkerPoolsRequest - * @property {string|null} [parent] ListWorkerPoolsRequest parent - * @property {number|null} [pageSize] ListWorkerPoolsRequest pageSize - * @property {string|null} [pageToken] ListWorkerPoolsRequest pageToken - * @property {boolean|null} [showDeleted] ListWorkerPoolsRequest showDeleted - */ - - /** - * Constructs a new ListWorkerPoolsRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListWorkerPoolsRequest. - * @implements IListWorkerPoolsRequest - * @constructor - * @param {google.cloud.run.v2.IListWorkerPoolsRequest=} [properties] Properties to set - */ - function ListWorkerPoolsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListWorkerPoolsRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @instance - */ - ListWorkerPoolsRequest.prototype.parent = ""; - - /** - * ListWorkerPoolsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @instance - */ - ListWorkerPoolsRequest.prototype.pageSize = 0; - - /** - * ListWorkerPoolsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @instance - */ - ListWorkerPoolsRequest.prototype.pageToken = ""; - - /** - * ListWorkerPoolsRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @instance - */ - ListWorkerPoolsRequest.prototype.showDeleted = false; - - /** - * Creates a new ListWorkerPoolsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest instance - */ - ListWorkerPoolsRequest.create = function create(properties) { - return new ListWorkerPoolsRequest(properties); - }; - - /** - * Encodes the specified ListWorkerPoolsRequest message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkerPoolsRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListWorkerPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkerPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkerPoolsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListWorkerPoolsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkerPoolsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListWorkerPoolsRequest message. - * @function verify - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListWorkerPoolsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListWorkerPoolsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest - */ - ListWorkerPoolsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListWorkerPoolsRequest) - return object; - var message = new $root.google.cloud.run.v2.ListWorkerPoolsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListWorkerPoolsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {google.cloud.run.v2.ListWorkerPoolsRequest} message ListWorkerPoolsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListWorkerPoolsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListWorkerPoolsRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @instance - * @returns {Object.} JSON object - */ - ListWorkerPoolsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListWorkerPoolsRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListWorkerPoolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListWorkerPoolsRequest"; - }; - - return ListWorkerPoolsRequest; - })(); - - v2.ListWorkerPoolsResponse = (function() { - - /** - * Properties of a ListWorkerPoolsResponse. - * @memberof google.cloud.run.v2 - * @interface IListWorkerPoolsResponse - * @property {Array.|null} [workerPools] ListWorkerPoolsResponse workerPools - * @property {string|null} [nextPageToken] ListWorkerPoolsResponse nextPageToken - */ - - /** - * Constructs a new ListWorkerPoolsResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListWorkerPoolsResponse. - * @implements IListWorkerPoolsResponse - * @constructor - * @param {google.cloud.run.v2.IListWorkerPoolsResponse=} [properties] Properties to set - */ - function ListWorkerPoolsResponse(properties) { - this.workerPools = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListWorkerPoolsResponse workerPools. - * @member {Array.} workerPools - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @instance - */ - ListWorkerPoolsResponse.prototype.workerPools = $util.emptyArray; - - /** - * ListWorkerPoolsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @instance - */ - ListWorkerPoolsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListWorkerPoolsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse instance - */ - ListWorkerPoolsResponse.create = function create(properties) { - return new ListWorkerPoolsResponse(properties); - }; - - /** - * Encodes the specified ListWorkerPoolsResponse message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkerPoolsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.workerPools != null && message.workerPools.length) - for (var i = 0; i < message.workerPools.length; ++i) - $root.google.cloud.run.v2.WorkerPool.encode(message.workerPools[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 ListWorkerPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkerPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkerPoolsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListWorkerPoolsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.workerPools && message.workerPools.length)) - message.workerPools = []; - message.workerPools.push($root.google.cloud.run.v2.WorkerPool.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkerPoolsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListWorkerPoolsResponse message. - * @function verify - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListWorkerPoolsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.workerPools != null && message.hasOwnProperty("workerPools")) { - if (!Array.isArray(message.workerPools)) - return "workerPools: array expected"; - for (var i = 0; i < message.workerPools.length; ++i) { - var error = $root.google.cloud.run.v2.WorkerPool.verify(message.workerPools[i]); - if (error) - return "workerPools." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListWorkerPoolsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse - */ - ListWorkerPoolsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListWorkerPoolsResponse) - return object; - var message = new $root.google.cloud.run.v2.ListWorkerPoolsResponse(); - if (object.workerPools) { - if (!Array.isArray(object.workerPools)) - throw TypeError(".google.cloud.run.v2.ListWorkerPoolsResponse.workerPools: array expected"); - message.workerPools = []; - for (var i = 0; i < object.workerPools.length; ++i) { - if (typeof object.workerPools[i] !== "object") - throw TypeError(".google.cloud.run.v2.ListWorkerPoolsResponse.workerPools: object expected"); - message.workerPools[i] = $root.google.cloud.run.v2.WorkerPool.fromObject(object.workerPools[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListWorkerPoolsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {google.cloud.run.v2.ListWorkerPoolsResponse} message ListWorkerPoolsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListWorkerPoolsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.workerPools = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.workerPools && message.workerPools.length) { - object.workerPools = []; - for (var j = 0; j < message.workerPools.length; ++j) - object.workerPools[j] = $root.google.cloud.run.v2.WorkerPool.toObject(message.workerPools[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListWorkerPoolsResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @instance - * @returns {Object.} JSON object - */ - ListWorkerPoolsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListWorkerPoolsResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListWorkerPoolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListWorkerPoolsResponse"; - }; - - return ListWorkerPoolsResponse; - })(); - - v2.GetWorkerPoolRequest = (function() { - - /** - * Properties of a GetWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @interface IGetWorkerPoolRequest - * @property {string|null} [name] GetWorkerPoolRequest name - */ - - /** - * Constructs a new GetWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetWorkerPoolRequest. - * @implements IGetWorkerPoolRequest - * @constructor - * @param {google.cloud.run.v2.IGetWorkerPoolRequest=} [properties] Properties to set - */ - function GetWorkerPoolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetWorkerPoolRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @instance - */ - GetWorkerPoolRequest.prototype.name = ""; - - /** - * Creates a new GetWorkerPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IGetWorkerPoolRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest instance - */ - GetWorkerPoolRequest.create = function create(properties) { - return new GetWorkerPoolRequest(properties); - }; - - /** - * Encodes the specified GetWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetWorkerPoolRequest.encode = function encode(message, writer) { - 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 GetWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetWorkerPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetWorkerPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetWorkerPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetWorkerPoolRequest message. - * @function verify - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetWorkerPoolRequest.verify = function verify(message) { - if (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 GetWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest - */ - GetWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetWorkerPoolRequest) - return object; - var message = new $root.google.cloud.run.v2.GetWorkerPoolRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetWorkerPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.GetWorkerPoolRequest} message GetWorkerPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetWorkerPoolRequest.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 GetWorkerPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @instance - * @returns {Object.} JSON object - */ - GetWorkerPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetWorkerPoolRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GetWorkerPoolRequest"; - }; - - return GetWorkerPoolRequest; - })(); - - v2.DeleteWorkerPoolRequest = (function() { - - /** - * Properties of a DeleteWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteWorkerPoolRequest - * @property {string|null} [name] DeleteWorkerPoolRequest name - * @property {boolean|null} [validateOnly] DeleteWorkerPoolRequest validateOnly - * @property {string|null} [etag] DeleteWorkerPoolRequest etag - */ - - /** - * Constructs a new DeleteWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteWorkerPoolRequest. - * @implements IDeleteWorkerPoolRequest - * @constructor - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest=} [properties] Properties to set - */ - function DeleteWorkerPoolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteWorkerPoolRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @instance - */ - DeleteWorkerPoolRequest.prototype.name = ""; - - /** - * DeleteWorkerPoolRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @instance - */ - DeleteWorkerPoolRequest.prototype.validateOnly = false; - - /** - * DeleteWorkerPoolRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @instance - */ - DeleteWorkerPoolRequest.prototype.etag = ""; - - /** - * Creates a new DeleteWorkerPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest instance - */ - DeleteWorkerPoolRequest.create = function create(properties) { - return new DeleteWorkerPoolRequest(properties); - }; - - /** - * Encodes the specified DeleteWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteWorkerPoolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteWorkerPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteWorkerPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteWorkerPoolRequest message. - * @function verify - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteWorkerPoolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest - */ - DeleteWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteWorkerPoolRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteWorkerPoolRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteWorkerPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.DeleteWorkerPoolRequest} message DeleteWorkerPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteWorkerPoolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteWorkerPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteWorkerPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteWorkerPoolRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.DeleteWorkerPoolRequest"; - }; - - return DeleteWorkerPoolRequest; - })(); - - v2.WorkerPool = (function() { - - /** - * Properties of a WorkerPool. - * @memberof google.cloud.run.v2 - * @interface IWorkerPool - * @property {string|null} [name] WorkerPool name - * @property {string|null} [description] WorkerPool description - * @property {string|null} [uid] WorkerPool uid - * @property {number|Long|null} [generation] WorkerPool generation - * @property {Object.|null} [labels] WorkerPool labels - * @property {Object.|null} [annotations] WorkerPool annotations - * @property {google.protobuf.ITimestamp|null} [createTime] WorkerPool createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] WorkerPool updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] WorkerPool deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] WorkerPool expireTime - * @property {string|null} [creator] WorkerPool creator - * @property {string|null} [lastModifier] WorkerPool lastModifier - * @property {string|null} [client] WorkerPool client - * @property {string|null} [clientVersion] WorkerPool clientVersion - * @property {google.api.LaunchStage|null} [launchStage] WorkerPool launchStage - * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] WorkerPool binaryAuthorization - * @property {google.cloud.run.v2.IWorkerPoolRevisionTemplate|null} [template] WorkerPool template - * @property {Array.|null} [instanceSplits] WorkerPool instanceSplits - * @property {google.cloud.run.v2.IWorkerPoolScaling|null} [scaling] WorkerPool scaling - * @property {number|Long|null} [observedGeneration] WorkerPool observedGeneration - * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] WorkerPool terminalCondition - * @property {Array.|null} [conditions] WorkerPool conditions - * @property {string|null} [latestReadyRevision] WorkerPool latestReadyRevision - * @property {string|null} [latestCreatedRevision] WorkerPool latestCreatedRevision - * @property {Array.|null} [instanceSplitStatuses] WorkerPool instanceSplitStatuses - * @property {boolean|null} [threatDetectionEnabled] WorkerPool threatDetectionEnabled - * @property {Array.|null} [customAudiences] WorkerPool customAudiences - * @property {boolean|null} [satisfiesPzs] WorkerPool satisfiesPzs - * @property {boolean|null} [reconciling] WorkerPool reconciling - * @property {string|null} [etag] WorkerPool etag - */ - - /** - * Constructs a new WorkerPool. - * @memberof google.cloud.run.v2 - * @classdesc Represents a WorkerPool. - * @implements IWorkerPool - * @constructor - * @param {google.cloud.run.v2.IWorkerPool=} [properties] Properties to set - */ - function WorkerPool(properties) { - this.labels = {}; - this.annotations = {}; - this.instanceSplits = []; - this.conditions = []; - this.instanceSplitStatuses = []; - this.customAudiences = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkerPool name. - * @member {string} name - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.name = ""; - - /** - * WorkerPool description. - * @member {string} description - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.description = ""; - - /** - * WorkerPool uid. - * @member {string} uid - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.uid = ""; - - /** - * WorkerPool generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * WorkerPool labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.labels = $util.emptyObject; - - /** - * WorkerPool annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.annotations = $util.emptyObject; - - /** - * WorkerPool createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.createTime = null; - - /** - * WorkerPool updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.updateTime = null; - - /** - * WorkerPool deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.deleteTime = null; - - /** - * WorkerPool expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.expireTime = null; - - /** - * WorkerPool creator. - * @member {string} creator - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.creator = ""; - - /** - * WorkerPool lastModifier. - * @member {string} lastModifier - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.lastModifier = ""; - - /** - * WorkerPool client. - * @member {string} client - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.client = ""; - - /** - * WorkerPool clientVersion. - * @member {string} clientVersion - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.clientVersion = ""; - - /** - * WorkerPool launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.launchStage = 0; - - /** - * WorkerPool binaryAuthorization. - * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.binaryAuthorization = null; - - /** - * WorkerPool template. - * @member {google.cloud.run.v2.IWorkerPoolRevisionTemplate|null|undefined} template - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.template = null; - - /** - * WorkerPool instanceSplits. - * @member {Array.} instanceSplits - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.instanceSplits = $util.emptyArray; - - /** - * WorkerPool scaling. - * @member {google.cloud.run.v2.IWorkerPoolScaling|null|undefined} scaling - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.scaling = null; - - /** - * WorkerPool observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * WorkerPool terminalCondition. - * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.terminalCondition = null; - - /** - * WorkerPool conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.conditions = $util.emptyArray; - - /** - * WorkerPool latestReadyRevision. - * @member {string} latestReadyRevision - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.latestReadyRevision = ""; - - /** - * WorkerPool latestCreatedRevision. - * @member {string} latestCreatedRevision - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.latestCreatedRevision = ""; - - /** - * WorkerPool instanceSplitStatuses. - * @member {Array.} instanceSplitStatuses - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.instanceSplitStatuses = $util.emptyArray; - - /** - * WorkerPool threatDetectionEnabled. - * @member {boolean} threatDetectionEnabled - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.threatDetectionEnabled = false; - - /** - * WorkerPool customAudiences. - * @member {Array.} customAudiences - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.customAudiences = $util.emptyArray; - - /** - * WorkerPool satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.satisfiesPzs = false; - - /** - * WorkerPool reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.reconciling = false; - - /** - * WorkerPool etag. - * @member {string} etag - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.etag = ""; - - /** - * Creates a new WorkerPool instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {google.cloud.run.v2.IWorkerPool=} [properties] Properties to set - * @returns {google.cloud.run.v2.WorkerPool} WorkerPool instance - */ - WorkerPool.create = function create(properties) { - return new WorkerPool(properties); - }; - - /** - * Encodes the specified WorkerPool message. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {google.cloud.run.v2.IWorkerPool} message WorkerPool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.generation); - 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.creator); - if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.lastModifier); - if (message.client != null && Object.hasOwnProperty.call(message, "client")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.client); - if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.clientVersion); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); - if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) - $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.encode(message.template, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) - $root.google.cloud.run.v2.WorkerPoolScaling.encode(message.scaling, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.instanceSplits != null && message.instanceSplits.length) - for (var i = 0; i < message.instanceSplits.length; ++i) - $root.google.cloud.run.v2.InstanceSplit.encode(message.instanceSplits[i], writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.instanceSplitStatuses != null && message.instanceSplitStatuses.length) - for (var i = 0; i < message.instanceSplitStatuses.length; ++i) - $root.google.cloud.run.v2.InstanceSplitStatus.encode(message.instanceSplitStatuses[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.threatDetectionEnabled != null && Object.hasOwnProperty.call(message, "threatDetectionEnabled")) - writer.uint32(/* id 28, wireType 0 =*/224).bool(message.threatDetectionEnabled); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 30, wireType 0 =*/240).int64(message.observedGeneration); - if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) - $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.latestReadyRevision != null && Object.hasOwnProperty.call(message, "latestReadyRevision")) - writer.uint32(/* id 33, wireType 2 =*/266).string(message.latestReadyRevision); - if (message.latestCreatedRevision != null && Object.hasOwnProperty.call(message, "latestCreatedRevision")) - writer.uint32(/* id 34, wireType 2 =*/274).string(message.latestCreatedRevision); - if (message.customAudiences != null && message.customAudiences.length) - for (var i = 0; i < message.customAudiences.length; ++i) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.customAudiences[i]); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 38, wireType 0 =*/304).bool(message.satisfiesPzs); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified WorkerPool message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {google.cloud.run.v2.IWorkerPool} message WorkerPool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkerPool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.WorkerPool} WorkerPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.WorkerPool(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.generation = reader.int64(); - 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.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.creator = reader.string(); - break; - } - case 12: { - message.lastModifier = reader.string(); - break; - } - case 13: { - message.client = reader.string(); - break; - } - case 14: { - message.clientVersion = reader.string(); - break; - } - case 16: { - message.launchStage = reader.int32(); - break; - } - case 17: { - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); - break; - } - case 18: { - message.template = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.decode(reader, reader.uint32()); - break; - } - case 26: { - if (!(message.instanceSplits && message.instanceSplits.length)) - message.instanceSplits = []; - message.instanceSplits.push($root.google.cloud.run.v2.InstanceSplit.decode(reader, reader.uint32())); - break; - } - case 20: { - message.scaling = $root.google.cloud.run.v2.WorkerPoolScaling.decode(reader, reader.uint32()); - break; - } - case 30: { - message.observedGeneration = reader.int64(); - break; - } - case 31: { - message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); - break; - } - case 32: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 33: { - message.latestReadyRevision = reader.string(); - break; - } - case 34: { - message.latestCreatedRevision = reader.string(); - break; - } - case 27: { - if (!(message.instanceSplitStatuses && message.instanceSplitStatuses.length)) - message.instanceSplitStatuses = []; - message.instanceSplitStatuses.push($root.google.cloud.run.v2.InstanceSplitStatus.decode(reader, reader.uint32())); - break; - } - case 28: { - message.threatDetectionEnabled = reader.bool(); - break; - } - case 37: { - if (!(message.customAudiences && message.customAudiences.length)) - message.customAudiences = []; - message.customAudiences.push(reader.string()); - break; - } - case 38: { - message.satisfiesPzs = reader.bool(); - break; - } - case 98: { - message.reconciling = reader.bool(); - break; - } - case 99: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkerPool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.WorkerPool} WorkerPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkerPool message. - * @function verify - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkerPool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - if (!$util.isString(message.lastModifier)) - return "lastModifier: string expected"; - if (message.client != null && message.hasOwnProperty("client")) - if (!$util.isString(message.client)) - return "client: string expected"; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - if (!$util.isString(message.clientVersion)) - return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { - var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); - if (error) - return "binaryAuthorization." + error; - } - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.verify(message.template); - if (error) - return "template." + error; - } - if (message.instanceSplits != null && message.hasOwnProperty("instanceSplits")) { - if (!Array.isArray(message.instanceSplits)) - return "instanceSplits: array expected"; - for (var i = 0; i < message.instanceSplits.length; ++i) { - var error = $root.google.cloud.run.v2.InstanceSplit.verify(message.instanceSplits[i]); - if (error) - return "instanceSplits." + error; - } - } - if (message.scaling != null && message.hasOwnProperty("scaling")) { - var error = $root.google.cloud.run.v2.WorkerPoolScaling.verify(message.scaling); - if (error) - return "scaling." + error; - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { - var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); - if (error) - return "terminalCondition." + error; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) - if (!$util.isString(message.latestReadyRevision)) - return "latestReadyRevision: string expected"; - if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) - if (!$util.isString(message.latestCreatedRevision)) - return "latestCreatedRevision: string expected"; - if (message.instanceSplitStatuses != null && message.hasOwnProperty("instanceSplitStatuses")) { - if (!Array.isArray(message.instanceSplitStatuses)) - return "instanceSplitStatuses: array expected"; - for (var i = 0; i < message.instanceSplitStatuses.length; ++i) { - var error = $root.google.cloud.run.v2.InstanceSplitStatus.verify(message.instanceSplitStatuses[i]); - if (error) - return "instanceSplitStatuses." + error; - } - } - if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) - if (typeof message.threatDetectionEnabled !== "boolean") - return "threatDetectionEnabled: boolean expected"; - if (message.customAudiences != null && message.hasOwnProperty("customAudiences")) { - if (!Array.isArray(message.customAudiences)) - return "customAudiences: array expected"; - for (var i = 0; i < message.customAudiences.length; ++i) - if (!$util.isString(message.customAudiences[i])) - return "customAudiences: string[] expected"; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a WorkerPool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.WorkerPool} WorkerPool - */ - WorkerPool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.WorkerPool) - return object; - var message = new $root.google.cloud.run.v2.WorkerPool(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.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.run.v2.WorkerPool.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.lastModifier != null) - message.lastModifier = String(object.lastModifier); - if (object.client != null) - message.client = String(object.client); - if (object.clientVersion != null) - message.clientVersion = String(object.clientVersion); - 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.binaryAuthorization != null) { - if (typeof object.binaryAuthorization !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.binaryAuthorization: object expected"); - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); - } - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.template: object expected"); - message.template = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.fromObject(object.template); - } - if (object.instanceSplits) { - if (!Array.isArray(object.instanceSplits)) - throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplits: array expected"); - message.instanceSplits = []; - for (var i = 0; i < object.instanceSplits.length; ++i) { - if (typeof object.instanceSplits[i] !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplits: object expected"); - message.instanceSplits[i] = $root.google.cloud.run.v2.InstanceSplit.fromObject(object.instanceSplits[i]); - } - } - if (object.scaling != null) { - if (typeof object.scaling !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.scaling: object expected"); - message.scaling = $root.google.cloud.run.v2.WorkerPoolScaling.fromObject(object.scaling); - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.terminalCondition != null) { - if (typeof object.terminalCondition !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.terminalCondition: object expected"); - message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.WorkerPool.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.latestReadyRevision != null) - message.latestReadyRevision = String(object.latestReadyRevision); - if (object.latestCreatedRevision != null) - message.latestCreatedRevision = String(object.latestCreatedRevision); - if (object.instanceSplitStatuses) { - if (!Array.isArray(object.instanceSplitStatuses)) - throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplitStatuses: array expected"); - message.instanceSplitStatuses = []; - for (var i = 0; i < object.instanceSplitStatuses.length; ++i) { - if (typeof object.instanceSplitStatuses[i] !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplitStatuses: object expected"); - message.instanceSplitStatuses[i] = $root.google.cloud.run.v2.InstanceSplitStatus.fromObject(object.instanceSplitStatuses[i]); - } - } - if (object.threatDetectionEnabled != null) - message.threatDetectionEnabled = Boolean(object.threatDetectionEnabled); - if (object.customAudiences) { - if (!Array.isArray(object.customAudiences)) - throw TypeError(".google.cloud.run.v2.WorkerPool.customAudiences: array expected"); - message.customAudiences = []; - for (var i = 0; i < object.customAudiences.length; ++i) - message.customAudiences[i] = String(object.customAudiences[i]); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a WorkerPool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {google.cloud.run.v2.WorkerPool} message WorkerPool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkerPool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instanceSplits = []; - object.instanceSplitStatuses = []; - object.conditions = []; - object.customAudiences = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.description = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.creator = ""; - object.lastModifier = ""; - object.client = ""; - object.clientVersion = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.binaryAuthorization = null; - object.template = null; - object.scaling = null; - object.threatDetectionEnabled = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.terminalCondition = null; - object.latestReadyRevision = ""; - object.latestCreatedRevision = ""; - object.satisfiesPzs = false; - object.reconciling = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - object.lastModifier = message.lastModifier; - if (message.client != null && message.hasOwnProperty("client")) - object.client = message.client; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - object.clientVersion = message.clientVersion; - 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) - object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.toObject(message.template, options); - if (message.scaling != null && message.hasOwnProperty("scaling")) - object.scaling = $root.google.cloud.run.v2.WorkerPoolScaling.toObject(message.scaling, options); - if (message.instanceSplits && message.instanceSplits.length) { - object.instanceSplits = []; - for (var j = 0; j < message.instanceSplits.length; ++j) - object.instanceSplits[j] = $root.google.cloud.run.v2.InstanceSplit.toObject(message.instanceSplits[j], options); - } - if (message.instanceSplitStatuses && message.instanceSplitStatuses.length) { - object.instanceSplitStatuses = []; - for (var j = 0; j < message.instanceSplitStatuses.length; ++j) - object.instanceSplitStatuses[j] = $root.google.cloud.run.v2.InstanceSplitStatus.toObject(message.instanceSplitStatuses[j], options); - } - if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) - object.threatDetectionEnabled = message.threatDetectionEnabled; - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) - object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) - object.latestReadyRevision = message.latestReadyRevision; - if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) - object.latestCreatedRevision = message.latestCreatedRevision; - if (message.customAudiences && message.customAudiences.length) { - object.customAudiences = []; - for (var j = 0; j < message.customAudiences.length; ++j) - object.customAudiences[j] = message.customAudiences[j]; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this WorkerPool to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.WorkerPool - * @instance - * @returns {Object.} JSON object - */ - WorkerPool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkerPool - * @function getTypeUrl - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkerPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.WorkerPool"; - }; - - return WorkerPool; - })(); - - v2.WorkerPoolRevisionTemplate = (function() { - - /** - * Properties of a WorkerPoolRevisionTemplate. - * @memberof google.cloud.run.v2 - * @interface IWorkerPoolRevisionTemplate - * @property {string|null} [revision] WorkerPoolRevisionTemplate revision - * @property {Object.|null} [labels] WorkerPoolRevisionTemplate labels - * @property {Object.|null} [annotations] WorkerPoolRevisionTemplate annotations - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] WorkerPoolRevisionTemplate vpcAccess - * @property {string|null} [serviceAccount] WorkerPoolRevisionTemplate serviceAccount - * @property {Array.|null} [containers] WorkerPoolRevisionTemplate containers - * @property {Array.|null} [volumes] WorkerPoolRevisionTemplate volumes - * @property {string|null} [encryptionKey] WorkerPoolRevisionTemplate encryptionKey - * @property {google.cloud.run.v2.IServiceMesh|null} [serviceMesh] WorkerPoolRevisionTemplate serviceMesh - * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] WorkerPoolRevisionTemplate encryptionKeyRevocationAction - * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] WorkerPoolRevisionTemplate encryptionKeyShutdownDuration - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] WorkerPoolRevisionTemplate nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled - */ - - /** - * Constructs a new WorkerPoolRevisionTemplate. - * @memberof google.cloud.run.v2 - * @classdesc Represents a WorkerPoolRevisionTemplate. - * @implements IWorkerPoolRevisionTemplate - * @constructor - * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate=} [properties] Properties to set - */ - function WorkerPoolRevisionTemplate(properties) { - this.labels = {}; - this.annotations = {}; - this.containers = []; - 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]]; - } - - /** - * WorkerPoolRevisionTemplate revision. - * @member {string} revision - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.revision = ""; - - /** - * WorkerPoolRevisionTemplate labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.labels = $util.emptyObject; - - /** - * WorkerPoolRevisionTemplate annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.annotations = $util.emptyObject; - - /** - * WorkerPoolRevisionTemplate vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.vpcAccess = null; - - /** - * WorkerPoolRevisionTemplate serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.serviceAccount = ""; - - /** - * WorkerPoolRevisionTemplate containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.containers = $util.emptyArray; - - /** - * WorkerPoolRevisionTemplate volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.volumes = $util.emptyArray; - - /** - * WorkerPoolRevisionTemplate encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.encryptionKey = ""; - - /** - * WorkerPoolRevisionTemplate serviceMesh. - * @member {google.cloud.run.v2.IServiceMesh|null|undefined} serviceMesh - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.serviceMesh = null; - - /** - * WorkerPoolRevisionTemplate encryptionKeyRevocationAction. - * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.encryptionKeyRevocationAction = 0; - - /** - * WorkerPoolRevisionTemplate encryptionKeyShutdownDuration. - * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.encryptionKeyShutdownDuration = null; - - /** - * WorkerPoolRevisionTemplate nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.nodeSelector = null; - - /** - * WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.gpuZonalRedundancyDisabled = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(WorkerPoolRevisionTemplate.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WorkerPoolRevisionTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate=} [properties] Properties to set - * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate instance - */ - WorkerPoolRevisionTemplate.create = function create(properties) { - return new WorkerPoolRevisionTemplate(properties); - }; - - /** - * Encodes the specified WorkerPoolRevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate} message WorkerPoolRevisionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPoolRevisionTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.revision); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.encryptionKey); - if (message.serviceMesh != null && Object.hasOwnProperty.call(message, "serviceMesh")) - $root.google.cloud.run.v2.ServiceMesh.encode(message.serviceMesh, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.encryptionKeyRevocationAction); - if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) - $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.gpuZonalRedundancyDisabled); - return writer; - }; - - /** - * Encodes the specified WorkerPoolRevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate} message WorkerPoolRevisionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPoolRevisionTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPoolRevisionTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.WorkerPoolRevisionTemplate(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revision = reader.string(); - break; - } - case 2: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 3: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 4: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 5: { - message.serviceAccount = reader.string(); - break; - } - case 6: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 8: { - message.encryptionKey = reader.string(); - break; - } - case 9: { - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.decode(reader, reader.uint32()); - break; - } - case 10: { - message.encryptionKeyRevocationAction = reader.int32(); - break; - } - case 11: { - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 13: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 16: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPoolRevisionTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkerPoolRevisionTemplate message. - * @function verify - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkerPoolRevisionTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) { - var error = $root.google.cloud.run.v2.ServiceMesh.verify(message.serviceMesh); - if (error) - return "serviceMesh." + error; - } - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - switch (message.encryptionKeyRevocationAction) { - default: - return "encryptionKeyRevocationAction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { - var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); - if (error) - return "encryptionKeyShutdownDuration." + error; - } - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - return null; - }; - - /** - * Creates a WorkerPoolRevisionTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate - */ - WorkerPoolRevisionTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.WorkerPoolRevisionTemplate) - return object; - var message = new $root.google.cloud.run.v2.WorkerPoolRevisionTemplate(); - if (object.revision != null) - message.revision = String(object.revision); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - if (object.serviceMesh != null) { - if (typeof object.serviceMesh !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.serviceMesh: object expected"); - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.fromObject(object.serviceMesh); - } - switch (object.encryptionKeyRevocationAction) { - default: - if (typeof object.encryptionKeyRevocationAction === "number") { - message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; - break; - } - break; - case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": - case 0: - message.encryptionKeyRevocationAction = 0; - break; - case "PREVENT_NEW": - case 1: - message.encryptionKeyRevocationAction = 1; - break; - case "SHUTDOWN": - case 2: - message.encryptionKeyRevocationAction = 2; - break; - } - if (object.encryptionKeyShutdownDuration != null) { - if (typeof object.encryptionKeyShutdownDuration !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.encryptionKeyShutdownDuration: object expected"); - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); - } - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - return message; - }; - - /** - * Creates a plain object from a WorkerPoolRevisionTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {google.cloud.run.v2.WorkerPoolRevisionTemplate} message WorkerPoolRevisionTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkerPoolRevisionTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.revision = ""; - object.vpcAccess = null; - object.serviceAccount = ""; - object.encryptionKey = ""; - object.serviceMesh = null; - object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; - object.encryptionKeyShutdownDuration = null; - object.nodeSelector = null; - } - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) - object.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.toObject(message.serviceMesh, options); - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) - object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - return object; - }; - - /** - * Converts this WorkerPoolRevisionTemplate to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - * @returns {Object.} JSON object - */ - WorkerPoolRevisionTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkerPoolRevisionTemplate - * @function getTypeUrl - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkerPoolRevisionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.WorkerPoolRevisionTemplate"; - }; - - return WorkerPoolRevisionTemplate; - })(); - - return v2; - })(); - - return run; - })(); - - 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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - api.RoutingRule = (function() { - - /** - * Properties of a RoutingRule. - * @memberof google.api - * @interface IRoutingRule - * @property {Array.|null} [routingParameters] RoutingRule routingParameters - */ - - /** - * Constructs a new RoutingRule. - * @memberof google.api - * @classdesc Represents a RoutingRule. - * @implements IRoutingRule - * @constructor - * @param {google.api.IRoutingRule=} [properties] Properties to set - */ - function RoutingRule(properties) { - this.routingParameters = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingRule routingParameters. - * @member {Array.} routingParameters - * @memberof google.api.RoutingRule - * @instance - */ - RoutingRule.prototype.routingParameters = $util.emptyArray; - - /** - * Creates a new RoutingRule instance using the specified properties. - * @function create - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule=} [properties] Properties to set - * @returns {google.api.RoutingRule} RoutingRule instance - */ - RoutingRule.create = function create(properties) { - return new RoutingRule(properties); - }; - - /** - * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @function encode - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.routingParameters != null && message.routingParameters.length) - for (var i = 0; i < message.routingParameters.length; ++i) - $root.google.api.RoutingParameter.encode(message.routingParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.RoutingRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RoutingRule} RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.routingParameters && message.routingParameters.length)) - message.routingParameters = []; - message.routingParameters.push($root.google.api.RoutingParameter.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RoutingRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RoutingRule} RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingRule message. - * @function verify - * @memberof google.api.RoutingRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { - if (!Array.isArray(message.routingParameters)) - return "routingParameters: array expected"; - for (var i = 0; i < message.routingParameters.length; ++i) { - var error = $root.google.api.RoutingParameter.verify(message.routingParameters[i]); - if (error) - return "routingParameters." + error; - } - } - return null; - }; - - /** - * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RoutingRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.RoutingRule} RoutingRule - */ - RoutingRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RoutingRule) - return object; - var message = new $root.google.api.RoutingRule(); - if (object.routingParameters) { - if (!Array.isArray(object.routingParameters)) - throw TypeError(".google.api.RoutingRule.routingParameters: array expected"); - message.routingParameters = []; - for (var i = 0; i < object.routingParameters.length; ++i) { - if (typeof object.routingParameters[i] !== "object") - throw TypeError(".google.api.RoutingRule.routingParameters: object expected"); - message.routingParameters[i] = $root.google.api.RoutingParameter.fromObject(object.routingParameters[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RoutingRule - * @static - * @param {google.api.RoutingRule} message RoutingRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.routingParameters = []; - if (message.routingParameters && message.routingParameters.length) { - object.routingParameters = []; - for (var j = 0; j < message.routingParameters.length; ++j) - object.routingParameters[j] = $root.google.api.RoutingParameter.toObject(message.routingParameters[j], options); - } - return object; - }; - - /** - * Converts this RoutingRule to JSON. - * @function toJSON - * @memberof google.api.RoutingRule - * @instance - * @returns {Object.} JSON object - */ - RoutingRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingRule - * @function getTypeUrl - * @memberof google.api.RoutingRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RoutingRule"; - }; - - return RoutingRule; - })(); - - api.RoutingParameter = (function() { - - /** - * Properties of a RoutingParameter. - * @memberof google.api - * @interface IRoutingParameter - * @property {string|null} [field] RoutingParameter field - * @property {string|null} [pathTemplate] RoutingParameter pathTemplate - */ - - /** - * Constructs a new RoutingParameter. - * @memberof google.api - * @classdesc Represents a RoutingParameter. - * @implements IRoutingParameter - * @constructor - * @param {google.api.IRoutingParameter=} [properties] Properties to set - */ - function RoutingParameter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingParameter field. - * @member {string} field - * @memberof google.api.RoutingParameter - * @instance - */ - RoutingParameter.prototype.field = ""; - - /** - * RoutingParameter pathTemplate. - * @member {string} pathTemplate - * @memberof google.api.RoutingParameter - * @instance - */ - RoutingParameter.prototype.pathTemplate = ""; - - /** - * Creates a new RoutingParameter instance using the specified properties. - * @function create - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter=} [properties] Properties to set - * @returns {google.api.RoutingParameter} RoutingParameter instance - */ - RoutingParameter.create = function create(properties) { - return new RoutingParameter(properties); - }; - - /** - * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @function encode - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingParameter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.field != null && Object.hasOwnProperty.call(message, "field")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); - if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pathTemplate); - return writer; - }; - - /** - * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingParameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer. - * @function decode - * @memberof google.api.RoutingParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RoutingParameter} RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingParameter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingParameter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.field = reader.string(); - break; - } - case 2: { - message.pathTemplate = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RoutingParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RoutingParameter} RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingParameter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingParameter message. - * @function verify - * @memberof google.api.RoutingParameter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingParameter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.field != null && message.hasOwnProperty("field")) - if (!$util.isString(message.field)) - return "field: string expected"; - if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) - if (!$util.isString(message.pathTemplate)) - return "pathTemplate: string expected"; - return null; - }; - - /** - * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RoutingParameter - * @static - * @param {Object.} object Plain object - * @returns {google.api.RoutingParameter} RoutingParameter - */ - RoutingParameter.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RoutingParameter) - return object; - var message = new $root.google.api.RoutingParameter(); - if (object.field != null) - message.field = String(object.field); - if (object.pathTemplate != null) - message.pathTemplate = String(object.pathTemplate); - return message; - }; - - /** - * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.RoutingParameter} message RoutingParameter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingParameter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.field = ""; - object.pathTemplate = ""; - } - if (message.field != null && message.hasOwnProperty("field")) - object.field = message.field; - if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) - object.pathTemplate = message.pathTemplate; - return object; - }; - - /** - * Converts this RoutingParameter to JSON. - * @function toJSON - * @memberof google.api.RoutingParameter - * @instance - * @returns {Object.} JSON object - */ - RoutingParameter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingParameter - * @function getTypeUrl - * @memberof google.api.RoutingParameter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RoutingParameter"; - }; - - return RoutingParameter; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.api.IRoutingRule|null} [".google.api.routing"] MethodOptions .google.api.routing - * @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.api.routing. - * @member {google.api.IRoutingRule|null|undefined} .google.api.routing - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.routing"] = null; - - /** - * 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(); - if (message[".google.api.routing"] != null && Object.hasOwnProperty.call(message, ".google.api.routing")) - $root.google.api.RoutingRule.encode(message[".google.api.routing"], writer.uint32(/* id 72295729, wireType 2 =*/578365834).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 72295729: { - message[".google.api.routing"] = $root.google.api.RoutingRule.decode(reader, reader.uint32()); - 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.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { - var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"]); - if (error) - return ".google.api.routing." + error; - } - 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.api.routing"] != null) { - if (typeof object[".google.api.routing"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.routing: object expected"); - message[".google.api.routing"] = $root.google.api.RoutingRule.fromObject(object[".google.api.routing"]); - } - 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; - object[".google.api.routing"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) - object[".google.api.routing"] = $root.google.api.RoutingRule.toObject(message[".google.api.routing"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - return protobuf; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - google.iam = (function() { - - /** - * Namespace iam. - * @memberof google - * @namespace - */ - var iam = {}; - - iam.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.iam - * @namespace - */ - var v1 = {}; - - v1.IAMPolicy = (function() { - - /** - * Constructs a new IAMPolicy service. - * @memberof google.iam.v1 - * @classdesc Represents a IAMPolicy - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @function create - * @memberof google.iam.v1.IAMPolicy - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. - */ - IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @memberof google.iam.v1.IAMPolicy - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return IAMPolicy; - })(); - - v1.SetIamPolicyRequest = (function() { - - /** - * Properties of a SetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface ISetIamPolicyRequest - * @property {string|null} [resource] SetIamPolicyRequest resource - * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy - * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask - */ - - /** - * Constructs a new SetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a SetIamPolicyRequest. - * @implements ISetIamPolicyRequest - * @constructor - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - */ - function SetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.resource = ""; - - /** - * SetIamPolicyRequest policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.policy = null; - - /** - * SetIamPolicyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.updateMask = null; - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance - */ - SetIamPolicyRequest.create = function create(properties) { - return new SetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - case 3: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - */ - SetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.SetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.policy = null; - object.updateMask = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - SetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; - }; - - return SetIamPolicyRequest; - })(); - - v1.GetIamPolicyRequest = (function() { - - /** - * Properties of a GetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface IGetIamPolicyRequest - * @property {string|null} [resource] GetIamPolicyRequest resource - * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options - */ - - /** - * Constructs a new GetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a GetIamPolicyRequest. - * @implements IGetIamPolicyRequest - * @constructor - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - */ - function GetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.resource = ""; - - /** - * GetIamPolicyRequest options. - * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.options = null; - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance - */ - GetIamPolicyRequest.create = function create(properties) { - return new GetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - */ - GetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.GetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); - message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.options = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - GetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; - }; - - return GetIamPolicyRequest; - })(); - - v1.TestIamPermissionsRequest = (function() { - - /** - * Properties of a TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsRequest - * @property {string|null} [resource] TestIamPermissionsRequest resource - * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions - */ - - /** - * Constructs a new TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsRequest. - * @implements ITestIamPermissionsRequest - * @constructor - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - */ - function TestIamPermissionsRequest(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsRequest resource. - * @member {string} resource - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.resource = ""; - - /** - * TestIamPermissionsRequest permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance - */ - TestIamPermissionsRequest.create = function create(properties) { - return new TestIamPermissionsRequest(properties); - }; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsRequest message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - */ - TestIamPermissionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (options.defaults) - object.resource = ""; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; - }; - - return TestIamPermissionsRequest; - })(); - - v1.TestIamPermissionsResponse = (function() { - - /** - * Properties of a TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsResponse - * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions - */ - - /** - * Constructs a new TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsResponse. - * @implements ITestIamPermissionsResponse - * @constructor - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - */ - function TestIamPermissionsResponse(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsResponse permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - */ - TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance - */ - TestIamPermissionsResponse.create = function create(properties) { - return new TestIamPermissionsResponse(properties); - }; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsResponse message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - */ - TestIamPermissionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsResponse(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; - }; - - return TestIamPermissionsResponse; - })(); - - v1.GetPolicyOptions = (function() { - - /** - * Properties of a GetPolicyOptions. - * @memberof google.iam.v1 - * @interface IGetPolicyOptions - * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion - */ - - /** - * Constructs a new GetPolicyOptions. - * @memberof google.iam.v1 - * @classdesc Represents a GetPolicyOptions. - * @implements IGetPolicyOptions - * @constructor - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - */ - function GetPolicyOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPolicyOptions requestedPolicyVersion. - * @member {number} requestedPolicyVersion - * @memberof google.iam.v1.GetPolicyOptions - * @instance - */ - GetPolicyOptions.prototype.requestedPolicyVersion = 0; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance - */ - GetPolicyOptions.create = function create(properties) { - return new GetPolicyOptions(properties); - }; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); - return writer; - }; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.requestedPolicyVersion = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPolicyOptions message. - * @function verify - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPolicyOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - if (!$util.isInteger(message.requestedPolicyVersion)) - return "requestedPolicyVersion: integer expected"; - return null; - }; - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - */ - GetPolicyOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetPolicyOptions) - return object; - var message = new $root.google.iam.v1.GetPolicyOptions(); - if (object.requestedPolicyVersion != null) - message.requestedPolicyVersion = object.requestedPolicyVersion | 0; - return message; - }; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPolicyOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.requestedPolicyVersion = 0; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - object.requestedPolicyVersion = message.requestedPolicyVersion; - return object; - }; - - /** - * Converts this GetPolicyOptions to JSON. - * @function toJSON - * @memberof google.iam.v1.GetPolicyOptions - * @instance - * @returns {Object.} JSON object - */ - GetPolicyOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetPolicyOptions - * @function getTypeUrl - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; - }; - - return GetPolicyOptions; - })(); - - v1.Policy = (function() { - - /** - * Properties of a Policy. - * @memberof google.iam.v1 - * @interface IPolicy - * @property {number|null} [version] Policy version - * @property {Array.|null} [bindings] Policy bindings - * @property {Array.|null} [auditConfigs] Policy auditConfigs - * @property {Uint8Array|null} [etag] Policy etag - */ - - /** - * Constructs a new Policy. - * @memberof google.iam.v1 - * @classdesc Represents a Policy. - * @implements IPolicy - * @constructor - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - */ - function Policy(properties) { - this.bindings = []; - this.auditConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Policy version. - * @member {number} version - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.version = 0; - - /** - * Policy bindings. - * @member {Array.} bindings - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.bindings = $util.emptyArray; - - /** - * Policy auditConfigs. - * @member {Array.} auditConfigs - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.auditConfigs = $util.emptyArray; - - /** - * Policy etag. - * @member {Uint8Array} etag - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.etag = $util.newBuffer([]); - - /** - * Creates a new Policy instance using the specified properties. - * @function create - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - * @returns {google.iam.v1.Policy} Policy instance - */ - Policy.create = function create(properties) { - return new Policy(properties); - }; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.bindings != null && message.bindings.length) - for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.auditConfigs != null && message.auditConfigs.length) - for (var i = 0; i < message.auditConfigs.length; ++i) - $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.int32(); - break; - } - case 4: { - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.auditConfigs && message.auditConfigs.length)) - message.auditConfigs = []; - message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); - break; - } - case 3: { - message.etag = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Policy message. - * @function verify - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Policy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { - if (!Array.isArray(message.bindings)) - return "bindings: array expected"; - for (var i = 0; i < message.bindings.length; ++i) { - var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); - if (error) - return "bindings." + error; - } - } - if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { - if (!Array.isArray(message.auditConfigs)) - return "auditConfigs: array expected"; - for (var i = 0; i < message.auditConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); - if (error) - return "auditConfigs." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) - return "etag: buffer expected"; - return null; - }; - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Policy} Policy - */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Policy) - return object; - var message = new $root.google.iam.v1.Policy(); - if (object.version != null) - message.version = object.version | 0; - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.iam.v1.Policy.bindings: array expected"); - message.bindings = []; - for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") - throw TypeError(".google.iam.v1.Policy.bindings: object expected"); - message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); - } - } - if (object.auditConfigs) { - if (!Array.isArray(object.auditConfigs)) - throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); - message.auditConfigs = []; - for (var i = 0; i < object.auditConfigs.length; ++i) { - if (typeof object.auditConfigs[i] !== "object") - throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); - message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); - } - } - if (object.etag != null) - if (typeof object.etag === "string") - $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length >= 0) - message.etag = object.etag; - return message; - }; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.Policy} message Policy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Policy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindings = []; - object.auditConfigs = []; - } - if (options.defaults) { - object.version = 0; - if (options.bytes === String) - object.etag = ""; - else { - object.etag = []; - if (options.bytes !== Array) - object.etag = $util.newBuffer(object.etag); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; - if (message.bindings && message.bindings.length) { - object.bindings = []; - for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); - } - if (message.auditConfigs && message.auditConfigs.length) { - object.auditConfigs = []; - for (var j = 0; j < message.auditConfigs.length; ++j) - object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); - } - return object; - }; - - /** - * Converts this Policy to JSON. - * @function toJSON - * @memberof google.iam.v1.Policy - * @instance - * @returns {Object.} JSON object - */ - Policy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Policy - * @function getTypeUrl - * @memberof google.iam.v1.Policy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Policy"; - }; - - return Policy; - })(); - - v1.Binding = (function() { - - /** - * Properties of a Binding. - * @memberof google.iam.v1 - * @interface IBinding - * @property {string|null} [role] Binding role - * @property {Array.|null} [members] Binding members - * @property {google.type.IExpr|null} [condition] Binding condition - */ - - /** - * Constructs a new Binding. - * @memberof google.iam.v1 - * @classdesc Represents a Binding. - * @implements IBinding - * @constructor - * @param {google.iam.v1.IBinding=} [properties] Properties to set - */ - function Binding(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Binding role. - * @member {string} role - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.role = ""; - - /** - * Binding members. - * @member {Array.} members - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.members = $util.emptyArray; - - /** - * Binding condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.condition = null; - - /** - * Creates a new Binding instance using the specified properties. - * @function create - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding=} [properties] Properties to set - * @returns {google.iam.v1.Binding} Binding instance - */ - Binding.create = function create(properties) { - return new Binding(properties); - }; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.role = reader.string(); - break; - } - case 2: { - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - } - case 3: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Binding message. - * @function verify - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Binding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) - if (!$util.isString(message.members[i])) - return "members: string[] expected"; - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Binding} Binding - */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Binding) - return object; - var message = new $root.google.iam.v1.Binding(); - if (object.role != null) - message.role = String(object.role); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.iam.v1.Binding.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) - message.members[i] = String(object.members[i]); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.Binding.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.Binding} message Binding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Binding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.role = ""; - object.condition = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = message.members[j]; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this Binding to JSON. - * @function toJSON - * @memberof google.iam.v1.Binding - * @instance - * @returns {Object.} JSON object - */ - Binding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Binding - * @function getTypeUrl - * @memberof google.iam.v1.Binding - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Binding"; - }; - - return Binding; - })(); - - v1.AuditConfig = (function() { - - /** - * Properties of an AuditConfig. - * @memberof google.iam.v1 - * @interface IAuditConfig - * @property {string|null} [service] AuditConfig service - * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs - */ - - /** - * Constructs a new AuditConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfig. - * @implements IAuditConfig - * @constructor - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - */ - function AuditConfig(properties) { - this.auditLogConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfig service. - * @member {string} service - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.service = ""; - - /** - * AuditConfig auditLogConfigs. - * @member {Array.} auditLogConfigs - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.auditLogConfigs = $util.emptyArray; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfig} AuditConfig instance - */ - AuditConfig.create = function create(properties) { - return new AuditConfig(properties); - }; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - if (message.auditLogConfigs != null && message.auditLogConfigs.length) - for (var i = 0; i < message.auditLogConfigs.length; ++i) - $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - case 3: { - if (!(message.auditLogConfigs && message.auditLogConfigs.length)) - message.auditLogConfigs = []; - message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfig message. - * @function verify - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { - if (!Array.isArray(message.auditLogConfigs)) - return "auditLogConfigs: array expected"; - for (var i = 0; i < message.auditLogConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); - if (error) - return "auditLogConfigs." + error; - } - } - return null; - }; - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfig} AuditConfig - */ - AuditConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfig) - return object; - var message = new $root.google.iam.v1.AuditConfig(); - if (object.service != null) - message.service = String(object.service); - if (object.auditLogConfigs) { - if (!Array.isArray(object.auditLogConfigs)) - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); - message.auditLogConfigs = []; - for (var i = 0; i < object.auditLogConfigs.length; ++i) { - if (typeof object.auditLogConfigs[i] !== "object") - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); - message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.AuditConfig} message AuditConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.auditLogConfigs = []; - if (options.defaults) - object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.auditLogConfigs && message.auditLogConfigs.length) { - object.auditLogConfigs = []; - for (var j = 0; j < message.auditLogConfigs.length; ++j) - object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); - } - return object; - }; - - /** - * Converts this AuditConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfig - * @instance - * @returns {Object.} JSON object - */ - AuditConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfig"; - }; - - return AuditConfig; - })(); - - v1.AuditLogConfig = (function() { - - /** - * Properties of an AuditLogConfig. - * @memberof google.iam.v1 - * @interface IAuditLogConfig - * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType - * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers - */ - - /** - * Constructs a new AuditLogConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditLogConfig. - * @implements IAuditLogConfig - * @constructor - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - */ - function AuditLogConfig(properties) { - this.exemptedMembers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditLogConfig logType. - * @member {google.iam.v1.AuditLogConfig.LogType} logType - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.logType = 0; - - /** - * AuditLogConfig exemptedMembers. - * @member {Array.} exemptedMembers - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance - */ - AuditLogConfig.create = function create(properties) { - return new AuditLogConfig(properties); - }; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); - if (message.exemptedMembers != null && message.exemptedMembers.length) - for (var i = 0; i < message.exemptedMembers.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); - return writer; - }; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.logType = reader.int32(); - break; - } - case 2: { - if (!(message.exemptedMembers && message.exemptedMembers.length)) - message.exemptedMembers = []; - message.exemptedMembers.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditLogConfig message. - * @function verify - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditLogConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - switch (message.logType) { - default: - return "logType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { - if (!Array.isArray(message.exemptedMembers)) - return "exemptedMembers: array expected"; - for (var i = 0; i < message.exemptedMembers.length; ++i) - if (!$util.isString(message.exemptedMembers[i])) - return "exemptedMembers: string[] expected"; - } - return null; - }; - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - */ - AuditLogConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditLogConfig) - return object; - var message = new $root.google.iam.v1.AuditLogConfig(); - switch (object.logType) { - default: - if (typeof object.logType === "number") { - message.logType = object.logType; - break; - } - break; - case "LOG_TYPE_UNSPECIFIED": - case 0: - message.logType = 0; - break; - case "ADMIN_READ": - case 1: - message.logType = 1; - break; - case "DATA_WRITE": - case 2: - message.logType = 2; - break; - case "DATA_READ": - case 3: - message.logType = 3; - break; - } - if (object.exemptedMembers) { - if (!Array.isArray(object.exemptedMembers)) - throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); - message.exemptedMembers = []; - for (var i = 0; i < object.exemptedMembers.length; ++i) - message.exemptedMembers[i] = String(object.exemptedMembers[i]); - } - return message; - }; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditLogConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exemptedMembers = []; - if (options.defaults) - object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; - if (message.exemptedMembers && message.exemptedMembers.length) { - object.exemptedMembers = []; - for (var j = 0; j < message.exemptedMembers.length; ++j) - object.exemptedMembers[j] = message.exemptedMembers[j]; - } - return object; - }; - - /** - * Converts this AuditLogConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditLogConfig - * @instance - * @returns {Object.} JSON object - */ - AuditLogConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditLogConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; - }; - - /** - * LogType enum. - * @name google.iam.v1.AuditLogConfig.LogType - * @enum {number} - * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value - * @property {number} ADMIN_READ=1 ADMIN_READ value - * @property {number} DATA_WRITE=2 DATA_WRITE value - * @property {number} DATA_READ=3 DATA_READ value - */ - AuditLogConfig.LogType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADMIN_READ"] = 1; - values[valuesById[2] = "DATA_WRITE"] = 2; - values[valuesById[3] = "DATA_READ"] = 3; - return values; - })(); - - return AuditLogConfig; - })(); - - v1.PolicyDelta = (function() { - - /** - * Properties of a PolicyDelta. - * @memberof google.iam.v1 - * @interface IPolicyDelta - * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas - * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas - */ - - /** - * Constructs a new PolicyDelta. - * @memberof google.iam.v1 - * @classdesc Represents a PolicyDelta. - * @implements IPolicyDelta - * @constructor - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - */ - function PolicyDelta(properties) { - this.bindingDeltas = []; - this.auditConfigDeltas = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PolicyDelta bindingDeltas. - * @member {Array.} bindingDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.bindingDeltas = $util.emptyArray; - - /** - * PolicyDelta auditConfigDeltas. - * @member {Array.} auditConfigDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance - */ - PolicyDelta.create = function create(properties) { - return new PolicyDelta(properties); - }; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bindingDeltas != null && message.bindingDeltas.length) - for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) - for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolicyDelta message. - * @function verify - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { - if (!Array.isArray(message.bindingDeltas)) - return "bindingDeltas: array expected"; - for (var i = 0; i < message.bindingDeltas.length; ++i) { - var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); - if (error) - return "bindingDeltas." + error; - } - } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { - if (!Array.isArray(message.auditConfigDeltas)) - return "auditConfigDeltas: array expected"; - for (var i = 0; i < message.auditConfigDeltas.length; ++i) { - var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); - if (error) - return "auditConfigDeltas." + error; - } - } - return null; - }; - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - */ - PolicyDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.PolicyDelta) - return object; - var message = new $root.google.iam.v1.PolicyDelta(); - if (object.bindingDeltas) { - if (!Array.isArray(object.bindingDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); - message.bindingDeltas = []; - for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); - message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); - } - } - if (object.auditConfigDeltas) { - if (!Array.isArray(object.auditConfigDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); - message.auditConfigDeltas = []; - for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); - message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.PolicyDelta} message PolicyDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindingDeltas = []; - object.auditConfigDeltas = []; - } - if (message.bindingDeltas && message.bindingDeltas.length) { - object.bindingDeltas = []; - for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); - } - if (message.auditConfigDeltas && message.auditConfigDeltas.length) { - object.auditConfigDeltas = []; - for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); - } - return object; - }; - - /** - * Converts this PolicyDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.PolicyDelta - * @instance - * @returns {Object.} JSON object - */ - PolicyDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolicyDelta - * @function getTypeUrl - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; - }; - - return PolicyDelta; - })(); - - v1.BindingDelta = (function() { - - /** - * Properties of a BindingDelta. - * @memberof google.iam.v1 - * @interface IBindingDelta - * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action - * @property {string|null} [role] BindingDelta role - * @property {string|null} [member] BindingDelta member - * @property {google.type.IExpr|null} [condition] BindingDelta condition - */ - - /** - * Constructs a new BindingDelta. - * @memberof google.iam.v1 - * @classdesc Represents a BindingDelta. - * @implements IBindingDelta - * @constructor - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - */ - function BindingDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BindingDelta action. - * @member {google.iam.v1.BindingDelta.Action} action - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.action = 0; - - /** - * BindingDelta role. - * @member {string} role - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.role = ""; - - /** - * BindingDelta member. - * @member {string} member - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.member = ""; - - /** - * BindingDelta condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.condition = null; - - /** - * Creates a new BindingDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - * @returns {google.iam.v1.BindingDelta} BindingDelta instance - */ - BindingDelta.create = function create(properties) { - return new BindingDelta(properties); - }; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && Object.hasOwnProperty.call(message, "member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.role = reader.string(); - break; - } - case 3: { - message.member = reader.string(); - break; - } - case 4: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BindingDelta message. - * @function verify - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BindingDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.BindingDelta} BindingDelta - */ - BindingDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.BindingDelta) - return object; - var message = new $root.google.iam.v1.BindingDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.BindingDelta} message BindingDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BindingDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - object.condition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this BindingDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.BindingDelta - * @instance - * @returns {Object.} JSON object - */ - BindingDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BindingDelta - * @function getTypeUrl - * @memberof google.iam.v1.BindingDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.BindingDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.BindingDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - BindingDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return BindingDelta; - })(); - - v1.AuditConfigDelta = (function() { - - /** - * Properties of an AuditConfigDelta. - * @memberof google.iam.v1 - * @interface IAuditConfigDelta - * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action - * @property {string|null} [service] AuditConfigDelta service - * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember - * @property {string|null} [logType] AuditConfigDelta logType - */ - - /** - * Constructs a new AuditConfigDelta. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfigDelta. - * @implements IAuditConfigDelta - * @constructor - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - */ - function AuditConfigDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfigDelta action. - * @member {google.iam.v1.AuditConfigDelta.Action} action - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.action = 0; - - /** - * AuditConfigDelta service. - * @member {string} service - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.service = ""; - - /** - * AuditConfigDelta exemptedMember. - * @member {string} exemptedMember - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.exemptedMember = ""; - - /** - * AuditConfigDelta logType. - * @member {string} logType - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.logType = ""; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance - */ - AuditConfigDelta.create = function create(properties) { - return new AuditConfigDelta(properties); - }; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); - return writer; - }; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - case 3: { - message.exemptedMember = reader.string(); - break; - } - case 4: { - message.logType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfigDelta message. - * @function verify - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfigDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - if (!$util.isString(message.exemptedMember)) - return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - if (!$util.isString(message.logType)) - return "logType: string expected"; - return null; - }; - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - */ - AuditConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfigDelta) - return object; - var message = new $root.google.iam.v1.AuditConfigDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.service != null) - message.service = String(object.service); - if (object.exemptedMember != null) - message.exemptedMember = String(object.exemptedMember); - if (object.logType != null) - message.logType = String(object.logType); - return message; - }; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.service = ""; - object.exemptedMember = ""; - object.logType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = message.logType; - return object; - }; - - /** - * Converts this AuditConfigDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfigDelta - * @instance - * @returns {Object.} JSON object - */ - AuditConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfigDelta - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.AuditConfigDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - AuditConfigDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return AuditConfigDelta; - })(); - - return v1; - })(); - - return iam; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Expr = (function() { - - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ - - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; - - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; - - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; - - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; - - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expression = reader.string(); - break; - } - case 2: { - message.title = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.location = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Expr - * @function getTypeUrl - * @memberof google.type.Expr - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Expr"; - }; - - return Expr; - })(); - - return type; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-run/protos/protos.json b/owl-bot-staging/google-cloud-run/protos/protos.json deleted file mode 100644 index cdebe0a282b..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/protos.json +++ /dev/null @@ -1,7802 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "run": { - "nested": { - "v2": { - "options": { - "go_package": "cloud.google.com/go/run/apiv2/runpb;runpb", - "java_multiple_files": true, - "java_outer_classname": "WorkerPoolRevisionTemplateProto", - "java_package": "com.google.cloud.run.v2", - "(google.api.resource_definition).type": "cloudbuild.googleapis.com/Build", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/builds/{build}" - }, - "nested": { - "Builds": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "SubmitBuild": { - "requestType": "SubmitBuildRequest", - "responseType": "SubmitBuildResponse", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/builds:submit", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/builds:submit", - "body": "*" - } - } - ] - } - } - }, - "SubmitBuildRequest": { - "oneofs": { - "source": { - "oneof": [ - "storageSource" - ] - }, - "buildType": { - "oneof": [ - "buildpackBuild", - "dockerBuild" - ] - } - }, - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "storageSource": { - "type": "StorageSource", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "imageUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "buildpackBuild": { - "type": "BuildpacksBuild", - "id": 4 - }, - "dockerBuild": { - "type": "DockerBuild", - "id": 5 - }, - "serviceAccount": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "workerPool": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudbuild.googleapis.com/BuildWorkerPool" - } - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "machineType": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "releaseTrack": { - "type": "google.api.LaunchStage", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "client": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "DockerBuild": { - "fields": {} - }, - "BuildpacksBuild": { - "fields": { - "runtime": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "functionTarget": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cacheImageUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "baseImage": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "environmentVariables": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableAutomaticUpdates": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "projectDescriptor": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "SubmitBuildResponse": { - "fields": { - "buildOperation": { - "type": "google.longrunning.Operation", - "id": 1 - }, - "baseImageUri": { - "type": "string", - "id": 2 - }, - "baseImageWarning": { - "type": "string", - "id": 3 - } - } - }, - "StorageSource": { - "fields": { - "bucket": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "object": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Condition": { - "oneofs": { - "reasons": { - "oneof": [ - "reason", - "revisionReason", - "executionReason" - ] - } - }, - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "state": { - "type": "State", - "id": 2 - }, - "message": { - "type": "string", - "id": 3 - }, - "lastTransitionTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "severity": { - "type": "Severity", - "id": 5 - }, - "reason": { - "type": "CommonReason", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "revisionReason": { - "type": "RevisionReason", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executionReason": { - "type": "ExecutionReason", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CONDITION_PENDING": 1, - "CONDITION_RECONCILING": 2, - "CONDITION_FAILED": 3, - "CONDITION_SUCCEEDED": 4 - } - }, - "Severity": { - "values": { - "SEVERITY_UNSPECIFIED": 0, - "ERROR": 1, - "WARNING": 2, - "INFO": 3 - } - }, - "CommonReason": { - "values": { - "COMMON_REASON_UNDEFINED": 0, - "UNKNOWN": 1, - "REVISION_FAILED": 3, - "PROGRESS_DEADLINE_EXCEEDED": 4, - "CONTAINER_MISSING": 6, - "CONTAINER_PERMISSION_DENIED": 7, - "CONTAINER_IMAGE_UNAUTHORIZED": 8, - "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED": 9, - "ENCRYPTION_KEY_PERMISSION_DENIED": 10, - "ENCRYPTION_KEY_CHECK_FAILED": 11, - "SECRETS_ACCESS_CHECK_FAILED": 12, - "WAITING_FOR_OPERATION": 13, - "IMMEDIATE_RETRY": 14, - "POSTPONED_RETRY": 15, - "INTERNAL": 16, - "VPC_NETWORK_NOT_FOUND": 17 - } - }, - "RevisionReason": { - "values": { - "REVISION_REASON_UNDEFINED": 0, - "PENDING": 1, - "RESERVE": 2, - "RETIRED": 3, - "RETIRING": 4, - "RECREATING": 5, - "HEALTH_CHECK_CONTAINER_ERROR": 6, - "CUSTOMIZED_PATH_RESPONSE_PENDING": 7, - "MIN_INSTANCES_NOT_PROVISIONED": 8, - "ACTIVE_REVISION_LIMIT_REACHED": 9, - "NO_DEPLOYMENT": 10, - "HEALTH_CHECK_SKIPPED": 11, - "MIN_INSTANCES_WARMING": 12 - } - }, - "ExecutionReason": { - "values": { - "EXECUTION_REASON_UNDEFINED": 0, - "JOB_STATUS_SERVICE_POLLING_ERROR": 1, - "NON_ZERO_EXIT_CODE": 2, - "CANCELLED": 3, - "CANCELLING": 4, - "DELETED": 5, - "DELAYED_START_PENDING": 6 - } - } - } - }, - "ContainerStatus": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "imageDigest": { - "type": "string", - "id": 2 - } - } - }, - "Executions": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GetExecution": { - "requestType": "GetExecutionRequest", - "responseType": "Execution", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListExecutions": { - "requestType": "ListExecutionsRequest", - "responseType": "ListExecutionsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*/jobs/*}/executions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*/jobs/*}/executions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteExecution": { - "requestType": "DeleteExecutionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Execution", - "(google.longrunning.operation_info).metadata_type": "Execution" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Execution", - "metadata_type": "Execution" - } - } - ] - }, - "CancelExecution": { - "requestType": "CancelExecutionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Execution", - "(google.longrunning.operation_info).metadata_type": "Execution" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Execution", - "metadata_type": "Execution" - } - } - ] - } - } - }, - "GetExecutionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Execution" - } - } - } - }, - "ListExecutionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Execution" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListExecutionsResponse": { - "fields": { - "executions": { - "rule": "repeated", - "type": "Execution", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteExecutionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Execution" - } - }, - "validateOnly": { - "type": "bool", - "id": 2 - }, - "etag": { - "type": "string", - "id": 3 - } - } - }, - "CancelExecutionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Execution" - } - }, - "validateOnly": { - "type": "bool", - "id": 2 - }, - "etag": { - "type": "string", - "id": 3 - } - } - }, - "Execution": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Execution", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "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" - } - }, - "creator": { - "type": "string", - "id": 32, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "completionTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 11 - }, - "job": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Job" - } - }, - "parallelism": { - "type": "int32", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "taskCount": { - "type": "int32", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "template": { - "type": "TaskTemplate", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "observedGeneration": { - "type": "int64", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "runningCount": { - "type": "int32", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "succeededCount": { - "type": "int32", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "failedCount": { - "type": "int32", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cancelledCount": { - "type": "int32", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "retriedCount": { - "type": "int32", - "id": 25, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logUri": { - "type": "string", - "id": 26, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 27, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "TaskTemplate": { - "oneofs": { - "retries": { - "oneof": [ - "maxRetries" - ] - }, - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "fields": { - "containers": { - "rule": "repeated", - "type": "Container", - "id": 1 - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxRetries": { - "type": "int32", - "id": 3 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "executionEnvironment": { - "type": "ExecutionEnvironment", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKey": { - "type": "string", - "id": 7, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "Container": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "image": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sourceCode": { - "type": "SourceCode", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "command": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "env": { - "rule": "repeated", - "type": "EnvVar", - "id": 5 - }, - "resources": { - "type": "ResourceRequirements", - "id": 6 - }, - "ports": { - "rule": "repeated", - "type": "ContainerPort", - "id": 7 - }, - "volumeMounts": { - "rule": "repeated", - "type": "VolumeMount", - "id": 8 - }, - "workingDir": { - "type": "string", - "id": 9 - }, - "livenessProbe": { - "type": "Probe", - "id": 10 - }, - "startupProbe": { - "type": "Probe", - "id": 11 - }, - "readinessProbe": { - "type": "Probe", - "id": 14 - }, - "dependsOn": { - "rule": "repeated", - "type": "string", - "id": 12 - }, - "baseImageUri": { - "type": "string", - "id": 13 - }, - "buildInfo": { - "type": "BuildInfo", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ResourceRequirements": { - "fields": { - "limits": { - "keyType": "string", - "type": "string", - "id": 1 - }, - "cpuIdle": { - "type": "bool", - "id": 2 - }, - "startupCpuBoost": { - "type": "bool", - "id": 3 - } - } - }, - "EnvVar": { - "oneofs": { - "values": { - "oneof": [ - "value", - "valueSource" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "value": { - "type": "string", - "id": 2 - }, - "valueSource": { - "type": "EnvVarSource", - "id": 3 - } - } - }, - "EnvVarSource": { - "fields": { - "secretKeyRef": { - "type": "SecretKeySelector", - "id": 1 - } - } - }, - "SecretKeySelector": { - "fields": { - "secret": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "secretmanager.googleapis.com/Secret" - } - }, - "version": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" - } - } - } - }, - "ContainerPort": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "containerPort": { - "type": "int32", - "id": 3 - } - } - }, - "VolumeMount": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "mountPath": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "subPath": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Volume": { - "oneofs": { - "volumeType": { - "oneof": [ - "secret", - "cloudSqlInstance", - "emptyDir", - "nfs", - "gcs" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "secret": { - "type": "SecretVolumeSource", - "id": 2 - }, - "cloudSqlInstance": { - "type": "CloudSqlInstance", - "id": 3 - }, - "emptyDir": { - "type": "EmptyDirVolumeSource", - "id": 4 - }, - "nfs": { - "type": "NFSVolumeSource", - "id": 5 - }, - "gcs": { - "type": "GCSVolumeSource", - "id": 6 - } - } - }, - "SecretVolumeSource": { - "fields": { - "secret": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "items": { - "rule": "repeated", - "type": "VersionToPath", - "id": 2 - }, - "defaultMode": { - "type": "int32", - "id": 3 - } - } - }, - "VersionToPath": { - "fields": { - "path": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "version": { - "type": "string", - "id": 2 - }, - "mode": { - "type": "int32", - "id": 3 - } - } - }, - "CloudSqlInstance": { - "fields": { - "instances": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "EmptyDirVolumeSource": { - "fields": { - "medium": { - "type": "Medium", - "id": 1 - }, - "sizeLimit": { - "type": "string", - "id": 2 - } - }, - "nested": { - "Medium": { - "values": { - "MEDIUM_UNSPECIFIED": 0, - "MEMORY": 1 - } - } - } - }, - "NFSVolumeSource": { - "fields": { - "server": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - }, - "readOnly": { - "type": "bool", - "id": 3 - } - } - }, - "GCSVolumeSource": { - "fields": { - "bucket": { - "type": "string", - "id": 1 - }, - "readOnly": { - "type": "bool", - "id": 2 - }, - "mountOptions": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "Probe": { - "oneofs": { - "probeType": { - "oneof": [ - "httpGet", - "tcpSocket", - "grpc" - ] - } - }, - "fields": { - "initialDelaySeconds": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeoutSeconds": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "periodSeconds": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "failureThreshold": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "httpGet": { - "type": "HTTPGetAction", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tcpSocket": { - "type": "TCPSocketAction", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "grpc": { - "type": "GRPCAction", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "HTTPGetAction": { - "fields": { - "path": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "httpHeaders": { - "rule": "repeated", - "type": "HTTPHeader", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "port": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "HTTPHeader": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "value": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "TCPSocketAction": { - "fields": { - "port": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GRPCAction": { - "fields": { - "port": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "service": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BuildInfo": { - "fields": { - "functionTarget": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sourceLocation": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "SourceCode": { - "oneofs": { - "sourceType": { - "oneof": [ - "cloudStorageSource" - ] - } - }, - "fields": { - "cloudStorageSource": { - "type": "CloudStorageSource", - "id": 1 - } - }, - "nested": { - "CloudStorageSource": { - "fields": { - "bucket": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "object": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "VpcAccess": { - "fields": { - "connector": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "vpcaccess.googleapis.com/Connector" - } - }, - "egress": { - "type": "VpcEgress", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkInterfaces": { - "rule": "repeated", - "type": "NetworkInterface", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "VpcEgress": { - "values": { - "VPC_EGRESS_UNSPECIFIED": 0, - "ALL_TRAFFIC": 1, - "PRIVATE_RANGES_ONLY": 2 - } - }, - "NetworkInterface": { - "fields": { - "network": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subnetwork": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "BinaryAuthorization": { - "oneofs": { - "binauthzMethod": { - "oneof": [ - "useDefault", - "policy" - ] - } - }, - "fields": { - "useDefault": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "policy": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "binaryauthorization.googleapis.com/Policy" - } - }, - "breakglassJustification": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RevisionScaling": { - "fields": { - "minInstanceCount": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxInstanceCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ServiceMesh": { - "fields": { - "mesh": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "networkservices.googleapis.com/Mesh" - } - } - } - }, - "ServiceScaling": { - "oneofs": { - "_manualInstanceCount": { - "oneof": [ - "manualInstanceCount" - ] - } - }, - "fields": { - "minInstanceCount": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scalingMode": { - "type": "ScalingMode", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxInstanceCount": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "manualInstanceCount": { - "type": "int32", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "ScalingMode": { - "values": { - "SCALING_MODE_UNSPECIFIED": 0, - "AUTOMATIC": 1, - "MANUAL": 2 - } - } - } - }, - "WorkerPoolScaling": { - "oneofs": { - "_manualInstanceCount": { - "oneof": [ - "manualInstanceCount" - ] - } - }, - "fields": { - "manualInstanceCount": { - "type": "int32", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "NodeSelector": { - "fields": { - "accelerator": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BuildConfig": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" - } - }, - "sourceLocation": { - "type": "string", - "id": 2 - }, - "functionTarget": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "imageUri": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "baseImage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableAutomaticUpdates": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "workerPool": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudbuild.googleapis.com/BuildWorkerPool" - } - }, - "environmentVariables": { - "keyType": "string", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "IngressTraffic": { - "values": { - "INGRESS_TRAFFIC_UNSPECIFIED": 0, - "INGRESS_TRAFFIC_ALL": 1, - "INGRESS_TRAFFIC_INTERNAL_ONLY": 2, - "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": 3, - "INGRESS_TRAFFIC_NONE": 4 - } - }, - "ExecutionEnvironment": { - "values": { - "EXECUTION_ENVIRONMENT_UNSPECIFIED": 0, - "EXECUTION_ENVIRONMENT_GEN1": 1, - "EXECUTION_ENVIRONMENT_GEN2": 2 - } - }, - "EncryptionKeyRevocationAction": { - "values": { - "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": 0, - "PREVENT_NEW": 1, - "SHUTDOWN": 2 - } - }, - "ExecutionTemplate": { - "fields": { - "labels": { - "keyType": "string", - "type": "string", - "id": 1 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "parallelism": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "taskCount": { - "type": "int32", - "id": 4 - }, - "template": { - "type": "TaskTemplate", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Instances": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateInstance": { - "requestType": "CreateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/instances", - "(google.api.http).body": "instance", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent,instance", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "Instance" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/instances", - "body": "instance" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent,instance" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "Instance" - } - } - ] - }, - "DeleteInstance": { - "requestType": "DeleteInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/instances/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "Instance" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/instances/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "Instance" - } - } - ] - }, - "GetInstance": { - "requestType": "GetInstanceRequest", - "responseType": "Instance", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/instances/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/instances/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListInstances": { - "requestType": "ListInstancesRequest", - "responseType": "ListInstancesResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/instances", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*}/instances" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "StopInstance": { - "requestType": "StopInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/instances/*}:stop", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "Instance" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/instances/*}:stop", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "Instance" - } - } - ] - }, - "StartInstance": { - "requestType": "StartInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/instances/*}:start", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "Instance" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/instances/*}:start", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "Instance" - } - } - ] - } - } - }, - "CreateInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Instance" - } - }, - "instance": { - "type": "Instance", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instanceId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Instance" - } - } - } - }, - "DeleteInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Instance" - } - }, - "validateOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Instance" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "showDeleted": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancesResponse": { - "fields": { - "instances": { - "rule": "repeated", - "type": "Instance", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "StopInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Instance" - } - }, - "validateOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "StartInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Instance" - } - }, - "validateOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Instance": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Instance", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}", - "(google.api.resource).plural": "instances", - "(google.api.resource).singular": "instance" - }, - "oneofs": { - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 3 - }, - "uid": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generation": { - "type": "int64", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 7 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastModifier": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "client": { - "type": "string", - "id": 14 - }, - "clientVersion": { - "type": "string", - "id": 15 - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 16 - }, - "binaryAuthorization": { - "type": "BinaryAuthorization", - "id": 17 - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 19 - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 20, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 21 - }, - "encryptionKey": { - "type": "string", - "id": 22, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "encryptionKeyRevocationAction": { - "type": "EncryptionKeyRevocationAction", - "id": 24 - }, - "encryptionKeyShutdownDuration": { - "type": "google.protobuf.Duration", - "id": 25 - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 26, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "ingress": { - "type": "IngressTraffic", - "id": 28, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "invokerIamDisabled": { - "type": "bool", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "iapEnabled": { - "type": "bool", - "id": 30, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "observedGeneration": { - "type": "int64", - "id": 40, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logUri": { - "type": "string", - "id": 41, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "terminalCondition": { - "type": "Condition", - "id": 42, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 43, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "containerStatuses": { - "rule": "repeated", - "type": "ContainerStatus", - "id": 44, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 46, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "urls": { - "rule": "repeated", - "type": "string", - "id": 45, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 98, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstanceSplit": { - "fields": { - "type": { - "type": "InstanceSplitAllocationType", - "id": 1 - }, - "revision": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "percent": { - "type": "int32", - "id": 3 - } - } - }, - "InstanceSplitStatus": { - "fields": { - "type": { - "type": "InstanceSplitAllocationType", - "id": 1 - }, - "revision": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "percent": { - "type": "int32", - "id": 3 - } - } - }, - "InstanceSplitAllocationType": { - "values": { - "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED": 0, - "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST": 1, - "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION": 2 - } - }, - "Jobs": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateJob": { - "requestType": "CreateJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/jobs", - "(google.api.http).body": "job", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent,job,job_id", - "(google.longrunning.operation_info).response_type": "Job", - "(google.longrunning.operation_info).metadata_type": "Job" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/jobs", - "body": "job" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent,job,job_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Job", - "metadata_type": "Job" - } - } - ] - }, - "GetJob": { - "requestType": "GetJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/jobs/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListJobs": { - "requestType": "ListJobsRequest", - "responseType": "ListJobsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/jobs", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*}/jobs" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateJob": { - "requestType": "UpdateJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v2/{job.name=projects/*/locations/*/jobs/*}", - "(google.api.http).body": "job", - "(google.api.routing).routing_parameters.field": "job.name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "job", - "(google.longrunning.operation_info).response_type": "Job", - "(google.longrunning.operation_info).metadata_type": "Job" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{job.name=projects/*/locations/*/jobs/*}", - "body": "job" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "job.name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "job" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Job", - "metadata_type": "Job" - } - } - ] - }, - "DeleteJob": { - "requestType": "DeleteJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/jobs/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Job", - "(google.longrunning.operation_info).metadata_type": "Job" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Job", - "metadata_type": "Job" - } - } - ] - }, - "RunJob": { - "requestType": "RunJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/jobs/*}:run", - "(google.api.http).body": "*", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Execution", - "(google.longrunning.operation_info).metadata_type": "Execution" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/jobs/*}:run", - "body": "*" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Execution", - "metadata_type": "Execution" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).get": "/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy" - } - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "CreateJobRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Job" - } - }, - "job": { - "type": "Job", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "jobId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 4 - } - } - }, - "GetJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Job" - } - } - } - }, - "UpdateJobRequest": { - "fields": { - "job": { - "type": "Job", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 3 - }, - "allowMissing": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListJobsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Job" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListJobsResponse": { - "fields": { - "jobs": { - "rule": "repeated", - "type": "Job", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Job" - } - }, - "validateOnly": { - "type": "bool", - "id": 3 - }, - "etag": { - "type": "string", - "id": 4 - } - } - }, - "RunJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Job" - } - }, - "validateOnly": { - "type": "bool", - "id": 2 - }, - "etag": { - "type": "string", - "id": 3 - }, - "overrides": { - "type": "Overrides", - "id": 4 - } - }, - "nested": { - "Overrides": { - "fields": { - "containerOverrides": { - "rule": "repeated", - "type": "ContainerOverride", - "id": 1 - }, - "taskCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - }, - "nested": { - "ContainerOverride": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "env": { - "rule": "repeated", - "type": "EnvVar", - "id": 3 - }, - "clearArgs": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - } - } - }, - "Job": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Job", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "createExecution": { - "oneof": [ - "startExecutionToken", - "runExecutionToken" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "uid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 5 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastModifier": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "client": { - "type": "string", - "id": 12 - }, - "clientVersion": { - "type": "string", - "id": 13 - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 14 - }, - "binaryAuthorization": { - "type": "BinaryAuthorization", - "id": 15 - }, - "template": { - "type": "ExecutionTemplate", - "id": 16, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "observedGeneration": { - "type": "int64", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "terminalCondition": { - "type": "Condition", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executionCount": { - "type": "int32", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latestCreatedExecution": { - "type": "ExecutionReference", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 25, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startExecutionToken": { - "type": "string", - "id": 26 - }, - "runExecutionToken": { - "type": "string", - "id": 27 - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecutionReference": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "run.googleapis.com/Execution" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "completionTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "completionStatus": { - "type": "CompletionStatus", - "id": 4 - } - }, - "nested": { - "CompletionStatus": { - "values": { - "COMPLETION_STATUS_UNSPECIFIED": 0, - "EXECUTION_SUCCEEDED": 1, - "EXECUTION_FAILED": 2, - "EXECUTION_RUNNING": 3, - "EXECUTION_PENDING": 4, - "EXECUTION_CANCELLED": 5 - } - } - } - }, - "Revisions": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GetRevision": { - "requestType": "GetRevisionRequest", - "responseType": "Revision", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", - "additional_bindings": { - "get": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" - } - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListRevisions": { - "requestType": "ListRevisionsRequest", - "responseType": "ListRevisionsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*/services/*}/revisions", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*/workerPools/*}/revisions", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*/services/*}/revisions", - "additional_bindings": { - "get": "/v2/{parent=projects/*/locations/*/workerPools/*}/revisions" - } - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteRevision": { - "requestType": "DeleteRevisionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", - "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Revision", - "(google.longrunning.operation_info).metadata_type": "Revision" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", - "additional_bindings": { - "delete": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" - } - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Revision", - "metadata_type": "Revision" - } - } - ] - } - } - }, - "GetRevisionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - } - } - }, - "ListRevisionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Revision" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListRevisionsResponse": { - "fields": { - "revisions": { - "rule": "repeated", - "type": "Revision", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteRevisionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "validateOnly": { - "type": "bool", - "id": 2 - }, - "etag": { - "type": "string", - "id": 3 - } - } - }, - "Revision": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Revision", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/services/{service}/revisions/{revision}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "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" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 10 - }, - "service": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Service" - } - }, - "scaling": { - "type": "RevisionScaling", - "id": 12 - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 13 - }, - "maxInstanceRequestConcurrency": { - "type": "int32", - "id": 34 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 15 - }, - "serviceAccount": { - "type": "string", - "id": 16 - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 17 - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 18 - }, - "executionEnvironment": { - "type": "ExecutionEnvironment", - "id": 20 - }, - "encryptionKey": { - "type": "string", - "id": 21, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "serviceMesh": { - "type": "ServiceMesh", - "id": 22 - }, - "encryptionKeyRevocationAction": { - "type": "EncryptionKeyRevocationAction", - "id": 23 - }, - "encryptionKeyShutdownDuration": { - "type": "google.protobuf.Duration", - "id": 24 - }, - "reconciling": { - "type": "bool", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 31, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "observedGeneration": { - "type": "int64", - "id": 32, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logUri": { - "type": "string", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 37, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sessionAffinity": { - "type": "bool", - "id": 38 - }, - "scalingStatus": { - "type": "RevisionScalingStatus", - "id": 39, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 40 - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 48, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "creator": { - "type": "string", - "id": 49, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "RevisionScalingStatus": { - "fields": { - "desiredMinInstanceCount": { - "type": "int32", - "id": 1 - } - } - }, - "RevisionTemplate": { - "oneofs": { - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "fields": { - "revision": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scaling": { - "type": "RevisionScaling", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 10 - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "executionEnvironment": { - "type": "ExecutionEnvironment", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKey": { - "type": "string", - "id": 14, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "maxInstanceRequestConcurrency": { - "type": "int32", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceMesh": { - "type": "ServiceMesh", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKeyRevocationAction": { - "type": "EncryptionKeyRevocationAction", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKeyShutdownDuration": { - "type": "google.protobuf.Duration", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sessionAffinity": { - "type": "bool", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "healthCheckDisabled": { - "type": "bool", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 21, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 24, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "Services": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateService": { - "requestType": "CreateServiceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/services", - "(google.api.http).body": "service", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent,service,service_id", - "(google.longrunning.operation_info).response_type": "Service", - "(google.longrunning.operation_info).metadata_type": "Service" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/services", - "body": "service" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent,service,service_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Service", - "metadata_type": "Service" - } - } - ] - }, - "GetService": { - "requestType": "GetServiceRequest", - "responseType": "Service", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/services/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/services/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListServices": { - "requestType": "ListServicesRequest", - "responseType": "ListServicesResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/services", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*}/services" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateService": { - "requestType": "UpdateServiceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v2/{service.name=projects/*/locations/*/services/*}", - "(google.api.http).body": "service", - "(google.api.routing).routing_parameters.field": "service.name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "service,update_mask", - "(google.longrunning.operation_info).response_type": "Service", - "(google.longrunning.operation_info).metadata_type": "Service" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{service.name=projects/*/locations/*/services/*}", - "body": "service" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "service.name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "service" - }, - { - "(google.api.method_signature)": "service,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Service", - "metadata_type": "Service" - } - } - ] - }, - "DeleteService": { - "requestType": "DeleteServiceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/services/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Service", - "(google.longrunning.operation_info).metadata_type": "Service" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/services/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Service", - "metadata_type": "Service" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).get": "/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy" - } - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "CreateServiceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Service" - } - }, - "service": { - "type": "Service", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "serviceId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 4 - } - } - }, - "UpdateServiceRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "service": { - "type": "Service", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 3 - }, - "allowMissing": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListServicesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Service" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListServicesResponse": { - "fields": { - "services": { - "rule": "repeated", - "type": "Service", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GetServiceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Service" - } - } - } - }, - "DeleteServiceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Service" - } - }, - "validateOnly": { - "type": "bool", - "id": 2 - }, - "etag": { - "type": "string", - "id": 3 - } - } - }, - "Service": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Service", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/services/{service}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "description": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generation": { - "type": "int64", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastModifier": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "client": { - "type": "string", - "id": 13 - }, - "clientVersion": { - "type": "string", - "id": 14 - }, - "ingress": { - "type": "IngressTraffic", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "binaryAuthorization": { - "type": "BinaryAuthorization", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "template": { - "type": "RevisionTemplate", - "id": 18, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "traffic": { - "rule": "repeated", - "type": "TrafficTarget", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scaling": { - "type": "ServiceScaling", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "invokerIamDisabled": { - "type": "bool", - "id": 21, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "defaultUriDisabled": { - "type": "bool", - "id": 22, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "urls": { - "rule": "repeated", - "type": "string", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "iapEnabled": { - "type": "bool", - "id": 25, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "multiRegionSettings": { - "type": "MultiRegionSettings", - "id": 26, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "customAudiences": { - "rule": "repeated", - "type": "string", - "id": 37 - }, - "observedGeneration": { - "type": "int64", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "terminalCondition": { - "type": "Condition", - "id": 31, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 32, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latestReadyRevision": { - "type": "string", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "latestCreatedRevision": { - "type": "string", - "id": 34, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "trafficStatuses": { - "rule": "repeated", - "type": "TrafficTargetStatus", - "id": 35, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "uri": { - "type": "string", - "id": 36, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 38, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "threatDetectionEnabled": { - "type": "bool", - "id": 40, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "buildConfig": { - "type": "BuildConfig", - "id": 41, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "reconciling": { - "type": "bool", - "id": 98, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MultiRegionSettings": { - "fields": { - "regions": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "multiRegionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "TrafficTarget": { - "fields": { - "type": { - "type": "TrafficTargetAllocationType", - "id": 1 - }, - "revision": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "percent": { - "type": "int32", - "id": 3 - }, - "tag": { - "type": "string", - "id": 4 - } - } - }, - "TrafficTargetStatus": { - "fields": { - "type": { - "type": "TrafficTargetAllocationType", - "id": 1 - }, - "revision": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "percent": { - "type": "int32", - "id": 3 - }, - "tag": { - "type": "string", - "id": 4 - }, - "uri": { - "type": "string", - "id": 5 - } - } - }, - "TrafficTargetAllocationType": { - "values": { - "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED": 0, - "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST": 1, - "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION": 2 - } - }, - "Tasks": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GetTask": { - "requestType": "GetTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListTasks": { - "requestType": "ListTasksRequest", - "responseType": "ListTasksResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "GetTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Task" - } - } - } - }, - "ListTasksRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Task" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListTasksResponse": { - "fields": { - "tasks": { - "rule": "repeated", - "type": "Task", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "Task": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Task", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "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" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "scheduledTime": { - "type": "google.protobuf.Timestamp", - "id": 34, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 27, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "completionTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "job": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Job" - } - }, - "execution": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Execution" - } - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 14 - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 15 - }, - "maxRetries": { - "type": "int32", - "id": 16 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 17 - }, - "serviceAccount": { - "type": "string", - "id": 18 - }, - "executionEnvironment": { - "type": "ExecutionEnvironment", - "id": 20 - }, - "reconciling": { - "type": "bool", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "observedGeneration": { - "type": "int64", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "index": { - "type": "int32", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "retried": { - "type": "int32", - "id": 25, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastAttemptResult": { - "type": "TaskAttemptResult", - "id": 26, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionKey": { - "type": "string", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 29, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logUri": { - "type": "string", - "id": 32, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 36, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 37, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "TaskAttemptResult": { - "fields": { - "status": { - "type": "google.rpc.Status", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "exitCode": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "termSignal": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "WorkerPools": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateWorkerPool": { - "requestType": "CreateWorkerPoolRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/workerPools", - "(google.api.http).body": "worker_pool", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent,worker_pool,worker_pool_id", - "(google.longrunning.operation_info).response_type": "WorkerPool", - "(google.longrunning.operation_info).metadata_type": "WorkerPool" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/workerPools", - "body": "worker_pool" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent,worker_pool,worker_pool_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "WorkerPool", - "metadata_type": "WorkerPool" - } - } - ] - }, - "GetWorkerPool": { - "requestType": "GetWorkerPoolRequest", - "responseType": "WorkerPool", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/workerPools/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/workerPools/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListWorkerPools": { - "requestType": "ListWorkerPoolsRequest", - "responseType": "ListWorkerPoolsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/workerPools", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*}/workerPools" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateWorkerPool": { - "requestType": "UpdateWorkerPoolRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v2/{worker_pool.name=projects/*/locations/*/workerPools/*}", - "(google.api.http).body": "worker_pool", - "(google.api.routing).routing_parameters.field": "worker_pool.name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "worker_pool,update_mask", - "(google.longrunning.operation_info).response_type": "WorkerPool", - "(google.longrunning.operation_info).metadata_type": "WorkerPool" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{worker_pool.name=projects/*/locations/*/workerPools/*}", - "body": "worker_pool" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "worker_pool.name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "worker_pool" - }, - { - "(google.api.method_signature)": "worker_pool,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "WorkerPool", - "metadata_type": "WorkerPool" - } - } - ] - }, - "DeleteWorkerPool": { - "requestType": "DeleteWorkerPoolRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/workerPools/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "WorkerPool", - "(google.longrunning.operation_info).metadata_type": "WorkerPool" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/workerPools/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "WorkerPool", - "metadata_type": "WorkerPool" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).get": "/v2/{resource=projects/*/locations/*/workerPools/*}:getIamPolicy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{resource=projects/*/locations/*/workerPools/*}:getIamPolicy" - } - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/workerPools/*}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/workerPools/*}:setIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/workerPools/*}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/workerPools/*}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "CreateWorkerPoolRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/WorkerPool" - } - }, - "workerPool": { - "type": "WorkerPool", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "workerPoolId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateWorkerPoolRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "workerPool": { - "type": "WorkerPool", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "forceNewRevision": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListWorkerPoolsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/WorkerPool" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListWorkerPoolsResponse": { - "fields": { - "workerPools": { - "rule": "repeated", - "type": "WorkerPool", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetWorkerPoolRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/WorkerPool" - } - } - } - }, - "DeleteWorkerPoolRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/WorkerPool" - } - }, - "validateOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3 - } - } - }, - "WorkerPool": { - "options": { - "(google.api.resource).type": "run.googleapis.com/WorkerPool", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/workerPools/{worker_pool}", - "(google.api.resource).plural": "workerPools", - "(google.api.resource).singular": "workerPool", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generation": { - "type": "int64", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastModifier": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "client": { - "type": "string", - "id": 13 - }, - "clientVersion": { - "type": "string", - "id": 14 - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "binaryAuthorization": { - "type": "BinaryAuthorization", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "template": { - "type": "WorkerPoolRevisionTemplate", - "id": 18, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instanceSplits": { - "rule": "repeated", - "type": "InstanceSplit", - "id": 26, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scaling": { - "type": "WorkerPoolScaling", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "observedGeneration": { - "type": "int64", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "terminalCondition": { - "type": "Condition", - "id": 31, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 32, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latestReadyRevision": { - "type": "string", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "latestCreatedRevision": { - "type": "string", - "id": 34, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "instanceSplitStatuses": { - "rule": "repeated", - "type": "InstanceSplitStatus", - "id": 27, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "threatDetectionEnabled": { - "type": "bool", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "customAudiences": { - "rule": "repeated", - "type": "string", - "id": 37 - }, - "satisfiesPzs": { - "type": "bool", - "id": 38, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 98, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "WorkerPoolRevisionTemplate": { - "oneofs": { - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "fields": { - "revision": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 6 - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKey": { - "type": "string", - "id": 8, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "serviceMesh": { - "type": "ServiceMesh", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKeyRevocationAction": { - "type": "EncryptionKeyRevocationAction", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKeyShutdownDuration": { - "type": "google.protobuf.Duration", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "RoutingProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "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 - } - }, - "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 - } - } - }, - "routing": { - "type": "google.api.RoutingRule", - "id": 72295729, - "extend": "google.protobuf.MethodOptions" - }, - "RoutingRule": { - "fields": { - "routingParameters": { - "rule": "repeated", - "type": "RoutingParameter", - "id": 2 - } - } - }, - "RoutingParameter": { - "fields": { - "field": { - "type": "string", - "id": 1 - }, - "pathTemplate": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - }, - "iam": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", - "java_multiple_files": true, - "java_outer_classname": "PolicyProto", - "java_package": "com.google.iam.v1", - "php_namespace": "Google\\Cloud\\Iam\\V1" - }, - "nested": { - "IAMPolicy": { - "options": { - "(google.api.default_host)": "iam-meta-api.googleapis.com" - }, - "methods": { - "SetIamPolicy": { - "requestType": "SetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:setIamPolicy", - "body": "*" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "GetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:getIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "TestIamPermissionsRequest", - "responseType": "TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "SetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "policy": { - "type": "Policy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 3 - } - } - }, - "GetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "options": { - "type": "GetPolicyOptions", - "id": 2 - } - } - }, - "TestIamPermissionsRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "permissions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TestIamPermissionsResponse": { - "fields": { - "permissions": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "GetPolicyOptions": { - "fields": { - "requestedPolicyVersion": { - "type": "int32", - "id": 1 - } - } - }, - "Policy": { - "fields": { - "version": { - "type": "int32", - "id": 1 - }, - "bindings": { - "rule": "repeated", - "type": "Binding", - "id": 4 - }, - "auditConfigs": { - "rule": "repeated", - "type": "AuditConfig", - "id": 6 - }, - "etag": { - "type": "bytes", - "id": 3 - } - } - }, - "Binding": { - "fields": { - "role": { - "type": "string", - "id": 1 - }, - "members": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "condition": { - "type": "google.type.Expr", - "id": 3 - } - } - }, - "AuditConfig": { - "fields": { - "service": { - "type": "string", - "id": 1 - }, - "auditLogConfigs": { - "rule": "repeated", - "type": "AuditLogConfig", - "id": 3 - } - } - }, - "AuditLogConfig": { - "fields": { - "logType": { - "type": "LogType", - "id": 1 - }, - "exemptedMembers": { - "rule": "repeated", - "type": "string", - "id": 2 - } - }, - "nested": { - "LogType": { - "values": { - "LOG_TYPE_UNSPECIFIED": 0, - "ADMIN_READ": 1, - "DATA_WRITE": 2, - "DATA_READ": 3 - } - } - } - }, - "PolicyDelta": { - "fields": { - "bindingDeltas": { - "rule": "repeated", - "type": "BindingDelta", - "id": 1 - }, - "auditConfigDeltas": { - "rule": "repeated", - "type": "AuditConfigDelta", - "id": 2 - } - } - }, - "BindingDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "role": { - "type": "string", - "id": 2 - }, - "member": { - "type": "string", - "id": 3 - }, - "condition": { - "type": "google.type.Expr", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - }, - "AuditConfigDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "service": { - "type": "string", - "id": 2 - }, - "exemptedMember": { - "type": "string", - "id": 3 - }, - "logType": { - "type": "string", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - } - } - } - } - }, - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", - "java_multiple_files": true, - "java_outer_classname": "ExprProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Expr": { - "fields": { - "expression": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js deleted file mode 100644 index c9e3c774387..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, storageSource, imageUri) { - // [START run_v2_generated_Builds_SubmitBuild_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 project and location to build in. Location must be a region, - * e.g., 'us-central1' or 'global' if the global builder is to be used. - * Format: - * `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Required. Source for the build. - */ - // const storageSource = {} - /** - * Required. Artifact Registry URI to store the built image. - */ - // const imageUri = 'abc123' - /** - * Build the source using Buildpacks. - */ - // const buildpackBuild = {} - /** - * Build the source using Docker. This means the source has a Dockerfile. - */ - // const dockerBuild = {} - /** - * Optional. The service account to use for the build. If not set, the default - * Cloud Build service account for the project will be used. - */ - // const serviceAccount = 'abc123' - /** - * Optional. Name of the Cloud Build Custom Worker Pool that should be used to - * build the function. The format of this field is - * `projects/{project}/locations/{region}/workerPools/{workerPool}` where - * `{project}` and `{region}` are the project id and region respectively where - * the worker pool is defined and `{workerPool}` is the short name of the - * worker pool. - */ - // const workerPool = 'abc123' - /** - * Optional. Additional tags to annotate the build. - */ - // const tags = ['abc','def'] - /** - * Optional. The machine type from default pool to use for the build. If left - * blank, cloudbuild will use a sensible default. Currently only E2_HIGHCPU_8 - * is supported. If worker_pool is set, this field will be ignored. - */ - // const machineType = 'abc123' - /** - * Optional. The release track of the client that initiated the build request. - */ - // const releaseTrack = {} - /** - * Optional. The client that initiated the build request. - */ - // const client = 'abc123' - - // Imports the Run library - const {BuildsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new BuildsClient(); - - async function callSubmitBuild() { - // Construct request - const request = { - parent, - storageSource, - imageUri, - }; - - // Run request - const response = await runClient.submitBuild(request); - console.log(response); - } - - callSubmitBuild(); - // [END run_v2_generated_Builds_SubmitBuild_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-run/samples/generated/v2/executions.cancel_execution.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.cancel_execution.js deleted file mode 100644 index e5d07e70ce6..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.cancel_execution.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Executions_CancelExecution_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 name of the Execution to cancel. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * cancelling any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {ExecutionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ExecutionsClient(); - - async function callCancelExecution() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.cancelExecution(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCancelExecution(); - // [END run_v2_generated_Executions_CancelExecution_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-run/samples/generated/v2/executions.delete_execution.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.delete_execution.js deleted file mode 100644 index 4cf6452e469..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.delete_execution.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Executions_DeleteExecution_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 name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {ExecutionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ExecutionsClient(); - - async function callDeleteExecution() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.deleteExecution(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteExecution(); - // [END run_v2_generated_Executions_DeleteExecution_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-run/samples/generated/v2/executions.get_execution.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.get_execution.js deleted file mode 100644 index d93f467a9d5..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.get_execution.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 run_v2_generated_Executions_GetExecution_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 full name of the Execution. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - */ - // const name = 'abc123' - - // Imports the Run library - const {ExecutionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ExecutionsClient(); - - async function callGetExecution() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getExecution(request); - console.log(response); - } - - callGetExecution(); - // [END run_v2_generated_Executions_GetExecution_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-run/samples/generated/v2/executions.list_executions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.list_executions.js deleted file mode 100644 index a7019ecc2e2..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.list_executions.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_Executions_ListExecutions_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 Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - */ - // const parent = 'abc123' - /** - * Maximum number of Executions to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {ExecutionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ExecutionsClient(); - - async function callListExecutions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listExecutionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListExecutions(); - // [END run_v2_generated_Executions_ListExecutions_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-run/samples/generated/v2/jobs.create_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.create_job.js deleted file mode 100644 index f667a3423de..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.create_job.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, job, jobId) { - // [START run_v2_generated_Jobs_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 location and project in which this Job should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - */ - // const parent = 'abc123' - /** - * Required. The Job instance to create. - */ - // const job = {} - /** - * Required. The unique identifier for the Job. The name of the job becomes - * {parent}/jobs/{job_id}. - */ - // const jobId = 'abc123' - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - */ - // const validateOnly = true - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callCreateJob() { - // Construct request - const request = { - parent, - job, - jobId, - }; - - // Run request - const [operation] = await runClient.createJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateJob(); - // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.delete_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.delete_job.js deleted file mode 100644 index d1c47ab094f..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.delete_job.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Jobs_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. - */ - /** - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callDeleteJob() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.deleteJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteJob(); - // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.get_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js deleted file mode 100644 index b7a9ffdac4d..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource) { - // [START run_v2_generated_Jobs_GetIamPolicy_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 resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await runClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END run_v2_generated_Jobs_GetIamPolicy_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-run/samples/generated/v2/jobs.get_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_job.js deleted file mode 100644 index 14128597e57..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_job.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Jobs_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. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - */ - // const name = 'abc123' - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callGetJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getJob(request); - console.log(response); - } - - callGetJob(); - // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.list_jobs.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.list_jobs.js deleted file mode 100644 index 6841d7dd00f..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.list_jobs.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_Jobs_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. - */ - /** - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - */ - // const parent = 'abc123' - /** - * Maximum number of Jobs to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListJobs. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callListJobs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listJobsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListJobs(); - // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.run_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.run_job.js deleted file mode 100644 index 667b19a3569..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.run_job.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Jobs_RunJob_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 full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - /** - * Overrides specification for a given execution of a job. If provided, - * overrides will be applied to update the execution or task spec. - */ - // const overrides = {} - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callRunJob() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.runJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRunJob(); - // [END run_v2_generated_Jobs_RunJob_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-run/samples/generated/v2/jobs.set_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js deleted file mode 100644 index 252e9c83914..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, policy) { - // [START run_v2_generated_Jobs_SetIamPolicy_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 resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await runClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END run_v2_generated_Jobs_SetIamPolicy_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-run/samples/generated/v2/jobs.test_iam_permissions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js deleted file mode 100644 index 53cbddb3960..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, permissions) { - // [START run_v2_generated_Jobs_TestIamPermissions_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 resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = ['abc','def'] - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await runClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END run_v2_generated_Jobs_TestIamPermissions_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-run/samples/generated/v2/jobs.update_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.update_job.js deleted file mode 100644 index 3e18108e07c..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.update_job.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(job) { - // [START run_v2_generated_Jobs_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 be updated. - */ - // const job = {} - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - */ - // const validateOnly = true - /** - * Optional. If set to true, and if the Job does not exist, it will create a - * new one. Caller must have both create and update permissions for this call - * if this is set to true. - */ - // const allowMissing = true - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callUpdateJob() { - // Construct request - const request = { - job, - }; - - // Run request - const [operation] = await runClient.updateJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateJob(); - // [END run_v2_generated_Jobs_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-run/samples/generated/v2/revisions.delete_revision.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.delete_revision.js deleted file mode 100644 index c8f2d93d6eb..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.delete_revision.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Revisions_DeleteRevision_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 name of the Revision to delete. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the - * resource. This may be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {RevisionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new RevisionsClient(); - - async function callDeleteRevision() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.deleteRevision(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteRevision(); - // [END run_v2_generated_Revisions_DeleteRevision_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-run/samples/generated/v2/revisions.get_revision.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.get_revision.js deleted file mode 100644 index c5388577b21..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.get_revision.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Revisions_GetRevision_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 full name of the Revision. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - */ - // const name = 'abc123' - - // Imports the Run library - const {RevisionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new RevisionsClient(); - - async function callGetRevision() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getRevision(request); - console.log(response); - } - - callGetRevision(); - // [END run_v2_generated_Revisions_GetRevision_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-run/samples/generated/v2/revisions.list_revisions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.list_revisions.js deleted file mode 100644 index 3ab293f98f7..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.list_revisions.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_Revisions_ListRevisions_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 Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - */ - // const parent = 'abc123' - /** - * Maximum number of revisions to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {RevisionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new RevisionsClient(); - - async function callListRevisions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listRevisionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListRevisions(); - // [END run_v2_generated_Revisions_ListRevisions_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-run/samples/generated/v2/services.create_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.create_service.js deleted file mode 100644 index 6cec74a186b..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.create_service.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, service, serviceId) { - // [START run_v2_generated_Services_CreateService_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 location and project in which this service should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Only lowercase characters, digits, and hyphens. - */ - // const parent = 'abc123' - /** - * Required. The Service instance to create. - */ - // const service = {} - /** - * Required. The unique identifier for the Service. It must begin with letter, - * and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the service becomes {parent}/services/{service_id}. - */ - // const serviceId = 'abc123' - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - */ - // const validateOnly = true - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callCreateService() { - // Construct request - const request = { - parent, - service, - serviceId, - }; - - // Run request - const [operation] = await runClient.createService(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateService(); - // [END run_v2_generated_Services_CreateService_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-run/samples/generated/v2/services.delete_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.delete_service.js deleted file mode 100644 index 15fc933afbf..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.delete_service.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Services_DeleteService_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 full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callDeleteService() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.deleteService(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteService(); - // [END run_v2_generated_Services_DeleteService_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-run/samples/generated/v2/services.get_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_iam_policy.js deleted file mode 100644 index 43c848a8036..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource) { - // [START run_v2_generated_Services_GetIamPolicy_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 resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await runClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END run_v2_generated_Services_GetIamPolicy_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-run/samples/generated/v2/services.get_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_service.js deleted file mode 100644 index 817c4f8129a..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_service.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Services_GetService_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 full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - */ - // const name = 'abc123' - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callGetService() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getService(request); - console.log(response); - } - - callGetService(); - // [END run_v2_generated_Services_GetService_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-run/samples/generated/v2/services.list_services.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.list_services.js deleted file mode 100644 index 609e3ca2e81..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.list_services.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_Services_ListServices_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 location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - */ - // const parent = 'abc123' - /** - * Maximum number of Services to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListServices. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callListServices() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listServicesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListServices(); - // [END run_v2_generated_Services_ListServices_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-run/samples/generated/v2/services.set_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.set_iam_policy.js deleted file mode 100644 index 64b239c5461..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, policy) { - // [START run_v2_generated_Services_SetIamPolicy_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 resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await runClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END run_v2_generated_Services_SetIamPolicy_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-run/samples/generated/v2/services.test_iam_permissions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js deleted file mode 100644 index d69dc7c7991..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, permissions) { - // [START run_v2_generated_Services_TestIamPermissions_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 resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = ['abc','def'] - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await runClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END run_v2_generated_Services_TestIamPermissions_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-run/samples/generated/v2/services.update_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.update_service.js deleted file mode 100644 index fff4ac4ad3f..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.update_service.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(service) { - // [START run_v2_generated_Services_UpdateService_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. - */ - /** - * Optional. The list of fields to be updated. - */ - // const updateMask = {} - /** - * Required. The Service to be updated. - */ - // const service = {} - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - */ - // const validateOnly = true - /** - * Optional. If set to true, and if the Service does not exist, it will create - * a new one. The caller must have 'run.services.create' permissions if this - * is set to true and the Service does not exist. - */ - // const allowMissing = true - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callUpdateService() { - // Construct request - const request = { - service, - }; - - // Run request - const [operation] = await runClient.updateService(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateService(); - // [END run_v2_generated_Services_UpdateService_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-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json b/owl-bot-staging/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json deleted file mode 100644 index 4ff250fc8b5..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json +++ /dev/null @@ -1,1995 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-run", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.run.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "regionTag": "run_v2_generated_Builds_SubmitBuild_async", - "title": "Builds submitBuild Sample", - "origin": "API_DEFINITION", - "description": " Submits a build in a given project.", - "canonical": true, - "file": "builds.submit_build.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 106, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SubmitBuild", - "fullName": "google.cloud.run.v2.Builds.SubmitBuild", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "storage_source", - "type": ".google.cloud.run.v2.StorageSource" - }, - { - "name": "image_uri", - "type": "TYPE_STRING" - }, - { - "name": "buildpack_build", - "type": ".google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild" - }, - { - "name": "docker_build", - "type": ".google.cloud.run.v2.SubmitBuildRequest.DockerBuild" - }, - { - "name": "service_account", - "type": "TYPE_STRING" - }, - { - "name": "worker_pool", - "type": "TYPE_STRING" - }, - { - "name": "tags", - "type": "TYPE_STRING[]" - }, - { - "name": "machine_type", - "type": "TYPE_STRING" - }, - { - "name": "release_track", - "type": ".google.api.LaunchStage" - }, - { - "name": "client", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.SubmitBuildResponse", - "client": { - "shortName": "BuildsClient", - "fullName": "google.cloud.run.v2.BuildsClient" - }, - "method": { - "shortName": "SubmitBuild", - "fullName": "google.cloud.run.v2.Builds.SubmitBuild", - "service": { - "shortName": "Builds", - "fullName": "google.cloud.run.v2.Builds" - } - } - } - }, - { - "regionTag": "run_v2_generated_Executions_GetExecution_async", - "title": "Builds getExecution Sample", - "origin": "API_DEFINITION", - "description": " Gets information about an Execution.", - "canonical": true, - "file": "executions.get_execution.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetExecution", - "fullName": "google.cloud.run.v2.Executions.GetExecution", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Execution", - "client": { - "shortName": "ExecutionsClient", - "fullName": "google.cloud.run.v2.ExecutionsClient" - }, - "method": { - "shortName": "GetExecution", - "fullName": "google.cloud.run.v2.Executions.GetExecution", - "service": { - "shortName": "Executions", - "fullName": "google.cloud.run.v2.Executions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Executions_ListExecutions_async", - "title": "Builds listExecutions Sample", - "origin": "API_DEFINITION", - "description": " Lists Executions from a Job. Results are sorted by creation time, descending.", - "canonical": true, - "file": "executions.list_executions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListExecutions", - "fullName": "google.cloud.run.v2.Executions.ListExecutions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListExecutionsResponse", - "client": { - "shortName": "ExecutionsClient", - "fullName": "google.cloud.run.v2.ExecutionsClient" - }, - "method": { - "shortName": "ListExecutions", - "fullName": "google.cloud.run.v2.Executions.ListExecutions", - "service": { - "shortName": "Executions", - "fullName": "google.cloud.run.v2.Executions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Executions_DeleteExecution_async", - "title": "Builds deleteExecution Sample", - "origin": "API_DEFINITION", - "description": " Deletes an Execution.", - "canonical": true, - "file": "executions.delete_execution.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteExecution", - "fullName": "google.cloud.run.v2.Executions.DeleteExecution", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ExecutionsClient", - "fullName": "google.cloud.run.v2.ExecutionsClient" - }, - "method": { - "shortName": "DeleteExecution", - "fullName": "google.cloud.run.v2.Executions.DeleteExecution", - "service": { - "shortName": "Executions", - "fullName": "google.cloud.run.v2.Executions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Executions_CancelExecution_async", - "title": "Builds cancelExecution Sample", - "origin": "API_DEFINITION", - "description": " Cancels an Execution.", - "canonical": true, - "file": "executions.cancel_execution.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelExecution", - "fullName": "google.cloud.run.v2.Executions.CancelExecution", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ExecutionsClient", - "fullName": "google.cloud.run.v2.ExecutionsClient" - }, - "method": { - "shortName": "CancelExecution", - "fullName": "google.cloud.run.v2.Executions.CancelExecution", - "service": { - "shortName": "Executions", - "fullName": "google.cloud.run.v2.Executions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_CreateInstance_async", - "title": "Builds createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates an Instance.", - "canonical": true, - "file": "instances.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.run.v2.Instances.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.run.v2.Instance" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.run.v2.Instances.CreateInstance", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_DeleteInstance_async", - "title": "Builds deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes a Instance", - "canonical": true, - "file": "instances.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.run.v2.Instances.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.run.v2.Instances.DeleteInstance", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_GetInstance_async", - "title": "Builds getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets a Instance", - "canonical": true, - "file": "instances.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.run.v2.Instances.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Instance", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.run.v2.Instances.GetInstance", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_ListInstances_async", - "title": "Builds listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists Instances. Results are sorted by creation time, descending.", - "canonical": true, - "file": "instances.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.run.v2.Instances.ListInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListInstancesResponse", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.run.v2.Instances.ListInstances", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_StopInstance_async", - "title": "Builds stopInstance Sample", - "origin": "API_DEFINITION", - "description": " Stops an Instance.", - "canonical": true, - "file": "instances.stop_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StopInstance", - "fullName": "google.cloud.run.v2.Instances.StopInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "StopInstance", - "fullName": "google.cloud.run.v2.Instances.StopInstance", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_StartInstance_async", - "title": "Builds startInstance Sample", - "origin": "API_DEFINITION", - "description": " Starts an Instance.", - "canonical": true, - "file": "instances.start_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StartInstance", - "fullName": "google.cloud.run.v2.Instances.StartInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "StartInstance", - "fullName": "google.cloud.run.v2.Instances.StartInstance", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_CreateJob_async", - "title": "Builds createJob Sample", - "origin": "API_DEFINITION", - "description": " Creates a Job.", - "canonical": true, - "file": "jobs.create_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateJob", - "fullName": "google.cloud.run.v2.Jobs.CreateJob", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "job", - "type": ".google.cloud.run.v2.Job" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "CreateJob", - "fullName": "google.cloud.run.v2.Jobs.CreateJob", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_GetJob_async", - "title": "Builds getJob Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a Job.", - "canonical": true, - "file": "jobs.get_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJob", - "fullName": "google.cloud.run.v2.Jobs.GetJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Job", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "GetJob", - "fullName": "google.cloud.run.v2.Jobs.GetJob", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_ListJobs_async", - "title": "Builds listJobs Sample", - "origin": "API_DEFINITION", - "description": " Lists Jobs. Results are sorted by creation time, descending.", - "canonical": true, - "file": "jobs.list_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListJobs", - "fullName": "google.cloud.run.v2.Jobs.ListJobs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListJobsResponse", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "ListJobs", - "fullName": "google.cloud.run.v2.Jobs.ListJobs", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_UpdateJob_async", - "title": "Builds updateJob Sample", - "origin": "API_DEFINITION", - "description": " Updates a Job.", - "canonical": true, - "file": "jobs.update_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateJob", - "fullName": "google.cloud.run.v2.Jobs.UpdateJob", - "async": true, - "parameters": [ - { - "name": "job", - "type": ".google.cloud.run.v2.Job" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "UpdateJob", - "fullName": "google.cloud.run.v2.Jobs.UpdateJob", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_DeleteJob_async", - "title": "Builds deleteJob Sample", - "origin": "API_DEFINITION", - "description": " Deletes a Job.", - "canonical": true, - "file": "jobs.delete_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteJob", - "fullName": "google.cloud.run.v2.Jobs.DeleteJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "DeleteJob", - "fullName": "google.cloud.run.v2.Jobs.DeleteJob", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_RunJob_async", - "title": "Builds runJob Sample", - "origin": "API_DEFINITION", - "description": " Triggers creation of a new Execution of this Job.", - "canonical": true, - "file": "jobs.run_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunJob", - "fullName": "google.cloud.run.v2.Jobs.RunJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "overrides", - "type": ".google.cloud.run.v2.RunJobRequest.Overrides" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "RunJob", - "fullName": "google.cloud.run.v2.Jobs.RunJob", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_GetIamPolicy_async", - "title": "Builds getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the IAM Access Control policy currently in effect for the given Job. This result does not include any inherited policies.", - "canonical": true, - "file": "jobs.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.Jobs.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.Jobs.GetIamPolicy", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_SetIamPolicy_async", - "title": "Builds setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the IAM Access control policy for the specified Job. Overwrites any existing policy.", - "canonical": true, - "file": "jobs.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.Jobs.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.Jobs.SetIamPolicy", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_TestIamPermissions_async", - "title": "Builds testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.", - "canonical": true, - "file": "jobs.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.Jobs.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.Jobs.TestIamPermissions", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Revisions_GetRevision_async", - "title": "Builds getRevision Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a Revision.", - "canonical": true, - "file": "revisions.get_revision.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetRevision", - "fullName": "google.cloud.run.v2.Revisions.GetRevision", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Revision", - "client": { - "shortName": "RevisionsClient", - "fullName": "google.cloud.run.v2.RevisionsClient" - }, - "method": { - "shortName": "GetRevision", - "fullName": "google.cloud.run.v2.Revisions.GetRevision", - "service": { - "shortName": "Revisions", - "fullName": "google.cloud.run.v2.Revisions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Revisions_ListRevisions_async", - "title": "Builds listRevisions Sample", - "origin": "API_DEFINITION", - "description": " Lists Revisions from a given Service, or from a given location. Results are sorted by creation time, descending.", - "canonical": true, - "file": "revisions.list_revisions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListRevisions", - "fullName": "google.cloud.run.v2.Revisions.ListRevisions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListRevisionsResponse", - "client": { - "shortName": "RevisionsClient", - "fullName": "google.cloud.run.v2.RevisionsClient" - }, - "method": { - "shortName": "ListRevisions", - "fullName": "google.cloud.run.v2.Revisions.ListRevisions", - "service": { - "shortName": "Revisions", - "fullName": "google.cloud.run.v2.Revisions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Revisions_DeleteRevision_async", - "title": "Builds deleteRevision Sample", - "origin": "API_DEFINITION", - "description": " Deletes a Revision.", - "canonical": true, - "file": "revisions.delete_revision.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteRevision", - "fullName": "google.cloud.run.v2.Revisions.DeleteRevision", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "RevisionsClient", - "fullName": "google.cloud.run.v2.RevisionsClient" - }, - "method": { - "shortName": "DeleteRevision", - "fullName": "google.cloud.run.v2.Revisions.DeleteRevision", - "service": { - "shortName": "Revisions", - "fullName": "google.cloud.run.v2.Revisions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_CreateService_async", - "title": "Builds createService Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Service in a given project and location.", - "canonical": true, - "file": "services.create_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateService", - "fullName": "google.cloud.run.v2.Services.CreateService", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "service", - "type": ".google.cloud.run.v2.Service" - }, - { - "name": "service_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "CreateService", - "fullName": "google.cloud.run.v2.Services.CreateService", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_GetService_async", - "title": "Builds getService Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a Service.", - "canonical": true, - "file": "services.get_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetService", - "fullName": "google.cloud.run.v2.Services.GetService", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Service", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "GetService", - "fullName": "google.cloud.run.v2.Services.GetService", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_ListServices_async", - "title": "Builds listServices Sample", - "origin": "API_DEFINITION", - "description": " Lists Services. Results are sorted by creation time, descending.", - "canonical": true, - "file": "services.list_services.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListServices", - "fullName": "google.cloud.run.v2.Services.ListServices", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListServicesResponse", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "ListServices", - "fullName": "google.cloud.run.v2.Services.ListServices", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_UpdateService_async", - "title": "Builds updateService Sample", - "origin": "API_DEFINITION", - "description": " Updates a Service.", - "canonical": true, - "file": "services.update_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateService", - "fullName": "google.cloud.run.v2.Services.UpdateService", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "service", - "type": ".google.cloud.run.v2.Service" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "UpdateService", - "fullName": "google.cloud.run.v2.Services.UpdateService", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_DeleteService_async", - "title": "Builds deleteService Sample", - "origin": "API_DEFINITION", - "description": " Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.", - "canonical": true, - "file": "services.delete_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteService", - "fullName": "google.cloud.run.v2.Services.DeleteService", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "DeleteService", - "fullName": "google.cloud.run.v2.Services.DeleteService", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_GetIamPolicy_async", - "title": "Builds getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.", - "canonical": true, - "file": "services.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.Services.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.Services.GetIamPolicy", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_SetIamPolicy_async", - "title": "Builds setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.", - "canonical": true, - "file": "services.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.Services.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.Services.SetIamPolicy", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_TestIamPermissions_async", - "title": "Builds testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.", - "canonical": true, - "file": "services.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.Services.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.Services.TestIamPermissions", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Tasks_GetTask_async", - "title": "Builds getTask Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a Task.", - "canonical": true, - "file": "tasks.get_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTask", - "fullName": "google.cloud.run.v2.Tasks.GetTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Task", - "client": { - "shortName": "TasksClient", - "fullName": "google.cloud.run.v2.TasksClient" - }, - "method": { - "shortName": "GetTask", - "fullName": "google.cloud.run.v2.Tasks.GetTask", - "service": { - "shortName": "Tasks", - "fullName": "google.cloud.run.v2.Tasks" - } - } - } - }, - { - "regionTag": "run_v2_generated_Tasks_ListTasks_async", - "title": "Builds listTasks Sample", - "origin": "API_DEFINITION", - "description": " Lists Tasks from an Execution of a Job.", - "canonical": true, - "file": "tasks.list_tasks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTasks", - "fullName": "google.cloud.run.v2.Tasks.ListTasks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListTasksResponse", - "client": { - "shortName": "TasksClient", - "fullName": "google.cloud.run.v2.TasksClient" - }, - "method": { - "shortName": "ListTasks", - "fullName": "google.cloud.run.v2.Tasks.ListTasks", - "service": { - "shortName": "Tasks", - "fullName": "google.cloud.run.v2.Tasks" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_CreateWorkerPool_async", - "title": "Builds createWorkerPool Sample", - "origin": "API_DEFINITION", - "description": " Creates a new WorkerPool in a given project and location.", - "canonical": true, - "file": "worker_pools.create_worker_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.CreateWorkerPool", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "worker_pool", - "type": ".google.cloud.run.v2.WorkerPool" - }, - { - "name": "worker_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "CreateWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.CreateWorkerPool", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_GetWorkerPool_async", - "title": "Builds getWorkerPool Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a WorkerPool.", - "canonical": true, - "file": "worker_pools.get_worker_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.GetWorkerPool", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.WorkerPool", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "GetWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.GetWorkerPool", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_ListWorkerPools_async", - "title": "Builds listWorkerPools Sample", - "origin": "API_DEFINITION", - "description": " Lists WorkerPools. Results are sorted by creation time, descending.", - "canonical": true, - "file": "worker_pools.list_worker_pools.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListWorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools.ListWorkerPools", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListWorkerPoolsResponse", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "ListWorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools.ListWorkerPools", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_UpdateWorkerPool_async", - "title": "Builds updateWorkerPool Sample", - "origin": "API_DEFINITION", - "description": " Updates a WorkerPool.", - "canonical": true, - "file": "worker_pools.update_worker_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.UpdateWorkerPool", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "worker_pool", - "type": ".google.cloud.run.v2.WorkerPool" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - }, - { - "name": "force_new_revision", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "UpdateWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.UpdateWorkerPool", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_DeleteWorkerPool_async", - "title": "Builds deleteWorkerPool Sample", - "origin": "API_DEFINITION", - "description": " Deletes a WorkerPool.", - "canonical": true, - "file": "worker_pools.delete_worker_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.DeleteWorkerPool", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "DeleteWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.DeleteWorkerPool", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_GetIamPolicy_async", - "title": "Builds getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the IAM Access Control policy currently in effect for the given Cloud Run WorkerPool. This result does not include any inherited policies.", - "canonical": true, - "file": "worker_pools.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.WorkerPools.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.WorkerPools.GetIamPolicy", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_SetIamPolicy_async", - "title": "Builds setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the IAM Access control policy for the specified WorkerPool. Overwrites any existing policy.", - "canonical": true, - "file": "worker_pools.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.WorkerPools.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.WorkerPools.SetIamPolicy", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_TestIamPermissions_async", - "title": "Builds testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.", - "canonical": true, - "file": "worker_pools.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.WorkerPools.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.WorkerPools.TestIamPermissions", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js deleted file mode 100644 index c87bd60b7f7..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Tasks_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. The full name of the Task. - * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - */ - // const name = 'abc123' - - // Imports the Run library - const {TasksClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new TasksClient(); - - async function callGetTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getTask(request); - console.log(response); - } - - callGetTask(); - // [END run_v2_generated_Tasks_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-run/samples/generated/v2/tasks.list_tasks.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.list_tasks.js deleted file mode 100644 index 08ad5515de0..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.list_tasks.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_Tasks_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. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - */ - // const parent = 'abc123' - /** - * Maximum number of Tasks to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListTasks. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {TasksClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new TasksClient(); - - async function callListTasks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listTasksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTasks(); - // [END run_v2_generated_Tasks_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-run/samples/generated/v2/worker_pools.create_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js deleted file mode 100644 index f8685dd8aad..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, workerPool, workerPoolId) { - // [START run_v2_generated_WorkerPools_CreateWorkerPool_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 location and project in which this worker pool should be - * created. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. Only lowercase characters, digits, - * and hyphens. - */ - // const parent = 'abc123' - /** - * Required. The WorkerPool instance to create. - */ - // const workerPool = {} - /** - * Required. The unique identifier for the WorkerPool. It must begin with - * letter, and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the worker pool becomes - * `{parent}/workerPools/{worker_pool_id}`. - */ - // const workerPoolId = 'abc123' - /** - * Optional. Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - */ - // const validateOnly = true - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callCreateWorkerPool() { - // Construct request - const request = { - parent, - workerPool, - workerPoolId, - }; - - // Run request - const [operation] = await runClient.createWorkerPool(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateWorkerPool(); - // [END run_v2_generated_WorkerPools_CreateWorkerPool_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-run/samples/generated/v2/worker_pools.delete_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js deleted file mode 100644 index ed78edb9df4..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_WorkerPools_DeleteWorkerPool_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 full name of the WorkerPool. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - * `{project}` can be project id or number. - */ - // const name = 'abc123' - /** - * Optional. Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callDeleteWorkerPool() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.deleteWorkerPool(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteWorkerPool(); - // [END run_v2_generated_WorkerPools_DeleteWorkerPool_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-run/samples/generated/v2/worker_pools.get_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js deleted file mode 100644 index 12ac3d07e05..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource) { - // [START run_v2_generated_WorkerPools_GetIamPolicy_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 resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await runClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END run_v2_generated_WorkerPools_GetIamPolicy_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-run/samples/generated/v2/worker_pools.get_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js deleted file mode 100644 index 53f15c17f05..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 run_v2_generated_WorkerPools_GetWorkerPool_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 full name of the WorkerPool. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - * `{project}` can be project id or number. - */ - // const name = 'abc123' - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callGetWorkerPool() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getWorkerPool(request); - console.log(response); - } - - callGetWorkerPool(); - // [END run_v2_generated_WorkerPools_GetWorkerPool_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-run/samples/generated/v2/worker_pools.list_worker_pools.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js deleted file mode 100644 index d96211dd232..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_WorkerPools_ListWorkerPools_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 location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. - */ - // const parent = 'abc123' - /** - * Maximum number of WorkerPools to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListWorkerPools. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callListWorkerPools() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listWorkerPoolsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListWorkerPools(); - // [END run_v2_generated_WorkerPools_ListWorkerPools_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-run/samples/generated/v2/worker_pools.set_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js deleted file mode 100644 index 1e4c1332759..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, policy) { - // [START run_v2_generated_WorkerPools_SetIamPolicy_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 resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await runClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END run_v2_generated_WorkerPools_SetIamPolicy_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-run/samples/generated/v2/worker_pools.test_iam_permissions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js deleted file mode 100644 index ea171ddf125..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, permissions) { - // [START run_v2_generated_WorkerPools_TestIamPermissions_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 resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = ['abc','def'] - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await runClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END run_v2_generated_WorkerPools_TestIamPermissions_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-run/samples/generated/v2/worker_pools.update_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js deleted file mode 100644 index 43bcb8e1cfe..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workerPool) { - // [START run_v2_generated_WorkerPools_UpdateWorkerPool_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. - */ - /** - * Optional. The list of fields to be updated. - */ - // const updateMask = {} - /** - * Required. The WorkerPool to be updated. - */ - // const workerPool = {} - /** - * Optional. Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - */ - // const validateOnly = true - /** - * Optional. If set to true, and if the WorkerPool does not exist, it will - * create a new one. The caller must have 'run.workerpools.create' permissions - * if this is set to true and the WorkerPool does not exist. - */ - // const allowMissing = true - /** - * Optional. If set to true, a new revision will be created from the template - * even if the system doesn't detect any changes from the previously deployed - * revision. - * This may be useful for cases where the underlying resources need to be - * recreated or reinitialized. For example if the image is specified by label, - * but the underlying image digest has changed) or if the container performs - * deployment initialization work that needs to be performed again. - */ - // const forceNewRevision = true - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callUpdateWorkerPool() { - // Construct request - const request = { - workerPool, - }; - - // Run request - const [operation] = await runClient.updateWorkerPool(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateWorkerPool(); - // [END run_v2_generated_WorkerPools_UpdateWorkerPool_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-run/src/index.ts b/owl-bot-staging/google-cloud-run/src/index.ts deleted file mode 100644 index 3c28cf6bbfb..00000000000 --- a/owl-bot-staging/google-cloud-run/src/index.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 synthtool. ** -// ** https://github.com/googleapis/synthtool ** -// ** All changes to this file may be overwritten. ** - -import * as v2 from './v2'; - -const BuildsClient = v2.BuildsClient; -type BuildsClient = v2.BuildsClient; -const ExecutionsClient = v2.ExecutionsClient; -type ExecutionsClient = v2.ExecutionsClient; -const InstancesClient = v2.InstancesClient; -type InstancesClient = v2.InstancesClient; -const JobsClient = v2.JobsClient; -type JobsClient = v2.JobsClient; -const RevisionsClient = v2.RevisionsClient; -type RevisionsClient = v2.RevisionsClient; -const ServicesClient = v2.ServicesClient; -type ServicesClient = v2.ServicesClient; -const TasksClient = v2.TasksClient; -type TasksClient = v2.TasksClient; -const WorkerPoolsClient = v2.WorkerPoolsClient; -type WorkerPoolsClient = v2.WorkerPoolsClient; - -export {v2, BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; -export default {v2, BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-run/src/v2/builds_client.ts b/owl-bot-staging/google-cloud-run/src/v2/builds_client.ts deleted file mode 100644 index 9cbdf164888..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/builds_client.ts +++ /dev/null @@ -1,974 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/builds_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './builds_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Build Control Plane API - * @class - * @memberof v2 - */ -export class BuildsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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}; - buildsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BuildsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new BuildsClient({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 BuildsClient; - 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 = 'run.' + 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 = { - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - jobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Builds', 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.buildsStub) { - return this.buildsStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Builds. - this.buildsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Builds') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Builds, - 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 buildsStubMethods = - ['submitBuild']; - for (const methodName of buildsStubMethods) { - const callPromise = this.buildsStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.buildsStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Submits a build in a given project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location to build in. Location must be a region, - * e.g., 'us-central1' or 'global' if the global builder is to be used. - * Format: - * `projects/{project}/locations/{location}` - * @param {google.cloud.run.v2.StorageSource} request.storageSource - * Required. Source for the build. - * @param {string} request.imageUri - * Required. Artifact Registry URI to store the built image. - * @param {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} request.buildpackBuild - * Build the source using Buildpacks. - * @param {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} request.dockerBuild - * Build the source using Docker. This means the source has a Dockerfile. - * @param {string} [request.serviceAccount] - * Optional. The service account to use for the build. If not set, the default - * Cloud Build service account for the project will be used. - * @param {string} [request.workerPool] - * Optional. Name of the Cloud Build Custom Worker Pool that should be used to - * build the function. The format of this field is - * `projects/{project}/locations/{region}/workerPools/{workerPool}` where - * `{project}` and `{region}` are the project id and region respectively where - * the worker pool is defined and `{workerPool}` is the short name of the - * worker pool. - * @param {string[]} [request.tags] - * Optional. Additional tags to annotate the build. - * @param {string} [request.machineType] - * Optional. The machine type from default pool to use for the build. If left - * blank, cloudbuild will use a sensible default. Currently only E2_HIGHCPU_8 - * is supported. If worker_pool is set, this field will be ignored. - * @param {google.api.LaunchStage} [request.releaseTrack] - * Optional. The release track of the client that initiated the build request. - * @param {string} [request.client] - * Optional. The client that initiated the build request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.run.v2.SubmitBuildResponse|SubmitBuildResponse}. - * 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/v2/builds.submit_build.js - * region_tag:run_v2_generated_Builds_SubmitBuild_async - */ - submitBuild( - request?: protos.google.cloud.run.v2.ISubmitBuildRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|undefined, {}|undefined - ]>; - submitBuild( - request: protos.google.cloud.run.v2.ISubmitBuildRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, - {}|null|undefined>): void; - submitBuild( - request: protos.google.cloud.run.v2.ISubmitBuildRequest, - callback: Callback< - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, - {}|null|undefined>): void; - submitBuild( - request?: protos.google.cloud.run.v2.ISubmitBuildRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('submitBuild request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('submitBuild response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.submitBuild(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|undefined, - {}|undefined - ]) => { - this._log.info('submitBuild response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Gets information about a 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.buildsStub && !this._terminated) { - return this.buildsStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json deleted file mode 100644 index 91ddeab6580..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Builds": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "SubmitBuild": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/executions_client.ts b/owl-bot-staging/google-cloud-run/src/v2/executions_client.ts deleted file mode 100644 index 29b7e4871fb..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/executions_client.ts +++ /dev/null @@ -1,1722 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/executions_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './executions_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Execution Control Plane API. - * @class - * @memberof v2 - */ -export class ExecutionsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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; - executionsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ExecutionsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ExecutionsClient({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 ExecutionsClient; - 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 = 'run.' + 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 = { - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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 = { - listExecutions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'executions') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const deleteExecutionResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - const deleteExecutionMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - const cancelExecutionResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - const cancelExecutionMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteExecution: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteExecutionResponse.decode.bind(deleteExecutionResponse), - deleteExecutionMetadata.decode.bind(deleteExecutionMetadata)), - cancelExecution: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - cancelExecutionResponse.decode.bind(cancelExecutionResponse), - cancelExecutionMetadata.decode.bind(cancelExecutionMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Executions', 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.executionsStub) { - return this.executionsStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Executions. - this.executionsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Executions') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Executions, - 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 executionsStubMethods = - ['getExecution', 'listExecutions', 'deleteExecution', 'cancelExecution']; - for (const methodName of executionsStubMethods) { - const callPromise = this.executionsStub.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.executionsStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about an Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Execution. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.Execution|Execution}. - * 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/v2/executions.get_execution.js - * region_tag:run_v2_generated_Executions_GetExecution_async - */ - getExecution( - request?: protos.google.cloud.run.v2.IGetExecutionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|undefined, {}|undefined - ]>; - getExecution( - request: protos.google.cloud.run.v2.IGetExecutionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, - {}|null|undefined>): void; - getExecution( - request: protos.google.cloud.run.v2.IGetExecutionRequest, - callback: Callback< - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, - {}|null|undefined>): void; - getExecution( - request?: protos.google.cloud.run.v2.IGetExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getExecution request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getExecution response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getExecution(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getExecution response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Deletes an Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/executions.delete_execution.js - * region_tag:run_v2_generated_Executions_DeleteExecution_async - */ - deleteExecution( - request?: protos.google.cloud.run.v2.IDeleteExecutionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteExecution( - request: protos.google.cloud.run.v2.IDeleteExecutionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteExecution( - request: protos.google.cloud.run.v2.IDeleteExecutionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteExecution( - request?: protos.google.cloud.run.v2.IDeleteExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteExecution response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteExecution request %j', request); - return this.innerApiCalls.deleteExecution(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteExecution response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteExecution()`. - * @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/v2/executions.delete_execution.js - * region_tag:run_v2_generated_Executions_DeleteExecution_async - */ - async checkDeleteExecutionProgress(name: string): Promise>{ - this._log.info('deleteExecution long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteExecution, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Cancels an Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Execution to cancel. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * cancelling any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/executions.cancel_execution.js - * region_tag:run_v2_generated_Executions_CancelExecution_async - */ - cancelExecution( - request?: protos.google.cloud.run.v2.ICancelExecutionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - cancelExecution( - request: protos.google.cloud.run.v2.ICancelExecutionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelExecution( - request: protos.google.cloud.run.v2.ICancelExecutionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelExecution( - request?: protos.google.cloud.run.v2.ICancelExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('cancelExecution response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('cancelExecution request %j', request); - return this.innerApiCalls.cancelExecution(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('cancelExecution response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `cancelExecution()`. - * @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/v2/executions.cancel_execution.js - * region_tag:run_v2_generated_Executions_CancelExecution_async - */ - async checkCancelExecutionProgress(name: string): Promise>{ - this._log.info('cancelExecution long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.cancelExecution, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Executions from a Job. Results are sorted by creation time, - * descending. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of Executions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.Execution|Execution}. - * 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 `listExecutionsAsync()` - * 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. - */ - listExecutions( - request?: protos.google.cloud.run.v2.IListExecutionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IExecution[], - protos.google.cloud.run.v2.IListExecutionsRequest|null, - protos.google.cloud.run.v2.IListExecutionsResponse - ]>; - listExecutions( - request: protos.google.cloud.run.v2.IListExecutionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListExecutionsRequest, - protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, - protos.google.cloud.run.v2.IExecution>): void; - listExecutions( - request: protos.google.cloud.run.v2.IListExecutionsRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListExecutionsRequest, - protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, - protos.google.cloud.run.v2.IExecution>): void; - listExecutions( - request?: protos.google.cloud.run.v2.IListExecutionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListExecutionsRequest, - protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, - protos.google.cloud.run.v2.IExecution>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListExecutionsRequest, - protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, - protos.google.cloud.run.v2.IExecution>): - Promise<[ - protos.google.cloud.run.v2.IExecution[], - protos.google.cloud.run.v2.IListExecutionsRequest|null, - protos.google.cloud.run.v2.IListExecutionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListExecutionsRequest, - protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, - protos.google.cloud.run.v2.IExecution>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listExecutions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listExecutions request %j', request); - return this.innerApiCalls - .listExecutions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.IExecution[], - protos.google.cloud.run.v2.IListExecutionsRequest|null, - protos.google.cloud.run.v2.IListExecutionsResponse - ]) => { - this._log.info('listExecutions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listExecutions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of Executions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Execution|Execution} 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 `listExecutionsAsync()` - * 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. - */ - listExecutionsStream( - request?: protos.google.cloud.run.v2.IListExecutionsRequest, - 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['listExecutions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listExecutions stream %j', request); - return this.descriptors.page.listExecutions.createStream( - this.innerApiCalls.listExecutions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listExecutions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of Executions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Execution|Execution}. 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/v2/executions.list_executions.js - * region_tag:run_v2_generated_Executions_ListExecutions_async - */ - listExecutionsAsync( - request?: protos.google.cloud.run.v2.IListExecutionsRequest, - 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['listExecutions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listExecutions iterate %j', request); - return this.descriptors.page.listExecutions.asyncIterate( - this.innerApiCalls['listExecutions'] 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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.executionsStub && !this._terminated) { - return this.executionsStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json deleted file mode 100644 index 20bcbf69f35..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Executions": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "GetExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListExecutions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json b/owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json deleted file mode 100644 index 2276e2b6394..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json +++ /dev/null @@ -1,559 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.run.v2", - "libraryPackage": "@google-cloud/run", - "services": { - "Builds": { - "clients": { - "grpc": { - "libraryClient": "BuildsClient", - "rpcs": { - "SubmitBuild": { - "methods": [ - "submitBuild" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BuildsClient", - "rpcs": { - "SubmitBuild": { - "methods": [ - "submitBuild" - ] - } - } - } - } - }, - "Executions": { - "clients": { - "grpc": { - "libraryClient": "ExecutionsClient", - "rpcs": { - "GetExecution": { - "methods": [ - "getExecution" - ] - }, - "DeleteExecution": { - "methods": [ - "deleteExecution" - ] - }, - "CancelExecution": { - "methods": [ - "cancelExecution" - ] - }, - "ListExecutions": { - "methods": [ - "listExecutions", - "listExecutionsStream", - "listExecutionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ExecutionsClient", - "rpcs": { - "GetExecution": { - "methods": [ - "getExecution" - ] - }, - "DeleteExecution": { - "methods": [ - "deleteExecution" - ] - }, - "CancelExecution": { - "methods": [ - "cancelExecution" - ] - }, - "ListExecutions": { - "methods": [ - "listExecutions", - "listExecutionsStream", - "listExecutionsAsync" - ] - } - } - } - } - }, - "Instances": { - "clients": { - "grpc": { - "libraryClient": "InstancesClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "StopInstance": { - "methods": [ - "stopInstance" - ] - }, - "StartInstance": { - "methods": [ - "startInstance" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "InstancesClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "StopInstance": { - "methods": [ - "stopInstance" - ] - }, - "StartInstance": { - "methods": [ - "startInstance" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - } - } - } - } - }, - "Jobs": { - "clients": { - "grpc": { - "libraryClient": "JobsClient", - "rpcs": { - "GetJob": { - "methods": [ - "getJob" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "RunJob": { - "methods": [ - "runJob" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "JobsClient", - "rpcs": { - "GetJob": { - "methods": [ - "getJob" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "RunJob": { - "methods": [ - "runJob" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - } - } - } - } - }, - "Revisions": { - "clients": { - "grpc": { - "libraryClient": "RevisionsClient", - "rpcs": { - "GetRevision": { - "methods": [ - "getRevision" - ] - }, - "DeleteRevision": { - "methods": [ - "deleteRevision" - ] - }, - "ListRevisions": { - "methods": [ - "listRevisions", - "listRevisionsStream", - "listRevisionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "RevisionsClient", - "rpcs": { - "GetRevision": { - "methods": [ - "getRevision" - ] - }, - "DeleteRevision": { - "methods": [ - "deleteRevision" - ] - }, - "ListRevisions": { - "methods": [ - "listRevisions", - "listRevisionsStream", - "listRevisionsAsync" - ] - } - } - } - } - }, - "Services": { - "clients": { - "grpc": { - "libraryClient": "ServicesClient", - "rpcs": { - "GetService": { - "methods": [ - "getService" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateService": { - "methods": [ - "createService" - ] - }, - "UpdateService": { - "methods": [ - "updateService" - ] - }, - "DeleteService": { - "methods": [ - "deleteService" - ] - }, - "ListServices": { - "methods": [ - "listServices", - "listServicesStream", - "listServicesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ServicesClient", - "rpcs": { - "GetService": { - "methods": [ - "getService" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateService": { - "methods": [ - "createService" - ] - }, - "UpdateService": { - "methods": [ - "updateService" - ] - }, - "DeleteService": { - "methods": [ - "deleteService" - ] - }, - "ListServices": { - "methods": [ - "listServices", - "listServicesStream", - "listServicesAsync" - ] - } - } - } - } - }, - "Tasks": { - "clients": { - "grpc": { - "libraryClient": "TasksClient", - "rpcs": { - "GetTask": { - "methods": [ - "getTask" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "TasksClient", - "rpcs": { - "GetTask": { - "methods": [ - "getTask" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - } - } - }, - "WorkerPools": { - "clients": { - "grpc": { - "libraryClient": "WorkerPoolsClient", - "rpcs": { - "GetWorkerPool": { - "methods": [ - "getWorkerPool" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateWorkerPool": { - "methods": [ - "createWorkerPool" - ] - }, - "UpdateWorkerPool": { - "methods": [ - "updateWorkerPool" - ] - }, - "DeleteWorkerPool": { - "methods": [ - "deleteWorkerPool" - ] - }, - "ListWorkerPools": { - "methods": [ - "listWorkerPools", - "listWorkerPoolsStream", - "listWorkerPoolsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "WorkerPoolsClient", - "rpcs": { - "GetWorkerPool": { - "methods": [ - "getWorkerPool" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateWorkerPool": { - "methods": [ - "createWorkerPool" - ] - }, - "UpdateWorkerPool": { - "methods": [ - "updateWorkerPool" - ] - }, - "DeleteWorkerPool": { - "methods": [ - "deleteWorkerPool" - ] - }, - "ListWorkerPools": { - "methods": [ - "listWorkerPools", - "listWorkerPoolsStream", - "listWorkerPoolsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/index.ts b/owl-bot-staging/google-cloud-run/src/v2/index.ts deleted file mode 100644 index 6cc79ce5e90..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {BuildsClient} from './builds_client'; -export {ExecutionsClient} from './executions_client'; -export {InstancesClient} from './instances_client'; -export {JobsClient} from './jobs_client'; -export {RevisionsClient} from './revisions_client'; -export {ServicesClient} from './services_client'; -export {TasksClient} from './tasks_client'; -export {WorkerPoolsClient} from './worker_pools_client'; diff --git a/owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts b/owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts deleted file mode 100644 index dff326d9416..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts +++ /dev/null @@ -1,2361 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/jobs_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './jobs_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Job Control Plane API. - * @class - * @memberof v2 - */ -export class JobsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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; - jobsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of JobsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new JobsClient({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 JobsClient; - 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 = 'run.' + 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 = { - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createJobResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const createJobMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const updateJobResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const updateJobMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const deleteJobResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const deleteJobMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const runJobResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - const runJobMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createJobResponse.decode.bind(createJobResponse), - createJobMetadata.decode.bind(createJobMetadata)), - updateJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateJobResponse.decode.bind(updateJobResponse), - updateJobMetadata.decode.bind(updateJobMetadata)), - deleteJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteJobResponse.decode.bind(deleteJobResponse), - deleteJobMetadata.decode.bind(deleteJobMetadata)), - runJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - runJobResponse.decode.bind(runJobResponse), - runJobMetadata.decode.bind(runJobMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Jobs', 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.jobsStub) { - return this.jobsStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Jobs. - this.jobsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Jobs') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Jobs, - 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 jobsStubMethods = - ['createJob', 'getJob', 'listJobs', 'updateJob', 'deleteJob', 'runJob', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; - for (const methodName of jobsStubMethods) { - const callPromise = this.jobsStub.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.jobsStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.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/v2/jobs.get_job.js - * region_tag:run_v2_generated_Jobs_GetJob_async - */ - getJob( - request?: protos.google.cloud.run.v2.IGetJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|undefined, {}|undefined - ]>; - getJob( - request: protos.google.cloud.run.v2.IGetJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request: protos.google.cloud.run.v2.IGetJobRequest, - callback: Callback< - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request?: protos.google.cloud.run.v2.IGetJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('getJob request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getJob response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getJob(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|undefined, - {}|undefined - ]) => { - this._log.info('getJob response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets the IAM Access Control policy currently in effect for the given Job. - * This result does not include any inherited policies. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/jobs.get_iam_policy.js - * region_tag:run_v2_generated_Jobs_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Sets the IAM Access control policy for the specified Job. Overwrites - * any existing policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/jobs.set_iam_policy.js - * region_tag:run_v2_generated_Jobs_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Returns permissions that a caller has on the specified Project. - * - * There are no permissions required for making this API call. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/jobs.test_iam_permissions.js - * region_tag:run_v2_generated_Jobs_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project in which this Job should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * @param {google.cloud.run.v2.Job} request.job - * Required. The Job instance to create. - * @param {string} request.jobId - * Required. The unique identifier for the Job. The name of the job becomes - * {parent}/jobs/{job_id}. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.create_job.js - * region_tag:run_v2_generated_Jobs_CreateJob_async - */ - createJob( - request?: protos.google.cloud.run.v2.ICreateJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createJob( - request: protos.google.cloud.run.v2.ICreateJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createJob( - request: protos.google.cloud.run.v2.ICreateJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createJob( - request?: protos.google.cloud.run.v2.ICreateJobRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createJob response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createJob request %j', request); - return this.innerApiCalls.createJob(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createJob response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createJob()`. - * @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/v2/jobs.create_job.js - * region_tag:run_v2_generated_Jobs_CreateJob_async - */ - async checkCreateJobProgress(name: string): Promise>{ - this._log.info('createJob long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.run.v2.Job} request.job - * Required. The Job to be updated. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * @param {boolean} [request.allowMissing] - * Optional. If set to true, and if the Job does not exist, it will create a - * new one. Caller must have both create and update permissions for this call - * if this is set to true. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.update_job.js - * region_tag:run_v2_generated_Jobs_UpdateJob_async - */ - updateJob( - request?: protos.google.cloud.run.v2.IUpdateJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateJob( - request: protos.google.cloud.run.v2.IUpdateJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateJob( - request: protos.google.cloud.run.v2.IUpdateJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateJob( - request?: protos.google.cloud.run.v2.IUpdateJobRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.job?.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateJob response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateJob request %j', request); - return this.innerApiCalls.updateJob(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateJob response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateJob()`. - * @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/v2/jobs.update_job.js - * region_tag:run_v2_generated_Jobs_UpdateJob_async - */ - async checkUpdateJobProgress(name: string): Promise>{ - this._log.info('updateJob long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.delete_job.js - * region_tag:run_v2_generated_Jobs_DeleteJob_async - */ - deleteJob( - request?: protos.google.cloud.run.v2.IDeleteJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteJob( - request: protos.google.cloud.run.v2.IDeleteJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request: protos.google.cloud.run.v2.IDeleteJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request?: protos.google.cloud.run.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteJob response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteJob request %j', request); - return this.innerApiCalls.deleteJob(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteJob response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * 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/v2/jobs.delete_job.js - * region_tag:run_v2_generated_Jobs_DeleteJob_async - */ - async checkDeleteJobProgress(name: string): Promise>{ - this._log.info('deleteJob long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Triggers creation of a new Execution of this Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * @param {google.cloud.run.v2.RunJobRequest.Overrides} request.overrides - * Overrides specification for a given execution of a job. If provided, - * overrides will be applied to update the execution or task spec. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.run_job.js - * region_tag:run_v2_generated_Jobs_RunJob_async - */ - runJob( - request?: protos.google.cloud.run.v2.IRunJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - runJob( - request: protos.google.cloud.run.v2.IRunJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runJob( - request: protos.google.cloud.run.v2.IRunJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runJob( - request?: protos.google.cloud.run.v2.IRunJobRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('runJob response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('runJob request %j', request); - return this.innerApiCalls.runJob(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('runJob response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `runJob()`. - * @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/v2/jobs.run_job.js - * region_tag:run_v2_generated_Jobs_RunJob_async - */ - async checkRunJobProgress(name: string): Promise>{ - this._log.info('runJob long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Jobs. Results are sorted by creation time, descending. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * @param {number} request.pageSize - * Maximum number of Jobs to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListJobs. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.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.run.v2.IListJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IJob[], - protos.google.cloud.run.v2.IListJobsRequest|null, - protos.google.cloud.run.v2.IListJobsResponse - ]>; - listJobs( - request: protos.google.cloud.run.v2.IListJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListJobsRequest, - protos.google.cloud.run.v2.IListJobsResponse|null|undefined, - protos.google.cloud.run.v2.IJob>): void; - listJobs( - request: protos.google.cloud.run.v2.IListJobsRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListJobsRequest, - protos.google.cloud.run.v2.IListJobsResponse|null|undefined, - protos.google.cloud.run.v2.IJob>): void; - listJobs( - request?: protos.google.cloud.run.v2.IListJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListJobsRequest, - protos.google.cloud.run.v2.IListJobsResponse|null|undefined, - protos.google.cloud.run.v2.IJob>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListJobsRequest, - protos.google.cloud.run.v2.IListJobsResponse|null|undefined, - protos.google.cloud.run.v2.IJob>): - Promise<[ - protos.google.cloud.run.v2.IJob[], - protos.google.cloud.run.v2.IListJobsRequest|null, - protos.google.cloud.run.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListJobsRequest, - protos.google.cloud.run.v2.IListJobsResponse|null|undefined, - protos.google.cloud.run.v2.IJob>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listJobs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listJobs request %j', request); - return this.innerApiCalls - .listJobs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.IJob[], - protos.google.cloud.run.v2.IListJobsRequest|null, - protos.google.cloud.run.v2.IListJobsResponse - ]) => { - this._log.info('listJobs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listJobs`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * @param {number} request.pageSize - * Maximum number of Jobs to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListJobs. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.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.run.v2.IListJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listJobs stream %j', request); - 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 - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * @param {number} request.pageSize - * Maximum number of Jobs to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListJobs. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.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/v2/jobs.list_jobs.js - * region_tag:run_v2_generated_Jobs_ListJobs_async - */ - listJobsAsync( - request?: protos.google.cloud.run.v2.IListJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listJobs iterate %j', request); - return this.descriptors.page.listJobs.asyncIterate( - this.innerApiCalls['listJobs'] 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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.jobsStub && !this._terminated) { - return this.jobsStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json deleted file mode 100644 index 0751746db74..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Jobs": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RunJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts b/owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts deleted file mode 100644 index c2d97a21619..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts +++ /dev/null @@ -1,1716 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/revisions_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './revisions_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Revision Control Plane API. - * @class - * @memberof v2 - */ -export class RevisionsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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; - revisionsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of RevisionsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RevisionsClient({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 RevisionsClient; - 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 = 'run.' + 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 = { - cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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 = { - listRevisions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'revisions') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const deleteRevisionResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Revision') as gax.protobuf.Type; - const deleteRevisionMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Revision') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteRevision: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteRevisionResponse.decode.bind(deleteRevisionResponse), - deleteRevisionMetadata.decode.bind(deleteRevisionMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Revisions', 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.revisionsStub) { - return this.revisionsStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Revisions. - this.revisionsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Revisions') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Revisions, - 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 revisionsStubMethods = - ['getRevision', 'listRevisions', 'deleteRevision']; - for (const methodName of revisionsStubMethods) { - const callPromise = this.revisionsStub.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.revisionsStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about a Revision. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Revision. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.Revision|Revision}. - * 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/v2/revisions.get_revision.js - * region_tag:run_v2_generated_Revisions_GetRevision_async - */ - getRevision( - request?: protos.google.cloud.run.v2.IGetRevisionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|undefined, {}|undefined - ]>; - getRevision( - request: protos.google.cloud.run.v2.IGetRevisionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, - {}|null|undefined>): void; - getRevision( - request: protos.google.cloud.run.v2.IGetRevisionRequest, - callback: Callback< - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, - {}|null|undefined>): void; - getRevision( - request?: protos.google.cloud.run.v2.IGetRevisionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('getRevision request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getRevision response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getRevision(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getRevision response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Deletes a Revision. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Revision to delete. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the - * resource. This may be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/revisions.delete_revision.js - * region_tag:run_v2_generated_Revisions_DeleteRevision_async - */ - deleteRevision( - request?: protos.google.cloud.run.v2.IDeleteRevisionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteRevision( - request: protos.google.cloud.run.v2.IDeleteRevisionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteRevision( - request: protos.google.cloud.run.v2.IDeleteRevisionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteRevision( - request?: protos.google.cloud.run.v2.IDeleteRevisionRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteRevision response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteRevision request %j', request); - return this.innerApiCalls.deleteRevision(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteRevision response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteRevision()`. - * @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/v2/revisions.delete_revision.js - * region_tag:run_v2_generated_Revisions_DeleteRevision_async - */ - async checkDeleteRevisionProgress(name: string): Promise>{ - this._log.info('deleteRevision long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteRevision, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Revisions from a given Service, or from a given location. Results - * are sorted by creation time, descending. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * @param {number} request.pageSize - * Maximum number of revisions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.Revision|Revision}. - * 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 `listRevisionsAsync()` - * 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. - */ - listRevisions( - request?: protos.google.cloud.run.v2.IListRevisionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IRevision[], - protos.google.cloud.run.v2.IListRevisionsRequest|null, - protos.google.cloud.run.v2.IListRevisionsResponse - ]>; - listRevisions( - request: protos.google.cloud.run.v2.IListRevisionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListRevisionsRequest, - protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, - protos.google.cloud.run.v2.IRevision>): void; - listRevisions( - request: protos.google.cloud.run.v2.IListRevisionsRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListRevisionsRequest, - protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, - protos.google.cloud.run.v2.IRevision>): void; - listRevisions( - request?: protos.google.cloud.run.v2.IListRevisionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListRevisionsRequest, - protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, - protos.google.cloud.run.v2.IRevision>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListRevisionsRequest, - protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, - protos.google.cloud.run.v2.IRevision>): - Promise<[ - protos.google.cloud.run.v2.IRevision[], - protos.google.cloud.run.v2.IListRevisionsRequest|null, - protos.google.cloud.run.v2.IListRevisionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListRevisionsRequest, - protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, - protos.google.cloud.run.v2.IRevision>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listRevisions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listRevisions request %j', request); - return this.innerApiCalls - .listRevisions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.IRevision[], - protos.google.cloud.run.v2.IListRevisionsRequest|null, - protos.google.cloud.run.v2.IListRevisionsResponse - ]) => { - this._log.info('listRevisions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listRevisions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * @param {number} request.pageSize - * Maximum number of revisions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Revision|Revision} 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 `listRevisionsAsync()` - * 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. - */ - listRevisionsStream( - request?: protos.google.cloud.run.v2.IListRevisionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listRevisions stream %j', request); - return this.descriptors.page.listRevisions.createStream( - this.innerApiCalls.listRevisions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listRevisions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * @param {number} request.pageSize - * Maximum number of revisions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Revision|Revision}. 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/v2/revisions.list_revisions.js - * region_tag:run_v2_generated_Revisions_ListRevisions_async - */ - listRevisionsAsync( - request?: protos.google.cloud.run.v2.IListRevisionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listRevisions iterate %j', request); - return this.descriptors.page.listRevisions.asyncIterate( - this.innerApiCalls['listRevisions'] 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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified cryptoKey resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} key_ring - * @param {string} crypto_key - * @returns {string} Resource name string. - */ - cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { - return this.pathTemplates.cryptoKeyPathTemplate.render({ - project: project, - location: location, - key_ring: keyRing, - crypto_key: cryptoKey, - }); - } - - /** - * Parse the project from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; - } - - /** - * Parse the location from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; - } - - /** - * Parse the key_ring from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the key_ring. - */ - matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; - } - - /** - * Parse the crypto_key from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the crypto_key. - */ - matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.revisionsStub && !this._terminated) { - return this.revisionsStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json deleted file mode 100644 index f5a18a2ed2b..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Revisions": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "GetRevision": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListRevisions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteRevision": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/services_client.ts b/owl-bot-staging/google-cloud-run/src/v2/services_client.ts deleted file mode 100644 index 3fabf84fd3c..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/services_client.ts +++ /dev/null @@ -1,2232 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/services_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './services_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Service Control Plane API - * @class - * @memberof v2 - */ -export class ServicesClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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; - servicesStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ServicesClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ServicesClient({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 ServicesClient; - 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 = 'run.' + 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 = { - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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 = { - listServices: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'services') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createServiceResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - const createServiceMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - const updateServiceResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - const updateServiceMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - const deleteServiceResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - const deleteServiceMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createService: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createServiceResponse.decode.bind(createServiceResponse), - createServiceMetadata.decode.bind(createServiceMetadata)), - updateService: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateServiceResponse.decode.bind(updateServiceResponse), - updateServiceMetadata.decode.bind(updateServiceMetadata)), - deleteService: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteServiceResponse.decode.bind(deleteServiceResponse), - deleteServiceMetadata.decode.bind(deleteServiceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Services', 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.servicesStub) { - return this.servicesStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Services. - this.servicesStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Services') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Services, - 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 servicesStubMethods = - ['createService', 'getService', 'listServices', 'updateService', 'deleteService', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; - for (const methodName of servicesStubMethods) { - const callPromise = this.servicesStub.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.servicesStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about a Service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.Service|Service}. - * 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/v2/services.get_service.js - * region_tag:run_v2_generated_Services_GetService_async - */ - getService( - request?: protos.google.cloud.run.v2.IGetServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|undefined, {}|undefined - ]>; - getService( - request: protos.google.cloud.run.v2.IGetServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, - {}|null|undefined>): void; - getService( - request: protos.google.cloud.run.v2.IGetServiceRequest, - callback: Callback< - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, - {}|null|undefined>): void; - getService( - request?: protos.google.cloud.run.v2.IGetServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('getService request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getService response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getService(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getService response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets the IAM Access Control policy currently in effect for the given - * Cloud Run Service. This result does not include any inherited policies. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/services.get_iam_policy.js - * region_tag:run_v2_generated_Services_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Sets the IAM Access control policy for the specified Service. Overwrites - * any existing policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/services.set_iam_policy.js - * region_tag:run_v2_generated_Services_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Returns permissions that a caller has on the specified Project. - * - * There are no permissions required for making this API call. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/services.test_iam_permissions.js - * region_tag:run_v2_generated_Services_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a new Service in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project in which this service should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Only lowercase characters, digits, and hyphens. - * @param {google.cloud.run.v2.Service} request.service - * Required. The Service instance to create. - * @param {string} request.serviceId - * Required. The unique identifier for the Service. It must begin with letter, - * and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the service becomes {parent}/services/{service_id}. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/services.create_service.js - * region_tag:run_v2_generated_Services_CreateService_async - */ - createService( - request?: protos.google.cloud.run.v2.ICreateServiceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createService( - request: protos.google.cloud.run.v2.ICreateServiceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createService( - request: protos.google.cloud.run.v2.ICreateServiceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createService( - request?: protos.google.cloud.run.v2.ICreateServiceRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createService response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createService request %j', request); - return this.innerApiCalls.createService(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createService response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createService()`. - * @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/v2/services.create_service.js - * region_tag:run_v2_generated_Services_CreateService_async - */ - async checkCreateServiceProgress(name: string): Promise>{ - this._log.info('createService long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createService, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a Service. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The list of fields to be updated. - * @param {google.cloud.run.v2.Service} request.service - * Required. The Service to be updated. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * @param {boolean} [request.allowMissing] - * Optional. If set to true, and if the Service does not exist, it will create - * a new one. The caller must have 'run.services.create' permissions if this - * is set to true and the Service does not exist. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/services.update_service.js - * region_tag:run_v2_generated_Services_UpdateService_async - */ - updateService( - request?: protos.google.cloud.run.v2.IUpdateServiceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateService( - request: protos.google.cloud.run.v2.IUpdateServiceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateService( - request: protos.google.cloud.run.v2.IUpdateServiceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateService( - request?: protos.google.cloud.run.v2.IUpdateServiceRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.service?.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateService response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateService request %j', request); - return this.innerApiCalls.updateService(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateService response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateService()`. - * @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/v2/services.update_service.js - * region_tag:run_v2_generated_Services_UpdateService_async - */ - async checkUpdateServiceProgress(name: string): Promise>{ - this._log.info('updateService long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateService, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Service. - * This will cause the Service to stop serving traffic and will delete all - * revisions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/services.delete_service.js - * region_tag:run_v2_generated_Services_DeleteService_async - */ - deleteService( - request?: protos.google.cloud.run.v2.IDeleteServiceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteService( - request: protos.google.cloud.run.v2.IDeleteServiceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteService( - request: protos.google.cloud.run.v2.IDeleteServiceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteService( - request?: protos.google.cloud.run.v2.IDeleteServiceRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteService response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteService request %j', request); - return this.innerApiCalls.deleteService(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteService response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteService()`. - * @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/v2/services.delete_service.js - * region_tag:run_v2_generated_Services_DeleteService_async - */ - async checkDeleteServiceProgress(name: string): Promise>{ - this._log.info('deleteService long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteService, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Services. Results are sorted by creation time, descending. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - * @param {number} request.pageSize - * Maximum number of Services to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListServices. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.Service|Service}. - * 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 `listServicesAsync()` - * 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. - */ - listServices( - request?: protos.google.cloud.run.v2.IListServicesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IService[], - protos.google.cloud.run.v2.IListServicesRequest|null, - protos.google.cloud.run.v2.IListServicesResponse - ]>; - listServices( - request: protos.google.cloud.run.v2.IListServicesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListServicesRequest, - protos.google.cloud.run.v2.IListServicesResponse|null|undefined, - protos.google.cloud.run.v2.IService>): void; - listServices( - request: protos.google.cloud.run.v2.IListServicesRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListServicesRequest, - protos.google.cloud.run.v2.IListServicesResponse|null|undefined, - protos.google.cloud.run.v2.IService>): void; - listServices( - request?: protos.google.cloud.run.v2.IListServicesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListServicesRequest, - protos.google.cloud.run.v2.IListServicesResponse|null|undefined, - protos.google.cloud.run.v2.IService>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListServicesRequest, - protos.google.cloud.run.v2.IListServicesResponse|null|undefined, - protos.google.cloud.run.v2.IService>): - Promise<[ - protos.google.cloud.run.v2.IService[], - protos.google.cloud.run.v2.IListServicesRequest|null, - protos.google.cloud.run.v2.IListServicesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListServicesRequest, - protos.google.cloud.run.v2.IListServicesResponse|null|undefined, - protos.google.cloud.run.v2.IService>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listServices values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listServices request %j', request); - return this.innerApiCalls - .listServices(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.IService[], - protos.google.cloud.run.v2.IListServicesRequest|null, - protos.google.cloud.run.v2.IListServicesResponse - ]) => { - this._log.info('listServices values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listServices`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - * @param {number} request.pageSize - * Maximum number of Services to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListServices. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Service|Service} 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 `listServicesAsync()` - * 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. - */ - listServicesStream( - request?: protos.google.cloud.run.v2.IListServicesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listServices']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listServices stream %j', request); - return this.descriptors.page.listServices.createStream( - this.innerApiCalls.listServices as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listServices`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - * @param {number} request.pageSize - * Maximum number of Services to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListServices. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Service|Service}. 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/v2/services.list_services.js - * region_tag:run_v2_generated_Services_ListServices_async - */ - listServicesAsync( - request?: protos.google.cloud.run.v2.IListServicesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listServices']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listServices iterate %j', request); - return this.descriptors.page.listServices.asyncIterate( - this.innerApiCalls['listServices'] 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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.servicesStub && !this._terminated) { - return this.servicesStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/services_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/services_client_config.json deleted file mode 100644 index d9a33646b69..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/services_client_config.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Services": { - "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": { - "CreateService": { - "timeout_millis": 15000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetService": { - "timeout_millis": 10000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListServices": { - "timeout_millis": 10000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateService": { - "timeout_millis": 15000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteService": { - "timeout_millis": 10000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts b/owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts deleted file mode 100644 index 38b33a4e5dc..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts +++ /dev/null @@ -1,1293 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/tasks_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './tasks_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Task Control Plane API. - * @class - * @memberof v2 - */ -export class TasksClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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}; - tasksStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of TasksClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TasksClient({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 TasksClient; - 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 = 'run.' + 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 = { - cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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 = { - listTasks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Tasks', 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.tasksStub) { - return this.tasksStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Tasks. - this.tasksStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Tasks') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Tasks, - 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 tasksStubMethods = - ['getTask', 'listTasks']; - for (const methodName of tasksStubMethods) { - const callPromise = this.tasksStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.tasksStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about a Task. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Task. - * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.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/v2/tasks.get_task.js - * region_tag:run_v2_generated_Tasks_GetTask_async - */ - getTask( - request?: protos.google.cloud.run.v2.IGetTaskRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|undefined, {}|undefined - ]>; - getTask( - request: protos.google.cloud.run.v2.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request: protos.google.cloud.run.v2.IGetTaskRequest, - callback: Callback< - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request?: protos.google.cloud.run.v2.IGetTaskRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.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().catch(err => {throw err}); - this._log.info('getTask request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getTask response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getTask(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|undefined, - {}|undefined - ]) => { - this._log.info('getTask response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - - /** - * Lists Tasks from an Execution of a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * @param {number} request.pageSize - * Maximum number of Tasks to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListTasks. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.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.run.v2.IListTasksRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.ITask[], - protos.google.cloud.run.v2.IListTasksRequest|null, - protos.google.cloud.run.v2.IListTasksResponse - ]>; - listTasks( - request: protos.google.cloud.run.v2.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListTasksRequest, - protos.google.cloud.run.v2.IListTasksResponse|null|undefined, - protos.google.cloud.run.v2.ITask>): void; - listTasks( - request: protos.google.cloud.run.v2.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListTasksRequest, - protos.google.cloud.run.v2.IListTasksResponse|null|undefined, - protos.google.cloud.run.v2.ITask>): void; - listTasks( - request?: protos.google.cloud.run.v2.IListTasksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListTasksRequest, - protos.google.cloud.run.v2.IListTasksResponse|null|undefined, - protos.google.cloud.run.v2.ITask>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListTasksRequest, - protos.google.cloud.run.v2.IListTasksResponse|null|undefined, - protos.google.cloud.run.v2.ITask>): - Promise<[ - protos.google.cloud.run.v2.ITask[], - protos.google.cloud.run.v2.IListTasksRequest|null, - protos.google.cloud.run.v2.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().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListTasksRequest, - protos.google.cloud.run.v2.IListTasksResponse|null|undefined, - protos.google.cloud.run.v2.ITask>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listTasks values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listTasks request %j', request); - return this.innerApiCalls - .listTasks(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.ITask[], - protos.google.cloud.run.v2.IListTasksRequest|null, - protos.google.cloud.run.v2.IListTasksResponse - ]) => { - this._log.info('listTasks values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listTasks`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * @param {number} request.pageSize - * Maximum number of Tasks to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListTasks. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.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.run.v2.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().catch(err => {throw err}); - this._log.info('listTasks stream %j', request); - 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. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * @param {number} request.pageSize - * Maximum number of Tasks to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListTasks. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.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/v2/tasks.list_tasks.js - * region_tag:run_v2_generated_Tasks_ListTasks_async - */ - listTasksAsync( - request?: protos.google.cloud.run.v2.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().catch(err => {throw err}); - this._log.info('listTasks iterate %j', request); - 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified cryptoKey resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} key_ring - * @param {string} crypto_key - * @returns {string} Resource name string. - */ - cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { - return this.pathTemplates.cryptoKeyPathTemplate.render({ - project: project, - location: location, - key_ring: keyRing, - crypto_key: cryptoKey, - }); - } - - /** - * Parse the project from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; - } - - /** - * Parse the location from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; - } - - /** - * Parse the key_ring from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the key_ring. - */ - matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; - } - - /** - * Parse the crypto_key from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the crypto_key. - */ - matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.tasksStub && !this._terminated) { - return this.tasksStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json deleted file mode 100644 index c9fe28e061c..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Tasks": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "GetTask": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTasks": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts deleted file mode 100644 index 842874cf75c..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts +++ /dev/null @@ -1,2243 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/worker_pools_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './worker_pools_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run WorkerPool Control Plane API. - * @class - * @memberof v2 - */ -export class WorkerPoolsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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; - workerPoolsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of WorkerPoolsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new WorkerPoolsClient({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 WorkerPoolsClient; - 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 = 'run.' + 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 = { - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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 = { - listWorkerPools: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workerPools') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createWorkerPoolResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - const createWorkerPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - const updateWorkerPoolResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - const updateWorkerPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - const deleteWorkerPoolResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - const deleteWorkerPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createWorkerPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createWorkerPoolResponse.decode.bind(createWorkerPoolResponse), - createWorkerPoolMetadata.decode.bind(createWorkerPoolMetadata)), - updateWorkerPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateWorkerPoolResponse.decode.bind(updateWorkerPoolResponse), - updateWorkerPoolMetadata.decode.bind(updateWorkerPoolMetadata)), - deleteWorkerPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteWorkerPoolResponse.decode.bind(deleteWorkerPoolResponse), - deleteWorkerPoolMetadata.decode.bind(deleteWorkerPoolMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.WorkerPools', 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.workerPoolsStub) { - return this.workerPoolsStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.WorkerPools. - this.workerPoolsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.WorkerPools') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.WorkerPools, - 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 workerPoolsStubMethods = - ['createWorkerPool', 'getWorkerPool', 'listWorkerPools', 'updateWorkerPool', 'deleteWorkerPool', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; - for (const methodName of workerPoolsStubMethods) { - const callPromise = this.workerPoolsStub.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.workerPoolsStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about a WorkerPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the WorkerPool. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - * `{project}` can be project id or number. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.WorkerPool|WorkerPool}. - * 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/v2/worker_pools.get_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_GetWorkerPool_async - */ - getWorkerPool( - request?: protos.google.cloud.run.v2.IGetWorkerPoolRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|undefined, {}|undefined - ]>; - getWorkerPool( - request: protos.google.cloud.run.v2.IGetWorkerPoolRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, - {}|null|undefined>): void; - getWorkerPool( - request: protos.google.cloud.run.v2.IGetWorkerPoolRequest, - callback: Callback< - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, - {}|null|undefined>): void; - getWorkerPool( - request?: protos.google.cloud.run.v2.IGetWorkerPoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('getWorkerPool request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getWorkerPool response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getWorkerPool(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|undefined, - {}|undefined - ]) => { - this._log.info('getWorkerPool response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets the IAM Access Control policy currently in effect for the given - * Cloud Run WorkerPool. This result does not include any inherited policies. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/worker_pools.get_iam_policy.js - * region_tag:run_v2_generated_WorkerPools_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Sets the IAM Access control policy for the specified WorkerPool. Overwrites - * any existing policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/worker_pools.set_iam_policy.js - * region_tag:run_v2_generated_WorkerPools_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Returns permissions that a caller has on the specified Project. - * - * There are no permissions required for making this API call. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/worker_pools.test_iam_permissions.js - * region_tag:run_v2_generated_WorkerPools_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a new WorkerPool in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project in which this worker pool should be - * created. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. Only lowercase characters, digits, - * and hyphens. - * @param {google.cloud.run.v2.WorkerPool} request.workerPool - * Required. The WorkerPool instance to create. - * @param {string} request.workerPoolId - * Required. The unique identifier for the WorkerPool. It must begin with - * letter, and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the worker pool becomes - * `{parent}/workerPools/{worker_pool_id}`. - * @param {boolean} [request.validateOnly] - * Optional. Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/worker_pools.create_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_CreateWorkerPool_async - */ - createWorkerPool( - request?: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createWorkerPool( - request: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createWorkerPool( - request: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createWorkerPool( - request?: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createWorkerPool response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createWorkerPool request %j', request); - return this.innerApiCalls.createWorkerPool(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createWorkerPool response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createWorkerPool()`. - * @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/v2/worker_pools.create_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_CreateWorkerPool_async - */ - async checkCreateWorkerPoolProgress(name: string): Promise>{ - this._log.info('createWorkerPool long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createWorkerPool, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a WorkerPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The list of fields to be updated. - * @param {google.cloud.run.v2.WorkerPool} request.workerPool - * Required. The WorkerPool to be updated. - * @param {boolean} [request.validateOnly] - * Optional. Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * @param {boolean} [request.allowMissing] - * Optional. If set to true, and if the WorkerPool does not exist, it will - * create a new one. The caller must have 'run.workerpools.create' permissions - * if this is set to true and the WorkerPool does not exist. - * @param {boolean} [request.forceNewRevision] - * Optional. If set to true, a new revision will be created from the template - * even if the system doesn't detect any changes from the previously deployed - * revision. - * - * This may be useful for cases where the underlying resources need to be - * recreated or reinitialized. For example if the image is specified by label, - * but the underlying image digest has changed) or if the container performs - * deployment initialization work that needs to be performed again. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/worker_pools.update_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_UpdateWorkerPool_async - */ - updateWorkerPool( - request?: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateWorkerPool( - request: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateWorkerPool( - request: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateWorkerPool( - request?: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.workerPool?.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateWorkerPool response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateWorkerPool request %j', request); - return this.innerApiCalls.updateWorkerPool(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateWorkerPool response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateWorkerPool()`. - * @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/v2/worker_pools.update_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_UpdateWorkerPool_async - */ - async checkUpdateWorkerPoolProgress(name: string): Promise>{ - this._log.info('updateWorkerPool long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateWorkerPool, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a WorkerPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the WorkerPool. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - * `{project}` can be project id or number. - * @param {boolean} [request.validateOnly] - * Optional. Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/worker_pools.delete_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_DeleteWorkerPool_async - */ - deleteWorkerPool( - request?: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteWorkerPool( - request: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteWorkerPool( - request: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteWorkerPool( - request?: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteWorkerPool response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteWorkerPool request %j', request); - return this.innerApiCalls.deleteWorkerPool(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteWorkerPool response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteWorkerPool()`. - * @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/v2/worker_pools.delete_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_DeleteWorkerPool_async - */ - async checkDeleteWorkerPoolProgress(name: string): Promise>{ - this._log.info('deleteWorkerPool long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteWorkerPool, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists WorkerPools. Results are sorted by creation time, descending. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of WorkerPools to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListWorkerPools. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.WorkerPool|WorkerPool}. - * 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 `listWorkerPoolsAsync()` - * 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. - */ - listWorkerPools( - request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IWorkerPool[], - protos.google.cloud.run.v2.IListWorkerPoolsRequest|null, - protos.google.cloud.run.v2.IListWorkerPoolsResponse - ]>; - listWorkerPools( - request: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListWorkerPoolsRequest, - protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, - protos.google.cloud.run.v2.IWorkerPool>): void; - listWorkerPools( - request: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListWorkerPoolsRequest, - protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, - protos.google.cloud.run.v2.IWorkerPool>): void; - listWorkerPools( - request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListWorkerPoolsRequest, - protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, - protos.google.cloud.run.v2.IWorkerPool>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListWorkerPoolsRequest, - protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, - protos.google.cloud.run.v2.IWorkerPool>): - Promise<[ - protos.google.cloud.run.v2.IWorkerPool[], - protos.google.cloud.run.v2.IListWorkerPoolsRequest|null, - protos.google.cloud.run.v2.IListWorkerPoolsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListWorkerPoolsRequest, - protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, - protos.google.cloud.run.v2.IWorkerPool>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listWorkerPools values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listWorkerPools request %j', request); - return this.innerApiCalls - .listWorkerPools(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.IWorkerPool[], - protos.google.cloud.run.v2.IListWorkerPoolsRequest|null, - protos.google.cloud.run.v2.IListWorkerPoolsResponse - ]) => { - this._log.info('listWorkerPools values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listWorkerPools`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of WorkerPools to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListWorkerPools. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.WorkerPool|WorkerPool} 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 `listWorkerPoolsAsync()` - * 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. - */ - listWorkerPoolsStream( - request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listWorkerPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listWorkerPools stream %j', request); - return this.descriptors.page.listWorkerPools.createStream( - this.innerApiCalls.listWorkerPools as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listWorkerPools`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of WorkerPools to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListWorkerPools. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.WorkerPool|WorkerPool}. 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/v2/worker_pools.list_worker_pools.js - * region_tag:run_v2_generated_WorkerPools_ListWorkerPools_async - */ - listWorkerPoolsAsync( - request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listWorkerPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listWorkerPools iterate %j', request); - return this.descriptors.page.listWorkerPools.asyncIterate( - this.innerApiCalls['listWorkerPools'] 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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.workerPoolsStub && !this._terminated) { - return this.workerPoolsStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json deleted file mode 100644 index ac049ec5316..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.WorkerPools": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateWorkerPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetWorkerPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListWorkerPools": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateWorkerPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteWorkerPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js deleted file mode 100644 index b75bcd5378f..00000000000 --- a/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const run = require('@google-cloud/run'); - -function main() { - const buildsClient = new run.BuildsClient(); - const executionsClient = new run.ExecutionsClient(); - const instancesClient = new run.InstancesClient(); - const jobsClient = new run.JobsClient(); - const revisionsClient = new run.RevisionsClient(); - const servicesClient = new run.ServicesClient(); - const tasksClient = new run.TasksClient(); - const workerPoolsClient = new run.WorkerPoolsClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index bdf1cc11f53..00000000000 --- a/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient} from '@google-cloud/run'; - -// check that the client class type name can be used -function doStuffWithBuildsClient(client: BuildsClient) { - client.close(); -} -function doStuffWithExecutionsClient(client: ExecutionsClient) { - client.close(); -} -function doStuffWithInstancesClient(client: InstancesClient) { - client.close(); -} -function doStuffWithJobsClient(client: JobsClient) { - client.close(); -} -function doStuffWithRevisionsClient(client: RevisionsClient) { - client.close(); -} -function doStuffWithServicesClient(client: ServicesClient) { - client.close(); -} -function doStuffWithTasksClient(client: TasksClient) { - client.close(); -} -function doStuffWithWorkerPoolsClient(client: WorkerPoolsClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const buildsClient = new BuildsClient(); - doStuffWithBuildsClient(buildsClient); - // check that the client instance can be created - const executionsClient = new ExecutionsClient(); - doStuffWithExecutionsClient(executionsClient); - // check that the client instance can be created - const instancesClient = new InstancesClient(); - doStuffWithInstancesClient(instancesClient); - // check that the client instance can be created - const jobsClient = new JobsClient(); - doStuffWithJobsClient(jobsClient); - // check that the client instance can be created - const revisionsClient = new RevisionsClient(); - doStuffWithRevisionsClient(revisionsClient); - // check that the client instance can be created - const servicesClient = new ServicesClient(); - doStuffWithServicesClient(servicesClient); - // check that the client instance can be created - const tasksClient = new TasksClient(); - doStuffWithTasksClient(tasksClient); - // check that the client instance can be created - const workerPoolsClient = new WorkerPoolsClient(); - doStuffWithWorkerPoolsClient(workerPoolsClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-run/system-test/install.ts b/owl-bot-staging/google-cloud-run/system-test/install.ts deleted file mode 100644 index 394f3362d20..00000000000 --- a/owl-bot-staging/google-cloud-run/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {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-run/test/gapic_builds_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_builds_v2.ts deleted file mode 100644 index a0a18108510..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_builds_v2.ts +++ /dev/null @@ -1,865 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as buildsModule from '../src'; - -import {protobuf, 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 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('v2.BuildsClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new buildsModule.v2.BuildsClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new buildsModule.v2.BuildsClient(); - 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 = buildsModule.v2.BuildsClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = buildsModule.v2.BuildsClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new buildsModule.v2.BuildsClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new buildsModule.v2.BuildsClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 buildsModule.v2.BuildsClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 buildsModule.v2.BuildsClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 buildsModule.v2.BuildsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = buildsModule.v2.BuildsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new buildsModule.v2.BuildsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new buildsModule.v2.BuildsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.buildsStub, undefined); - await client.initialize(); - assert(client.buildsStub); - }); - - it('has close method for the initialized client', done => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.buildsStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.buildsStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new buildsModule.v2.BuildsClient({ - 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 buildsModule.v2.BuildsClient({ - 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('submitBuild', () => { - it('invokes submitBuild without error', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildResponse() - ); - client.innerApiCalls.submitBuild = stubSimpleCall(expectedResponse); - const [response] = await client.submitBuild(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitBuild without error using callback', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildResponse() - ); - client.innerApiCalls.submitBuild = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.submitBuild( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.ISubmitBuildResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitBuild with error', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.submitBuild = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.submitBuild(request), expectedError); - const actualRequest = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitBuild with closed client', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.submitBuild(request), expectedError); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('Path templates', () => { - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts deleted file mode 100644 index 69f44a4308b..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts +++ /dev/null @@ -1,1784 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as executionsModule 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('v2.ExecutionsClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new executionsModule.v2.ExecutionsClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new executionsModule.v2.ExecutionsClient(); - 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 = executionsModule.v2.ExecutionsClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = executionsModule.v2.ExecutionsClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new executionsModule.v2.ExecutionsClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new executionsModule.v2.ExecutionsClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 executionsModule.v2.ExecutionsClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 executionsModule.v2.ExecutionsClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 executionsModule.v2.ExecutionsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = executionsModule.v2.ExecutionsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new executionsModule.v2.ExecutionsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new executionsModule.v2.ExecutionsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.executionsStub, undefined); - await client.initialize(); - assert(client.executionsStub); - }); - - it('has close method for the initialized client', done => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.executionsStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.executionsStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new executionsModule.v2.ExecutionsClient({ - 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 executionsModule.v2.ExecutionsClient({ - 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('getExecution', () => { - it('invokes getExecution without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Execution() - ); - client.innerApiCalls.getExecution = stubSimpleCall(expectedResponse); - const [response] = await client.getExecution(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExecution without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Execution() - ); - client.innerApiCalls.getExecution = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getExecution( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IExecution|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExecution with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExecution with closed client', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getExecution(request), expectedError); - }); - }); - - describe('deleteExecution', () => { - it('invokes deleteExecution without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteExecution = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteExecution(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExecution without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteExecution = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteExecution( - 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.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExecution with call error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExecution with LRO error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteExecution(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteExecutionProgress without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteExecutionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteExecutionProgress with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteExecutionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('cancelExecution', () => { - it('invokes cancelExecution without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CancelExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.cancelExecution = stubLongRunningCall(expectedResponse); - const [operation] = await client.cancelExecution(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelExecution without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CancelExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.cancelExecution = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelExecution( - 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.cancelExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelExecution with call error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CancelExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelExecution = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.cancelExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelExecution with LRO error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CancelExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelExecution = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.cancelExecution(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCancelExecutionProgress without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCancelExecutionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCancelExecutionProgress with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCancelExecutionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listExecutions', () => { - it('invokes listExecutions without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - ]; - client.innerApiCalls.listExecutions = stubSimpleCall(expectedResponse); - const [response] = await client.listExecutions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExecutions without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - ]; - client.innerApiCalls.listExecutions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listExecutions( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IExecution[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExecutions with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listExecutions(request), expectedError); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExecutionsStream without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - ]; - client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listExecutionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Execution[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Execution) => { - 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.listExecutions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); - assert( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listExecutionsStream with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listExecutionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Execution[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Execution) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); - assert( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExecutions without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - ]; - client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.IExecution[] = []; - const iterable = client.listExecutionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExecutions with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listExecutionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.run.v2.IExecution[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExecutions.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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts deleted file mode 100644 index 014c64087bf..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts +++ /dev/null @@ -1,2393 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as jobsModule 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('v2.JobsClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new jobsModule.v2.JobsClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new jobsModule.v2.JobsClient(); - 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 = jobsModule.v2.JobsClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = jobsModule.v2.JobsClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new jobsModule.v2.JobsClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new jobsModule.v2.JobsClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 jobsModule.v2.JobsClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 jobsModule.v2.JobsClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 jobsModule.v2.JobsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = jobsModule.v2.JobsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new jobsModule.v2.JobsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new jobsModule.v2.JobsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.jobsStub, undefined); - await client.initialize(); - assert(client.jobsStub); - }); - - it('has close method for the initialized client', done => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.jobsStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.jobsStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new jobsModule.v2.JobsClient({ - 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 jobsModule.v2.JobsClient({ - 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('getJob', () => { - it('invokes getJob without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Job() - ); - client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJob( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getJob(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('createJob', () => { - it('invokes createJob without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateJobRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.createJob(request); - const [response] = await operation.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 without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateJobRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createJob( - 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.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 call error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateJobRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createJob = stubLongRunningCall(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 LRO error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateJobRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createJob(request); - await assert.rejects(operation.promise(), 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 checkCreateJobProgress without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateJobProgress with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateJob', () => { - it('invokes updateJob without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateJobRequest() - ); - request.job = {}; - // path template: projects/*/locations/{location=*}/** - request.job.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateJob(request); - const [response] = await operation.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 without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateJobRequest() - ); - request.job = {}; - // path template: projects/*/locations/{location=*}/** - request.job.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateJob( - 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.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 call error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateJobRequest() - ); - request.job = {}; - // path template: projects/*/locations/{location=*}/** - request.job.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateJob = stubLongRunningCall(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 LRO error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateJobRequest() - ); - request.job = {}; - // path template: projects/*/locations/{location=*}/** - request.job.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateJob(request); - await assert.rejects(operation.promise(), 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 checkUpdateJobProgress without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateJobProgress with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteJob', () => { - it('invokes deleteJob without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('runJob', () => { - it('invokes runJob without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.RunJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.runJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.runJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runJob without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.RunJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.runJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runJob( - 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.runJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runJob with call error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.RunJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.runJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.runJob(request), expectedError); - const actualRequest = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runJob with LRO error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.RunJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.runJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.runJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRunJobProgress without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRunJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRunJobProgress with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRunJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listJobs', () => { - it('invokes listJobs without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listJobs( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - ]; - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Job[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - 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.run.v2.Job[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - ]; - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - 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.run.v2.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('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new jobsModule.v2.JobsClient({ - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new jobsModule.v2.JobsClient({ - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new jobsModule.v2.JobsClient({ - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts deleted file mode 100644 index 19e6f48c13f..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts +++ /dev/null @@ -1,1669 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as revisionsModule 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('v2.RevisionsClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new revisionsModule.v2.RevisionsClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new revisionsModule.v2.RevisionsClient(); - 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 = revisionsModule.v2.RevisionsClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = revisionsModule.v2.RevisionsClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new revisionsModule.v2.RevisionsClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new revisionsModule.v2.RevisionsClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 revisionsModule.v2.RevisionsClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 revisionsModule.v2.RevisionsClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 revisionsModule.v2.RevisionsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = revisionsModule.v2.RevisionsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new revisionsModule.v2.RevisionsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new revisionsModule.v2.RevisionsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.revisionsStub, undefined); - await client.initialize(); - assert(client.revisionsStub); - }); - - it('has close method for the initialized client', done => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.revisionsStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.revisionsStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new revisionsModule.v2.RevisionsClient({ - 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 revisionsModule.v2.RevisionsClient({ - 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('getRevision', () => { - it('invokes getRevision without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Revision() - ); - client.innerApiCalls.getRevision = stubSimpleCall(expectedResponse); - const [response] = await client.getRevision(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRevision without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Revision() - ); - client.innerApiCalls.getRevision = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getRevision( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IRevision|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRevision with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.getRevision = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getRevision(request), expectedError); - const actualRequest = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRevision with closed client', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getRevision(request), expectedError); - }); - }); - - describe('deleteRevision', () => { - it('invokes deleteRevision without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteRevision = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteRevision(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRevision without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteRevision = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteRevision( - 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.deleteRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRevision with call error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteRevision = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteRevision(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRevision with LRO error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteRevision = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteRevision(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteRevisionProgress without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteRevisionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteRevisionProgress with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteRevisionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listRevisions', () => { - it('invokes listRevisions without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - ]; - client.innerApiCalls.listRevisions = stubSimpleCall(expectedResponse); - const [response] = await client.listRevisions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRevisions without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - ]; - client.innerApiCalls.listRevisions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listRevisions( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IRevision[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRevisions with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.listRevisions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listRevisions(request), expectedError); - const actualRequest = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRevisionsStream without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - ]; - client.descriptors.page.listRevisions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Revision[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Revision) => { - 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.listRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRevisions, request)); - assert( - (client.descriptors.page.listRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listRevisionsStream with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listRevisions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Revision[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Revision) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRevisions, request)); - assert( - (client.descriptors.page.listRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRevisions without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - ]; - client.descriptors.page.listRevisions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.IRevision[] = []; - const iterable = client.listRevisionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRevisions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRevisions with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listRevisionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.run.v2.IRevision[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRevisions.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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('cryptoKey', async () => { - const fakePath = "/rendered/path/cryptoKey"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - key_ring: "keyRingValue", - crypto_key: "cryptoKeyValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.cryptoKeyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.cryptoKeyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('cryptoKeyPath', () => { - const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCryptoKeyName', () => { - const result = client.matchProjectFromCryptoKeyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCryptoKeyName', () => { - const result = client.matchLocationFromCryptoKeyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchKeyRingFromCryptoKeyName', () => { - const result = client.matchKeyRingFromCryptoKeyName(fakePath); - assert.strictEqual(result, "keyRingValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCryptoKeyFromCryptoKeyName', () => { - const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); - assert.strictEqual(result, "cryptoKeyValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts deleted file mode 100644 index 5a5ff605ed7..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts +++ /dev/null @@ -1,2243 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as servicesModule 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('v2.ServicesClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new servicesModule.v2.ServicesClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new servicesModule.v2.ServicesClient(); - 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 = servicesModule.v2.ServicesClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = servicesModule.v2.ServicesClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new servicesModule.v2.ServicesClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new servicesModule.v2.ServicesClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 servicesModule.v2.ServicesClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 servicesModule.v2.ServicesClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 servicesModule.v2.ServicesClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = servicesModule.v2.ServicesClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new servicesModule.v2.ServicesClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new servicesModule.v2.ServicesClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.servicesStub, undefined); - await client.initialize(); - assert(client.servicesStub); - }); - - it('has close method for the initialized client', done => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.servicesStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.servicesStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new servicesModule.v2.ServicesClient({ - 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 servicesModule.v2.ServicesClient({ - 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('getService', () => { - it('invokes getService without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Service() - ); - client.innerApiCalls.getService = stubSimpleCall(expectedResponse); - const [response] = await client.getService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getService without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Service() - ); - client.innerApiCalls.getService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getService( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IService|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getService with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.getService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getService(request), expectedError); - const actualRequest = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getService with closed client', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getService(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('createService', () => { - it('invokes createService without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateServiceRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createService = stubLongRunningCall(expectedResponse); - const [operation] = await client.createService(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createService without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateServiceRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createService = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createService( - 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.createService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createService with call error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateServiceRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createService = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createService(request), expectedError); - const actualRequest = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createService with LRO error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateServiceRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createService = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createService(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateServiceProgress without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateServiceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateServiceProgress with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateServiceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateService', () => { - it('invokes updateService without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateServiceRequest() - ); - request.service = {}; - // path template: projects/*/locations/{location=*}/** - request.service.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateService = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateService(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateService without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateServiceRequest() - ); - request.service = {}; - // path template: projects/*/locations/{location=*}/** - request.service.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateService = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateService( - 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.updateService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateService with call error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateServiceRequest() - ); - request.service = {}; - // path template: projects/*/locations/{location=*}/** - request.service.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateService = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateService(request), expectedError); - const actualRequest = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateService with LRO error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateServiceRequest() - ); - request.service = {}; - // path template: projects/*/locations/{location=*}/** - request.service.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateService = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateService(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateServiceProgress without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateServiceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateServiceProgress with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateServiceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteService', () => { - it('invokes deleteService without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteService = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteService(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteService without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteService = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteService( - 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.deleteService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteService with call error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteService = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteService(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteService with LRO error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteService = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteService(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteServiceProgress without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteServiceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteServiceProgress with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteServiceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listServices', () => { - it('invokes listServices without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - ]; - client.innerApiCalls.listServices = stubSimpleCall(expectedResponse); - const [response] = await client.listServices(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listServices without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - ]; - client.innerApiCalls.listServices = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listServices( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IService[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listServices with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.listServices = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listServices(request), expectedError); - const actualRequest = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listServicesStream without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - ]; - client.descriptors.page.listServices.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listServicesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Service[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Service) => { - 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.listServices.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listServices, request)); - assert( - (client.descriptors.page.listServices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listServicesStream with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listServices.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listServicesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Service[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Service) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listServices.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listServices, request)); - assert( - (client.descriptors.page.listServices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listServices without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - ]; - client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.IService[] = []; - const iterable = client.listServicesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listServices.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listServices.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listServices with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listServicesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.run.v2.IService[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listServices.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listServices.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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts deleted file mode 100644 index 02f293fcb32..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts +++ /dev/null @@ -1,1259 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as tasksModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, 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 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('v2.TasksClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new tasksModule.v2.TasksClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new tasksModule.v2.TasksClient(); - 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 = tasksModule.v2.TasksClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = tasksModule.v2.TasksClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new tasksModule.v2.TasksClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new tasksModule.v2.TasksClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 tasksModule.v2.TasksClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 tasksModule.v2.TasksClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 tasksModule.v2.TasksClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = tasksModule.v2.TasksClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new tasksModule.v2.TasksClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new tasksModule.v2.TasksClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.tasksStub, undefined); - await client.initialize(); - assert(client.tasksStub); - }); - - it('has close method for the initialized client', done => { - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.tasksStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.tasksStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new tasksModule.v2.TasksClient({ - 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 tasksModule.v2.TasksClient({ - 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('getTask', () => { - it('invokes getTask without error', async () => { - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Task() - ); - client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTask( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getTask(request), expectedError); - }); - }); - - describe('listTasks', () => { - it('invokes listTasks without error', async () => { - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTasks( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - ]; - client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Task[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.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.run.v2.Task[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - ]; - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.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.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('Path templates', () => { - - describe('cryptoKey', async () => { - const fakePath = "/rendered/path/cryptoKey"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - key_ring: "keyRingValue", - crypto_key: "cryptoKeyValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.cryptoKeyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.cryptoKeyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('cryptoKeyPath', () => { - const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCryptoKeyName', () => { - const result = client.matchProjectFromCryptoKeyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCryptoKeyName', () => { - const result = client.matchLocationFromCryptoKeyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchKeyRingFromCryptoKeyName', () => { - const result = client.matchKeyRingFromCryptoKeyName(fakePath); - assert.strictEqual(result, "keyRingValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCryptoKeyFromCryptoKeyName', () => { - const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); - assert.strictEqual(result, "cryptoKeyValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts deleted file mode 100644 index f74aef7c940..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts +++ /dev/null @@ -1,2243 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as workerpoolsModule 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('v2.WorkerPoolsClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient(); - 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 = workerpoolsModule.v2.WorkerPoolsClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = workerpoolsModule.v2.WorkerPoolsClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 workerpoolsModule.v2.WorkerPoolsClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 workerpoolsModule.v2.WorkerPoolsClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 workerpoolsModule.v2.WorkerPoolsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = workerpoolsModule.v2.WorkerPoolsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.workerPoolsStub, undefined); - await client.initialize(); - assert(client.workerPoolsStub); - }); - - it('has close method for the initialized client', done => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.workerPoolsStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.workerPoolsStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - 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 workerpoolsModule.v2.WorkerPoolsClient({ - 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('getWorkerPool', () => { - it('invokes getWorkerPool without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.WorkerPool() - ); - client.innerApiCalls.getWorkerPool = stubSimpleCall(expectedResponse); - const [response] = await client.getWorkerPool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getWorkerPool without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.WorkerPool() - ); - client.innerApiCalls.getWorkerPool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getWorkerPool( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IWorkerPool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getWorkerPool with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.getWorkerPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getWorkerPool(request), expectedError); - const actualRequest = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getWorkerPool with closed client', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getWorkerPool(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('createWorkerPool', () => { - it('invokes createWorkerPool without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createWorkerPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.createWorkerPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createWorkerPool without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createWorkerPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createWorkerPool( - 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.createWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createWorkerPool with call error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createWorkerPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createWorkerPool(request), expectedError); - const actualRequest = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createWorkerPool with LRO error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createWorkerPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createWorkerPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateWorkerPoolProgress without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateWorkerPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateWorkerPoolProgress with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateWorkerPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateWorkerPool', () => { - it('invokes updateWorkerPool without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() - ); - request.workerPool = {}; - // path template: projects/*/locations/{location=*}/** - request.workerPool.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateWorkerPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateWorkerPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateWorkerPool without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() - ); - request.workerPool = {}; - // path template: projects/*/locations/{location=*}/** - request.workerPool.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateWorkerPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateWorkerPool( - 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.updateWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateWorkerPool with call error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() - ); - request.workerPool = {}; - // path template: projects/*/locations/{location=*}/** - request.workerPool.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateWorkerPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateWorkerPool(request), expectedError); - const actualRequest = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateWorkerPool with LRO error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() - ); - request.workerPool = {}; - // path template: projects/*/locations/{location=*}/** - request.workerPool.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateWorkerPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateWorkerPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateWorkerPoolProgress without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateWorkerPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateWorkerPoolProgress with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateWorkerPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteWorkerPool', () => { - it('invokes deleteWorkerPool without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteWorkerPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteWorkerPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteWorkerPool without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteWorkerPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteWorkerPool( - 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.deleteWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteWorkerPool with call error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkerPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteWorkerPool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteWorkerPool with LRO error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkerPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteWorkerPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteWorkerPoolProgress without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteWorkerPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteWorkerPoolProgress with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteWorkerPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listWorkerPools', () => { - it('invokes listWorkerPools without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - ]; - client.innerApiCalls.listWorkerPools = stubSimpleCall(expectedResponse); - const [response] = await client.listWorkerPools(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listWorkerPools without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - ]; - client.innerApiCalls.listWorkerPools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listWorkerPools( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IWorkerPool[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listWorkerPools with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.listWorkerPools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listWorkerPools(request), expectedError); - const actualRequest = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listWorkerPoolsStream without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - ]; - client.descriptors.page.listWorkerPools.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listWorkerPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.WorkerPool[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.WorkerPool) => { - 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.listWorkerPools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkerPools, request)); - assert( - (client.descriptors.page.listWorkerPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listWorkerPoolsStream with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkerPools.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listWorkerPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.WorkerPool[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.WorkerPool) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listWorkerPools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkerPools, request)); - assert( - (client.descriptors.page.listWorkerPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listWorkerPools without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - ]; - client.descriptors.page.listWorkerPools.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.IWorkerPool[] = []; - const iterable = client.listWorkerPoolsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listWorkerPools with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkerPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listWorkerPoolsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.run.v2.IWorkerPool[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listWorkerPools.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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/tsconfig.json b/owl-bot-staging/google-cloud-run/tsconfig.json deleted file mode 100644 index ca73e7bfc82..00000000000 --- a/owl-bot-staging/google-cloud-run/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/google-cloud-run/webpack.config.js b/owl-bot-staging/google-cloud-run/webpack.config.js deleted file mode 100644 index 20bb2f2a589..00000000000 --- a/owl-bot-staging/google-cloud-run/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: 'Builds', - filename: './builds.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-run/README.md b/packages/google-cloud-run/README.md index 384f8db772e..5e764dd1d71 100644 --- a/packages/google-cloud-run/README.md +++ b/packages/google-cloud-run/README.md @@ -63,6 +63,12 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | delete execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js) | | get execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js) | | list executions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js) | +| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.create_instance.js) | +| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.delete_instance.js) | +| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.get_instance.js) | +| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.list_instances.js) | +| start instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.start_instance.js) | +| stop instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.stop_instance.js) | | create job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.create_job.js) | | delete job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.delete_job.js) | | get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js) | diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/container_status.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/container_status.proto similarity index 100% rename from owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/container_status.proto rename to packages/google-cloud-run/protos/google/cloud/run/v2/container_status.proto diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/instance.proto similarity index 100% rename from owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance.proto rename to packages/google-cloud-run/protos/google/cloud/run/v2/instance.proto diff --git a/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto index 83b9af76787..0fe03f27aac 100644 --- a/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto +++ b/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto @@ -97,6 +97,9 @@ message Container { // fails. Probe startup_probe = 11; + // Readiness probe to be used for health checks. + Probe readiness_probe = 14; + // Names of the containers that must start before this container. repeated string depends_on = 12; diff --git a/packages/google-cloud-run/protos/protos.d.ts b/packages/google-cloud-run/protos/protos.d.ts index 3689d39331d..0f969068560 100644 --- a/packages/google-cloud-run/protos/protos.d.ts +++ b/packages/google-cloud-run/protos/protos.d.ts @@ -889,6 +889,109 @@ export namespace google { } } + /** Properties of a ContainerStatus. */ + interface IContainerStatus { + + /** ContainerStatus name */ + name?: (string|null); + + /** ContainerStatus imageDigest */ + imageDigest?: (string|null); + } + + /** Represents a ContainerStatus. */ + class ContainerStatus implements IContainerStatus { + + /** + * Constructs a new ContainerStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IContainerStatus); + + /** ContainerStatus name. */ + public name: string; + + /** ContainerStatus imageDigest. */ + public imageDigest: string; + + /** + * Creates a new ContainerStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ContainerStatus instance + */ + public static create(properties?: google.cloud.run.v2.IContainerStatus): google.cloud.run.v2.ContainerStatus; + + /** + * Encodes the specified ContainerStatus message. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @param message ContainerStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IContainerStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContainerStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @param message ContainerStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IContainerStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ContainerStatus; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ContainerStatus; + + /** + * Verifies a ContainerStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContainerStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContainerStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ContainerStatus; + + /** + * Creates a plain object from a ContainerStatus message. Also converts values to other types if specified. + * @param message ContainerStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ContainerStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContainerStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContainerStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents an Executions */ class Executions extends $protobuf.rpc.Service { @@ -1982,6 +2085,9 @@ export namespace google { /** Container startupProbe */ startupProbe?: (google.cloud.run.v2.IProbe|null); + /** Container readinessProbe */ + readinessProbe?: (google.cloud.run.v2.IProbe|null); + /** Container dependsOn */ dependsOn?: (string[]|null); @@ -2037,6 +2143,9 @@ export namespace google { /** Container startupProbe. */ public startupProbe?: (google.cloud.run.v2.IProbe|null); + /** Container readinessProbe. */ + public readinessProbe?: (google.cloud.run.v2.IProbe|null); + /** Container dependsOn. */ public dependsOn: string[]; @@ -5543,6 +5652,1226 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Represents an Instances */ + class Instances extends $protobuf.rpc.Service { + + /** + * Constructs a new Instances 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 Instances 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): Instances; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.run.v2.ICreateInstanceRequest, callback: google.cloud.run.v2.Instances.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.run.v2.ICreateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.run.v2.IDeleteInstanceRequest, callback: google.cloud.run.v2.Instances.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.run.v2.IDeleteInstanceRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.run.v2.IGetInstanceRequest, callback: google.cloud.run.v2.Instances.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.run.v2.IGetInstanceRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.run.v2.IListInstancesRequest, callback: google.cloud.run.v2.Instances.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.run.v2.IListInstancesRequest): Promise; + + /** + * Calls StopInstance. + * @param request StopInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public stopInstance(request: google.cloud.run.v2.IStopInstanceRequest, callback: google.cloud.run.v2.Instances.StopInstanceCallback): void; + + /** + * Calls StopInstance. + * @param request StopInstanceRequest message or plain object + * @returns Promise + */ + public stopInstance(request: google.cloud.run.v2.IStopInstanceRequest): Promise; + + /** + * Calls StartInstance. + * @param request StartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startInstance(request: google.cloud.run.v2.IStartInstanceRequest, callback: google.cloud.run.v2.Instances.StartInstanceCallback): void; + + /** + * Calls StartInstance. + * @param request StartInstanceRequest message or plain object + * @returns Promise + */ + public startInstance(request: google.cloud.run.v2.IStartInstanceRequest): Promise; + } + + namespace Instances { + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.run.v2.Instance) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.run.v2.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|stopInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type StopInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|startInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type StartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.run.v2.IInstance|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.run.v2.IInstance|null); + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.ICreateInstanceRequest): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IGetInstanceRequest): google.cloud.run.v2.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + + /** DeleteInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteInstanceRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** DeleteInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteInstanceRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IDeleteInstanceRequest): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.run.v2.IListInstancesRequest): google.cloud.run.v2.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.run.v2.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.run.v2.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.run.v2.IListInstancesResponse): google.cloud.run.v2.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopInstanceRequest. */ + interface IStopInstanceRequest { + + /** StopInstanceRequest name */ + name?: (string|null); + + /** StopInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** StopInstanceRequest etag */ + etag?: (string|null); + } + + /** Represents a StopInstanceRequest. */ + class StopInstanceRequest implements IStopInstanceRequest { + + /** + * Constructs a new StopInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IStopInstanceRequest); + + /** StopInstanceRequest name. */ + public name: string; + + /** StopInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** StopInstanceRequest etag. */ + public etag: string; + + /** + * Creates a new StopInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IStopInstanceRequest): google.cloud.run.v2.StopInstanceRequest; + + /** + * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @param message StopInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @param message StopInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StopInstanceRequest; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StopInstanceRequest; + + /** + * Verifies a StopInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StopInstanceRequest; + + /** + * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. + * @param message StopInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.StopInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartInstanceRequest. */ + interface IStartInstanceRequest { + + /** StartInstanceRequest name */ + name?: (string|null); + + /** StartInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** StartInstanceRequest etag */ + etag?: (string|null); + } + + /** Represents a StartInstanceRequest. */ + class StartInstanceRequest implements IStartInstanceRequest { + + /** + * Constructs a new StartInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IStartInstanceRequest); + + /** StartInstanceRequest name. */ + public name: string; + + /** StartInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** StartInstanceRequest etag. */ + public etag: string; + + /** + * Creates a new StartInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IStartInstanceRequest): google.cloud.run.v2.StartInstanceRequest; + + /** + * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @param message StartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @param message StartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StartInstanceRequest; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StartInstanceRequest; + + /** + * Verifies a StartInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StartInstanceRequest; + + /** + * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. + * @param message StartInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.StartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance description */ + description?: (string|null); + + /** Instance uid */ + uid?: (string|null); + + /** Instance generation */ + generation?: (number|Long|string|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Instance creator */ + creator?: (string|null); + + /** Instance lastModifier */ + lastModifier?: (string|null); + + /** Instance client */ + client?: (string|null); + + /** Instance clientVersion */ + clientVersion?: (string|null); + + /** Instance launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** Instance binaryAuthorization */ + binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** Instance vpcAccess */ + vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** Instance serviceAccount */ + serviceAccount?: (string|null); + + /** Instance containers */ + containers?: (google.cloud.run.v2.IContainer[]|null); + + /** Instance volumes */ + volumes?: (google.cloud.run.v2.IVolume[]|null); + + /** Instance encryptionKey */ + encryptionKey?: (string|null); + + /** Instance encryptionKeyRevocationAction */ + encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); + + /** Instance encryptionKeyShutdownDuration */ + encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** Instance nodeSelector */ + nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** Instance gpuZonalRedundancyDisabled */ + gpuZonalRedundancyDisabled?: (boolean|null); + + /** Instance ingress */ + ingress?: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic|null); + + /** Instance invokerIamDisabled */ + invokerIamDisabled?: (boolean|null); + + /** Instance iapEnabled */ + iapEnabled?: (boolean|null); + + /** Instance observedGeneration */ + observedGeneration?: (number|Long|string|null); + + /** Instance logUri */ + logUri?: (string|null); + + /** Instance terminalCondition */ + terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** Instance conditions */ + conditions?: (google.cloud.run.v2.ICondition[]|null); + + /** Instance containerStatuses */ + containerStatuses?: (google.cloud.run.v2.IContainerStatus[]|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Instance urls */ + urls?: (string[]|null); + + /** Instance reconciling */ + reconciling?: (boolean|null); + + /** Instance etag */ + etag?: (string|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance description. */ + public description: string; + + /** Instance uid. */ + public uid: string; + + /** Instance generation. */ + public generation: (number|Long|string); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance annotations. */ + public annotations: { [k: string]: string }; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Instance creator. */ + public creator: string; + + /** Instance lastModifier. */ + public lastModifier: string; + + /** Instance client. */ + public client: string; + + /** Instance clientVersion. */ + public clientVersion: string; + + /** Instance launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** Instance binaryAuthorization. */ + public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** Instance vpcAccess. */ + public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** Instance serviceAccount. */ + public serviceAccount: string; + + /** Instance containers. */ + public containers: google.cloud.run.v2.IContainer[]; + + /** Instance volumes. */ + public volumes: google.cloud.run.v2.IVolume[]; + + /** Instance encryptionKey. */ + public encryptionKey: string; + + /** Instance encryptionKeyRevocationAction. */ + public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); + + /** Instance encryptionKeyShutdownDuration. */ + public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** Instance nodeSelector. */ + public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** Instance gpuZonalRedundancyDisabled. */ + public gpuZonalRedundancyDisabled?: (boolean|null); + + /** Instance ingress. */ + public ingress: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic); + + /** Instance invokerIamDisabled. */ + public invokerIamDisabled: boolean; + + /** Instance iapEnabled. */ + public iapEnabled: boolean; + + /** Instance observedGeneration. */ + public observedGeneration: (number|Long|string); + + /** Instance logUri. */ + public logUri: string; + + /** Instance terminalCondition. */ + public terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** Instance conditions. */ + public conditions: google.cloud.run.v2.ICondition[]; + + /** Instance containerStatuses. */ + public containerStatuses: google.cloud.run.v2.IContainerStatus[]; + + /** Instance satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Instance urls. */ + public urls: string[]; + + /** Instance reconciling. */ + public reconciling: boolean; + + /** Instance etag. */ + public etag: string; + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.run.v2.IInstance): google.cloud.run.v2.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an InstanceSplit. */ interface IInstanceSplit { diff --git a/packages/google-cloud-run/protos/protos.js b/packages/google-cloud-run/protos/protos.js index b48c78d75de..c7edd21ba6b 100644 --- a/packages/google-cloud-run/protos/protos.js +++ b/packages/google-cloud-run/protos/protos.js @@ -2587,6 +2587,235 @@ return Condition; })(); + v2.ContainerStatus = (function() { + + /** + * Properties of a ContainerStatus. + * @memberof google.cloud.run.v2 + * @interface IContainerStatus + * @property {string|null} [name] ContainerStatus name + * @property {string|null} [imageDigest] ContainerStatus imageDigest + */ + + /** + * Constructs a new ContainerStatus. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ContainerStatus. + * @implements IContainerStatus + * @constructor + * @param {google.cloud.run.v2.IContainerStatus=} [properties] Properties to set + */ + function ContainerStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContainerStatus name. + * @member {string} name + * @memberof google.cloud.run.v2.ContainerStatus + * @instance + */ + ContainerStatus.prototype.name = ""; + + /** + * ContainerStatus imageDigest. + * @member {string} imageDigest + * @memberof google.cloud.run.v2.ContainerStatus + * @instance + */ + ContainerStatus.prototype.imageDigest = ""; + + /** + * Creates a new ContainerStatus instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.IContainerStatus=} [properties] Properties to set + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus instance + */ + ContainerStatus.create = function create(properties) { + return new ContainerStatus(properties); + }; + + /** + * Encodes the specified ContainerStatus message. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.IContainerStatus} message ContainerStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.imageDigest != null && Object.hasOwnProperty.call(message, "imageDigest")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageDigest); + return writer; + }; + + /** + * Encodes the specified ContainerStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.IContainerStatus} message ContainerStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ContainerStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.imageDigest = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContainerStatus message. + * @function verify + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContainerStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.imageDigest != null && message.hasOwnProperty("imageDigest")) + if (!$util.isString(message.imageDigest)) + return "imageDigest: string expected"; + return null; + }; + + /** + * Creates a ContainerStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus + */ + ContainerStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ContainerStatus) + return object; + var message = new $root.google.cloud.run.v2.ContainerStatus(); + if (object.name != null) + message.name = String(object.name); + if (object.imageDigest != null) + message.imageDigest = String(object.imageDigest); + return message; + }; + + /** + * Creates a plain object from a ContainerStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.ContainerStatus} message ContainerStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContainerStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.imageDigest = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.imageDigest != null && message.hasOwnProperty("imageDigest")) + object.imageDigest = message.imageDigest; + return object; + }; + + /** + * Converts this ContainerStatus to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ContainerStatus + * @instance + * @returns {Object.} JSON object + */ + ContainerStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContainerStatus + * @function getTypeUrl + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContainerStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ContainerStatus"; + }; + + return ContainerStatus; + })(); + v2.Executions = (function() { /** @@ -5563,6 +5792,7 @@ * @property {string|null} [workingDir] Container workingDir * @property {google.cloud.run.v2.IProbe|null} [livenessProbe] Container livenessProbe * @property {google.cloud.run.v2.IProbe|null} [startupProbe] Container startupProbe + * @property {google.cloud.run.v2.IProbe|null} [readinessProbe] Container readinessProbe * @property {Array.|null} [dependsOn] Container dependsOn * @property {string|null} [baseImageUri] Container baseImageUri * @property {google.cloud.run.v2.IBuildInfo|null} [buildInfo] Container buildInfo @@ -5685,6 +5915,14 @@ */ Container.prototype.startupProbe = null; + /** + * Container readinessProbe. + * @member {google.cloud.run.v2.IProbe|null|undefined} readinessProbe + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.readinessProbe = null; + /** * Container dependsOn. * @member {Array.} dependsOn @@ -5765,6 +6003,8 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.dependsOn[i]); if (message.baseImageUri != null && Object.hasOwnProperty.call(message, "baseImageUri")) writer.uint32(/* id 13, wireType 2 =*/106).string(message.baseImageUri); + if (message.readinessProbe != null && Object.hasOwnProperty.call(message, "readinessProbe")) + $root.google.cloud.run.v2.Probe.encode(message.readinessProbe, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.buildInfo != null && Object.hasOwnProperty.call(message, "buildInfo")) $root.google.cloud.run.v2.BuildInfo.encode(message.buildInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); if (message.sourceCode != null && Object.hasOwnProperty.call(message, "sourceCode")) @@ -5863,6 +6103,10 @@ message.startupProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); break; } + case 14: { + message.readinessProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); + break; + } case 12: { if (!(message.dependsOn && message.dependsOn.length)) message.dependsOn = []; @@ -5982,6 +6226,11 @@ if (error) return "startupProbe." + error; } + if (message.readinessProbe != null && message.hasOwnProperty("readinessProbe")) { + var error = $root.google.cloud.run.v2.Probe.verify(message.readinessProbe); + if (error) + return "readinessProbe." + error; + } if (message.dependsOn != null && message.hasOwnProperty("dependsOn")) { if (!Array.isArray(message.dependsOn)) return "dependsOn: array expected"; @@ -6082,6 +6331,11 @@ throw TypeError(".google.cloud.run.v2.Container.startupProbe: object expected"); message.startupProbe = $root.google.cloud.run.v2.Probe.fromObject(object.startupProbe); } + if (object.readinessProbe != null) { + if (typeof object.readinessProbe !== "object") + throw TypeError(".google.cloud.run.v2.Container.readinessProbe: object expected"); + message.readinessProbe = $root.google.cloud.run.v2.Probe.fromObject(object.readinessProbe); + } if (object.dependsOn) { if (!Array.isArray(object.dependsOn)) throw TypeError(".google.cloud.run.v2.Container.dependsOn: array expected"); @@ -6128,6 +6382,7 @@ object.livenessProbe = null; object.startupProbe = null; object.baseImageUri = ""; + object.readinessProbe = null; object.buildInfo = null; object.sourceCode = null; } @@ -6175,6 +6430,8 @@ } if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) object.baseImageUri = message.baseImageUri; + if (message.readinessProbe != null && message.hasOwnProperty("readinessProbe")) + object.readinessProbe = $root.google.cloud.run.v2.Probe.toObject(message.readinessProbe, options); if (message.buildInfo != null && message.hasOwnProperty("buildInfo")) object.buildInfo = $root.google.cloud.run.v2.BuildInfo.toObject(message.buildInfo, options); if (message.sourceCode != null && message.hasOwnProperty("sourceCode")) @@ -14575,6 +14832,3406 @@ return ExecutionTemplate; })(); + v2.Instances = (function() { + + /** + * Constructs a new Instances service. + * @memberof google.cloud.run.v2 + * @classdesc Represents an Instances + * @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 Instances(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Instances.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Instances; + + /** + * Creates new Instances service using the specified rpc implementation. + * @function create + * @memberof google.cloud.run.v2.Instances + * @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 {Instances} RPC service. Useful where requests and/or responses are streamed. + */ + Instances.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|createInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.run.v2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|deleteInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.run.v2.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|getInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.run.v2.GetInstanceRequest, $root.google.cloud.run.v2.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|listInstances}. + * @memberof google.cloud.run.v2.Instances + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.run.v2.Instances.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.run.v2.ListInstancesRequest, $root.google.cloud.run.v2.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|stopInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef StopInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StopInstance. + * @function stopInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStopInstanceRequest} request StopInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.StopInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.stopInstance = function stopInstance(request, callback) { + return this.rpcCall(stopInstance, $root.google.cloud.run.v2.StopInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StopInstance" }); + + /** + * Calls StopInstance. + * @function stopInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStopInstanceRequest} request StopInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|startInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef StartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StartInstance. + * @function startInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStartInstanceRequest} request StartInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.StartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.startInstance = function startInstance(request, callback) { + return this.rpcCall(startInstance, $root.google.cloud.run.v2.StartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartInstance" }); + + /** + * Calls StartInstance. + * @function startInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStartInstanceRequest} request StartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Instances; + })(); + + v2.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {google.cloud.run.v2.IInstance|null} [instance] CreateInstanceRequest instance + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.run.v2.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.run.v2.IInstance|null|undefined} instance + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.run.v2.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instance = $root.google.cloud.run.v2.Instance.decode(reader, reader.uint32()); + break; + } + case 3: { + message.instanceId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.run.v2.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.run.v2.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.run.v2.Instance.fromObject(object.instance); + } + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instance = null; + object.instanceId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.run.v2.Instance.toObject(message.instance, options); + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v2.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GetInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v2.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly + * @property {string|null} [etag] DeleteInstanceRequest etag + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * DeleteInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.validateOnly = false; + + /** + * DeleteInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.etag = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v2.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.run.v2 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {boolean|null} [showDeleted] ListInstancesRequest showDeleted + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.run.v2.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.showDeleted = false; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListInstancesRequest) + return object; + var message = new $root.google.cloud.run.v2.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + 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.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v2.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.run.v2 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.run.v2.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + 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]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.run.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.run.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.run.v2.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.run.v2.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.run.v2.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListInstancesResponse) + return object; + var message = new $root.google.cloud.run.v2.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.run.v2.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.run.v2.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.run.v2.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.run.v2.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v2.StopInstanceRequest = (function() { + + /** + * Properties of a StopInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IStopInstanceRequest + * @property {string|null} [name] StopInstanceRequest name + * @property {boolean|null} [validateOnly] StopInstanceRequest validateOnly + * @property {string|null} [etag] StopInstanceRequest etag + */ + + /** + * Constructs a new StopInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a StopInstanceRequest. + * @implements IStopInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IStopInstanceRequest=} [properties] Properties to set + */ + function StopInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.name = ""; + + /** + * StopInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.validateOnly = false; + + /** + * StopInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.etag = ""; + + /** + * Creates a new StopInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.IStopInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest instance + */ + StopInstanceRequest.create = function create(properties) { + return new StopInstanceRequest(properties); + }; + + /** + * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StopInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest + */ + StopInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.StopInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.StopInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.StopInstanceRequest} message StopInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this StopInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + StopInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.StopInstanceRequest"; + }; + + return StopInstanceRequest; + })(); + + v2.StartInstanceRequest = (function() { + + /** + * Properties of a StartInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IStartInstanceRequest + * @property {string|null} [name] StartInstanceRequest name + * @property {boolean|null} [validateOnly] StartInstanceRequest validateOnly + * @property {string|null} [etag] StartInstanceRequest etag + */ + + /** + * Constructs a new StartInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a StartInstanceRequest. + * @implements IStartInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IStartInstanceRequest=} [properties] Properties to set + */ + function StartInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.name = ""; + + /** + * StartInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.validateOnly = false; + + /** + * StartInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.etag = ""; + + /** + * Creates a new StartInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.IStartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest instance + */ + StartInstanceRequest.create = function create(properties) { + return new StartInstanceRequest(properties); + }; + + /** + * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StartInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest + */ + StartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.StartInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.StartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.StartInstanceRequest} message StartInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this StartInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + StartInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.StartInstanceRequest"; + }; + + return StartInstanceRequest; + })(); + + v2.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.run.v2 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [description] Instance description + * @property {string|null} [uid] Instance uid + * @property {number|Long|null} [generation] Instance generation + * @property {Object.|null} [labels] Instance labels + * @property {Object.|null} [annotations] Instance annotations + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Instance expireTime + * @property {string|null} [creator] Instance creator + * @property {string|null} [lastModifier] Instance lastModifier + * @property {string|null} [client] Instance client + * @property {string|null} [clientVersion] Instance clientVersion + * @property {google.api.LaunchStage|null} [launchStage] Instance launchStage + * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Instance binaryAuthorization + * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Instance vpcAccess + * @property {string|null} [serviceAccount] Instance serviceAccount + * @property {Array.|null} [containers] Instance containers + * @property {Array.|null} [volumes] Instance volumes + * @property {string|null} [encryptionKey] Instance encryptionKey + * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] Instance encryptionKeyRevocationAction + * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] Instance encryptionKeyShutdownDuration + * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Instance nodeSelector + * @property {boolean|null} [gpuZonalRedundancyDisabled] Instance gpuZonalRedundancyDisabled + * @property {google.cloud.run.v2.IngressTraffic|null} [ingress] Instance ingress + * @property {boolean|null} [invokerIamDisabled] Instance invokerIamDisabled + * @property {boolean|null} [iapEnabled] Instance iapEnabled + * @property {number|Long|null} [observedGeneration] Instance observedGeneration + * @property {string|null} [logUri] Instance logUri + * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Instance terminalCondition + * @property {Array.|null} [conditions] Instance conditions + * @property {Array.|null} [containerStatuses] Instance containerStatuses + * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs + * @property {Array.|null} [urls] Instance urls + * @property {boolean|null} [reconciling] Instance reconciling + * @property {string|null} [etag] Instance etag + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.run.v2 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.run.v2.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.annotations = {}; + this.containers = []; + this.volumes = []; + this.conditions = []; + this.containerStatuses = []; + this.urls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance description. + * @member {string} description + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.description = ""; + + /** + * Instance uid. + * @member {string} uid + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.uid = ""; + + /** + * Instance generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.annotations = $util.emptyObject; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.deleteTime = null; + + /** + * Instance expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.expireTime = null; + + /** + * Instance creator. + * @member {string} creator + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.creator = ""; + + /** + * Instance lastModifier. + * @member {string} lastModifier + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.lastModifier = ""; + + /** + * Instance client. + * @member {string} client + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.client = ""; + + /** + * Instance clientVersion. + * @member {string} clientVersion + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.clientVersion = ""; + + /** + * Instance launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.launchStage = 0; + + /** + * Instance binaryAuthorization. + * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.binaryAuthorization = null; + + /** + * Instance vpcAccess. + * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.vpcAccess = null; + + /** + * Instance serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.serviceAccount = ""; + + /** + * Instance containers. + * @member {Array.} containers + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.containers = $util.emptyArray; + + /** + * Instance volumes. + * @member {Array.} volumes + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.volumes = $util.emptyArray; + + /** + * Instance encryptionKey. + * @member {string} encryptionKey + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.encryptionKey = ""; + + /** + * Instance encryptionKeyRevocationAction. + * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.encryptionKeyRevocationAction = 0; + + /** + * Instance encryptionKeyShutdownDuration. + * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.encryptionKeyShutdownDuration = null; + + /** + * Instance nodeSelector. + * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.nodeSelector = null; + + /** + * Instance gpuZonalRedundancyDisabled. + * @member {boolean|null|undefined} gpuZonalRedundancyDisabled + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.gpuZonalRedundancyDisabled = null; + + /** + * Instance ingress. + * @member {google.cloud.run.v2.IngressTraffic} ingress + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.ingress = 0; + + /** + * Instance invokerIamDisabled. + * @member {boolean} invokerIamDisabled + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.invokerIamDisabled = false; + + /** + * Instance iapEnabled. + * @member {boolean} iapEnabled + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.iapEnabled = false; + + /** + * Instance observedGeneration. + * @member {number|Long} observedGeneration + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance logUri. + * @member {string} logUri + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.logUri = ""; + + /** + * Instance terminalCondition. + * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.terminalCondition = null; + + /** + * Instance conditions. + * @member {Array.} conditions + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.conditions = $util.emptyArray; + + /** + * Instance containerStatuses. + * @member {Array.} containerStatuses + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.containerStatuses = $util.emptyArray; + + /** + * Instance satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = false; + + /** + * Instance urls. + * @member {Array.} urls + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.urls = $util.emptyArray; + + /** + * Instance reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.reconciling = false; + + /** + * Instance etag. + * @member {string} etag + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Instance.prototype, "_gpuZonalRedundancyDisabled", { + get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.IInstance=} [properties] Properties to set + * @returns {google.cloud.run.v2.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uid); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.generation); + 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.creator); + if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.lastModifier); + if (message.client != null && Object.hasOwnProperty.call(message, "client")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.client); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.clientVersion); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); + if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) + $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) + $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.serviceAccount); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.encryptionKey); + if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.encryptionKeyRevocationAction); + if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) + $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) + $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.gpuZonalRedundancyDisabled); + if (message.ingress != null && Object.hasOwnProperty.call(message, "ingress")) + writer.uint32(/* id 28, wireType 0 =*/224).int32(message.ingress); + if (message.invokerIamDisabled != null && Object.hasOwnProperty.call(message, "invokerIamDisabled")) + writer.uint32(/* id 29, wireType 0 =*/232).bool(message.invokerIamDisabled); + if (message.iapEnabled != null && Object.hasOwnProperty.call(message, "iapEnabled")) + writer.uint32(/* id 30, wireType 0 =*/240).bool(message.iapEnabled); + if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) + writer.uint32(/* id 40, wireType 0 =*/320).int64(message.observedGeneration); + if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.logUri); + if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) + $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.containerStatuses != null && message.containerStatuses.length) + for (var i = 0; i < message.containerStatuses.length; ++i) + $root.google.cloud.run.v2.ContainerStatus.encode(message.containerStatuses[i], writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.urls != null && message.urls.length) + for (var i = 0; i < message.urls.length; ++i) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.urls[i]); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 46, wireType 0 =*/368).bool(message.satisfiesPzs); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.uid = reader.string(); + break; + } + case 5: { + message.generation = reader.int64(); + 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: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.creator = reader.string(); + break; + } + case 13: { + message.lastModifier = reader.string(); + break; + } + case 14: { + message.client = reader.string(); + break; + } + case 15: { + message.clientVersion = reader.string(); + break; + } + case 16: { + message.launchStage = reader.int32(); + break; + } + case 17: { + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); + break; + } + case 18: { + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); + break; + } + case 19: { + message.serviceAccount = reader.string(); + break; + } + case 20: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); + break; + } + case 21: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); + break; + } + case 22: { + message.encryptionKey = reader.string(); + break; + } + case 24: { + message.encryptionKeyRevocationAction = reader.int32(); + break; + } + case 25: { + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 26: { + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); + break; + } + case 27: { + message.gpuZonalRedundancyDisabled = reader.bool(); + break; + } + case 28: { + message.ingress = reader.int32(); + break; + } + case 29: { + message.invokerIamDisabled = reader.bool(); + break; + } + case 30: { + message.iapEnabled = reader.bool(); + break; + } + case 40: { + message.observedGeneration = reader.int64(); + break; + } + case 41: { + message.logUri = reader.string(); + break; + } + case 42: { + message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); + break; + } + case 43: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); + break; + } + case 44: { + if (!(message.containerStatuses && message.containerStatuses.length)) + message.containerStatuses = []; + message.containerStatuses.push($root.google.cloud.run.v2.ContainerStatus.decode(reader, reader.uint32())); + break; + } + case 46: { + message.satisfiesPzs = reader.bool(); + break; + } + case 45: { + if (!(message.urls && message.urls.length)) + message.urls = []; + message.urls.push(reader.string()); + break; + } + case 98: { + message.reconciling = reader.bool(); + break; + } + case 99: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.run.v2.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + if (!$util.isString(message.lastModifier)) + return "lastModifier: string expected"; + if (message.client != null && message.hasOwnProperty("client")) + if (!$util.isString(message.client)) + return "client: string expected"; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { + var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); + if (error) + return "binaryAuthorization." + error; + } + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { + var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); + if (error) + return "vpcAccess." + error; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + 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.run.v2.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + if (!$util.isString(message.encryptionKey)) + return "encryptionKey: string expected"; + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + switch (message.encryptionKeyRevocationAction) { + default: + return "encryptionKeyRevocationAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { + var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); + if (error) + return "encryptionKeyShutdownDuration." + error; + } + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { + var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); + if (error) + return "nodeSelector." + error; + } + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + properties._gpuZonalRedundancyDisabled = 1; + if (typeof message.gpuZonalRedundancyDisabled !== "boolean") + return "gpuZonalRedundancyDisabled: boolean expected"; + } + if (message.ingress != null && message.hasOwnProperty("ingress")) + switch (message.ingress) { + default: + return "ingress: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) + if (typeof message.invokerIamDisabled !== "boolean") + return "invokerIamDisabled: boolean expected"; + if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) + if (typeof message.iapEnabled !== "boolean") + return "iapEnabled: boolean expected"; + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) + return "observedGeneration: integer|Long expected"; + if (message.logUri != null && message.hasOwnProperty("logUri")) + if (!$util.isString(message.logUri)) + return "logUri: string expected"; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { + var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); + if (error) + return "terminalCondition." + error; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.containerStatuses != null && message.hasOwnProperty("containerStatuses")) { + if (!Array.isArray(message.containerStatuses)) + return "containerStatuses: array expected"; + for (var i = 0; i < message.containerStatuses.length; ++i) { + var error = $root.google.cloud.run.v2.ContainerStatus.verify(message.containerStatuses[i]); + if (error) + return "containerStatuses." + error; + } + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.urls != null && message.hasOwnProperty("urls")) { + if (!Array.isArray(message.urls)) + return "urls: array expected"; + for (var i = 0; i < message.urls.length; ++i) + if (!$util.isString(message.urls[i])) + return "urls: string[] expected"; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Instance) + return object; + var message = new $root.google.cloud.run.v2.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.uid != null) + message.uid = String(object.uid); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.Instance.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.lastModifier != null) + message.lastModifier = String(object.lastModifier); + if (object.client != null) + message.client = String(object.client); + if (object.clientVersion != null) + message.clientVersion = String(object.clientVersion); + 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.binaryAuthorization != null) { + if (typeof object.binaryAuthorization !== "object") + throw TypeError(".google.cloud.run.v2.Instance.binaryAuthorization: object expected"); + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); + } + if (object.vpcAccess != null) { + if (typeof object.vpcAccess !== "object") + throw TypeError(".google.cloud.run.v2.Instance.vpcAccess: object expected"); + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.run.v2.Instance.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.containers: object expected"); + message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); + } + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.run.v2.Instance.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.volumes: object expected"); + message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); + } + } + if (object.encryptionKey != null) + message.encryptionKey = String(object.encryptionKey); + switch (object.encryptionKeyRevocationAction) { + default: + if (typeof object.encryptionKeyRevocationAction === "number") { + message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; + break; + } + break; + case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": + case 0: + message.encryptionKeyRevocationAction = 0; + break; + case "PREVENT_NEW": + case 1: + message.encryptionKeyRevocationAction = 1; + break; + case "SHUTDOWN": + case 2: + message.encryptionKeyRevocationAction = 2; + break; + } + if (object.encryptionKeyShutdownDuration != null) { + if (typeof object.encryptionKeyShutdownDuration !== "object") + throw TypeError(".google.cloud.run.v2.Instance.encryptionKeyShutdownDuration: object expected"); + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); + } + if (object.nodeSelector != null) { + if (typeof object.nodeSelector !== "object") + throw TypeError(".google.cloud.run.v2.Instance.nodeSelector: object expected"); + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); + } + if (object.gpuZonalRedundancyDisabled != null) + message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); + switch (object.ingress) { + default: + if (typeof object.ingress === "number") { + message.ingress = object.ingress; + break; + } + break; + case "INGRESS_TRAFFIC_UNSPECIFIED": + case 0: + message.ingress = 0; + break; + case "INGRESS_TRAFFIC_ALL": + case 1: + message.ingress = 1; + break; + case "INGRESS_TRAFFIC_INTERNAL_ONLY": + case 2: + message.ingress = 2; + break; + case "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": + case 3: + message.ingress = 3; + break; + case "INGRESS_TRAFFIC_NONE": + case 4: + message.ingress = 4; + break; + } + if (object.invokerIamDisabled != null) + message.invokerIamDisabled = Boolean(object.invokerIamDisabled); + if (object.iapEnabled != null) + message.iapEnabled = Boolean(object.iapEnabled); + if (object.observedGeneration != null) + if ($util.Long) + (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; + else if (typeof object.observedGeneration === "string") + message.observedGeneration = parseInt(object.observedGeneration, 10); + else if (typeof object.observedGeneration === "number") + message.observedGeneration = object.observedGeneration; + else if (typeof object.observedGeneration === "object") + message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); + if (object.logUri != null) + message.logUri = String(object.logUri); + if (object.terminalCondition != null) { + if (typeof object.terminalCondition !== "object") + throw TypeError(".google.cloud.run.v2.Instance.terminalCondition: object expected"); + message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); + } + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.run.v2.Instance.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.conditions: object expected"); + message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); + } + } + if (object.containerStatuses) { + if (!Array.isArray(object.containerStatuses)) + throw TypeError(".google.cloud.run.v2.Instance.containerStatuses: array expected"); + message.containerStatuses = []; + for (var i = 0; i < object.containerStatuses.length; ++i) { + if (typeof object.containerStatuses[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.containerStatuses: object expected"); + message.containerStatuses[i] = $root.google.cloud.run.v2.ContainerStatus.fromObject(object.containerStatuses[i]); + } + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.urls) { + if (!Array.isArray(object.urls)) + throw TypeError(".google.cloud.run.v2.Instance.urls: array expected"); + message.urls = []; + for (var i = 0; i < object.urls.length; ++i) + message.urls[i] = String(object.urls[i]); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.containers = []; + object.volumes = []; + object.conditions = []; + object.containerStatuses = []; + object.urls = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.creator = ""; + object.lastModifier = ""; + object.client = ""; + object.clientVersion = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.binaryAuthorization = null; + object.vpcAccess = null; + object.serviceAccount = ""; + object.encryptionKey = ""; + object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; + object.encryptionKeyShutdownDuration = null; + object.nodeSelector = null; + object.ingress = options.enums === String ? "INGRESS_TRAFFIC_UNSPECIFIED" : 0; + object.invokerIamDisabled = false; + object.iapEnabled = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.observedGeneration = options.longs === String ? "0" : 0; + object.logUri = ""; + object.terminalCondition = null; + object.satisfiesPzs = false; + object.reconciling = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + object.lastModifier = message.lastModifier; + if (message.client != null && message.hasOwnProperty("client")) + object.client = message.client; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) + object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) + object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = message.encryptionKey; + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) + object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) + object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; + if (options.oneofs) + object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; + } + if (message.ingress != null && message.hasOwnProperty("ingress")) + object.ingress = options.enums === String ? $root.google.cloud.run.v2.IngressTraffic[message.ingress] === undefined ? message.ingress : $root.google.cloud.run.v2.IngressTraffic[message.ingress] : message.ingress; + if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) + object.invokerIamDisabled = message.invokerIamDisabled; + if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) + object.iapEnabled = message.iapEnabled; + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (typeof message.observedGeneration === "number") + object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; + else + object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; + if (message.logUri != null && message.hasOwnProperty("logUri")) + object.logUri = message.logUri; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) + object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); + } + if (message.containerStatuses && message.containerStatuses.length) { + object.containerStatuses = []; + for (var j = 0; j < message.containerStatuses.length; ++j) + object.containerStatuses[j] = $root.google.cloud.run.v2.ContainerStatus.toObject(message.containerStatuses[j], options); + } + if (message.urls && message.urls.length) { + object.urls = []; + for (var j = 0; j < message.urls.length; ++j) + object.urls[j] = message.urls[j]; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.run.v2.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.Instance"; + }; + + return Instance; + })(); + v2.InstanceSplit = (function() { /** diff --git a/packages/google-cloud-run/protos/protos.json b/packages/google-cloud-run/protos/protos.json index eb4062c6337..cdebe0a282b 100644 --- a/packages/google-cloud-run/protos/protos.json +++ b/packages/google-cloud-run/protos/protos.json @@ -351,6 +351,18 @@ } } }, + "ContainerStatus": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "imageDigest": { + "type": "string", + "id": 2 + } + } + }, "Executions": { "options": { "(google.api.default_host)": "run.googleapis.com", @@ -888,6 +900,10 @@ "type": "Probe", "id": 11 }, + "readinessProbe": { + "type": "Probe", + "id": 14 + }, "dependsOn": { "rule": "repeated", "type": "string", @@ -1677,6 +1693,617 @@ } } }, + "Instances": { + "options": { + "(google.api.default_host)": "run.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "instance", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent,instance", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*}/instances", + "body": "instance" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent,instance" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/instances/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/instances/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/instances", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*}/instances" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "StopInstance": { + "requestType": "StopInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/instances/*}:stop", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/instances/*}:stop", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + }, + "StartInstance": { + "requestType": "StartInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/instances/*}:start", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/instances/*}:start", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Instance" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "showDeleted": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "StopInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StartInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "run.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance" + }, + "oneofs": { + "_gpuZonalRedundancyDisabled": { + "oneof": [ + "gpuZonalRedundancyDisabled" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 3 + }, + "uid": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "generation": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModifier": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "client": { + "type": "string", + "id": 14 + }, + "clientVersion": { + "type": "string", + "id": 15 + }, + "launchStage": { + "type": "google.api.LaunchStage", + "id": 16 + }, + "binaryAuthorization": { + "type": "BinaryAuthorization", + "id": 17 + }, + "vpcAccess": { + "type": "VpcAccess", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 19 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 20, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 21 + }, + "encryptionKey": { + "type": "string", + "id": 22, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "encryptionKeyRevocationAction": { + "type": "EncryptionKeyRevocationAction", + "id": 24 + }, + "encryptionKeyShutdownDuration": { + "type": "google.protobuf.Duration", + "id": 25 + }, + "nodeSelector": { + "type": "NodeSelector", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gpuZonalRedundancyDisabled": { + "type": "bool", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ingress": { + "type": "IngressTraffic", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "invokerIamDisabled": { + "type": "bool", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "iapEnabled": { + "type": "bool", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "observedGeneration": { + "type": "int64", + "id": 40, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logUri": { + "type": "string", + "id": 41, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "terminalCondition": { + "type": "Condition", + "id": 42, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 43, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "containerStatuses": { + "rule": "repeated", + "type": "ContainerStatus", + "id": 44, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 46, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "urls": { + "rule": "repeated", + "type": "string", + "id": 45, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 98, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 99, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "InstanceSplit": { "fields": { "type": { diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.create_instance.js b/packages/google-cloud-run/samples/generated/v2/instances.create_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.create_instance.js rename to packages/google-cloud-run/samples/generated/v2/instances.create_instance.js diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.delete_instance.js b/packages/google-cloud-run/samples/generated/v2/instances.delete_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.delete_instance.js rename to packages/google-cloud-run/samples/generated/v2/instances.delete_instance.js diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.get_instance.js b/packages/google-cloud-run/samples/generated/v2/instances.get_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.get_instance.js rename to packages/google-cloud-run/samples/generated/v2/instances.get_instance.js diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.list_instances.js b/packages/google-cloud-run/samples/generated/v2/instances.list_instances.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.list_instances.js rename to packages/google-cloud-run/samples/generated/v2/instances.list_instances.js diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.start_instance.js b/packages/google-cloud-run/samples/generated/v2/instances.start_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.start_instance.js rename to packages/google-cloud-run/samples/generated/v2/instances.start_instance.js diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.stop_instance.js b/packages/google-cloud-run/samples/generated/v2/instances.stop_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.stop_instance.js rename to packages/google-cloud-run/samples/generated/v2/instances.stop_instance.js diff --git a/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json b/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json index aea9941ab0d..4ff250fc8b5 100644 --- a/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json +++ b/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json @@ -279,6 +279,294 @@ } } }, + { + "regionTag": "run_v2_generated_Instances_CreateInstance_async", + "title": "Builds createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates an Instance.", + "canonical": true, + "file": "instances.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.run.v2.Instances.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.run.v2.Instance" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.run.v2.Instances.CreateInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_DeleteInstance_async", + "title": "Builds deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Instance", + "canonical": true, + "file": "instances.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.run.v2.Instances.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.run.v2.Instances.DeleteInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_GetInstance_async", + "title": "Builds getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets a Instance", + "canonical": true, + "file": "instances.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.run.v2.Instances.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.run.v2.Instance", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.run.v2.Instances.GetInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_ListInstances_async", + "title": "Builds listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances. Results are sorted by creation time, descending.", + "canonical": true, + "file": "instances.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.run.v2.Instances.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.run.v2.ListInstancesResponse", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.run.v2.Instances.ListInstances", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_StopInstance_async", + "title": "Builds stopInstance Sample", + "origin": "API_DEFINITION", + "description": " Stops an Instance.", + "canonical": true, + "file": "instances.stop_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopInstance", + "fullName": "google.cloud.run.v2.Instances.StopInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "StopInstance", + "fullName": "google.cloud.run.v2.Instances.StopInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_StartInstance_async", + "title": "Builds startInstance Sample", + "origin": "API_DEFINITION", + "description": " Starts an Instance.", + "canonical": true, + "file": "instances.start_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartInstance", + "fullName": "google.cloud.run.v2.Instances.StartInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "StartInstance", + "fullName": "google.cloud.run.v2.Instances.StartInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, { "regionTag": "run_v2_generated_Jobs_CreateJob_async", "title": "Builds createJob Sample", diff --git a/packages/google-cloud-run/src/index.ts b/packages/google-cloud-run/src/index.ts index 4f2780c7a14..3c28cf6bbfb 100644 --- a/packages/google-cloud-run/src/index.ts +++ b/packages/google-cloud-run/src/index.ts @@ -22,6 +22,8 @@ const BuildsClient = v2.BuildsClient; type BuildsClient = v2.BuildsClient; const ExecutionsClient = v2.ExecutionsClient; type ExecutionsClient = v2.ExecutionsClient; +const InstancesClient = v2.InstancesClient; +type InstancesClient = v2.InstancesClient; const JobsClient = v2.JobsClient; type JobsClient = v2.JobsClient; const RevisionsClient = v2.RevisionsClient; @@ -33,7 +35,7 @@ type TasksClient = v2.TasksClient; const WorkerPoolsClient = v2.WorkerPoolsClient; type WorkerPoolsClient = v2.WorkerPoolsClient; -export {v2, BuildsClient, ExecutionsClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; -export default {v2, BuildsClient, ExecutionsClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; +export {v2, BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; +export default {v2, BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-run/src/v2/builds_client.ts b/packages/google-cloud-run/src/v2/builds_client.ts index a7f21132f7e..9cbdf164888 100644 --- a/packages/google-cloud-run/src/v2/builds_client.ts +++ b/packages/google-cloud-run/src/v2/builds_client.ts @@ -186,6 +186,9 @@ export class BuildsClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -618,6 +621,55 @@ export class BuildsClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/builds_proto_list.json b/packages/google-cloud-run/src/v2/builds_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/builds_proto_list.json +++ b/packages/google-cloud-run/src/v2/builds_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/executions_client.ts b/packages/google-cloud-run/src/v2/executions_client.ts index 32b504b2c69..29b7e4871fb 100644 --- a/packages/google-cloud-run/src/v2/executions_client.ts +++ b/packages/google-cloud-run/src/v2/executions_client.ts @@ -187,6 +187,9 @@ export class ExecutionsClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -1306,6 +1309,55 @@ export class ExecutionsClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/executions_proto_list.json b/packages/google-cloud-run/src/v2/executions_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/executions_proto_list.json +++ b/packages/google-cloud-run/src/v2/executions_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/gapic_metadata.json b/packages/google-cloud-run/src/v2/gapic_metadata.json index b8997e7763e..2276e2b6394 100644 --- a/packages/google-cloud-run/src/v2/gapic_metadata.json +++ b/packages/google-cloud-run/src/v2/gapic_metadata.json @@ -87,6 +87,84 @@ } } }, + "Instances": { + "clients": { + "grpc": { + "libraryClient": "InstancesClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "StopInstance": { + "methods": [ + "stopInstance" + ] + }, + "StartInstance": { + "methods": [ + "startInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InstancesClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "StopInstance": { + "methods": [ + "stopInstance" + ] + }, + "StartInstance": { + "methods": [ + "startInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + }, "Jobs": { "clients": { "grpc": { diff --git a/packages/google-cloud-run/src/v2/index.ts b/packages/google-cloud-run/src/v2/index.ts index 8e683c63caf..6cc79ce5e90 100644 --- a/packages/google-cloud-run/src/v2/index.ts +++ b/packages/google-cloud-run/src/v2/index.ts @@ -18,6 +18,7 @@ export {BuildsClient} from './builds_client'; export {ExecutionsClient} from './executions_client'; +export {InstancesClient} from './instances_client'; export {JobsClient} from './jobs_client'; export {RevisionsClient} from './revisions_client'; export {ServicesClient} from './services_client'; diff --git a/owl-bot-staging/google-cloud-run/src/v2/instances_client.ts b/packages/google-cloud-run/src/v2/instances_client.ts similarity index 100% rename from owl-bot-staging/google-cloud-run/src/v2/instances_client.ts rename to packages/google-cloud-run/src/v2/instances_client.ts diff --git a/owl-bot-staging/google-cloud-run/src/v2/instances_client_config.json b/packages/google-cloud-run/src/v2/instances_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-run/src/v2/instances_client_config.json rename to packages/google-cloud-run/src/v2/instances_client_config.json diff --git a/owl-bot-staging/google-cloud-run/src/v2/instances_proto_list.json b/packages/google-cloud-run/src/v2/instances_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-run/src/v2/instances_proto_list.json rename to packages/google-cloud-run/src/v2/instances_proto_list.json diff --git a/packages/google-cloud-run/src/v2/jobs_client.ts b/packages/google-cloud-run/src/v2/jobs_client.ts index 5531e004f78..dff326d9416 100644 --- a/packages/google-cloud-run/src/v2/jobs_client.ts +++ b/packages/google-cloud-run/src/v2/jobs_client.ts @@ -187,6 +187,9 @@ export class JobsClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -1945,6 +1948,55 @@ export class JobsClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/jobs_proto_list.json b/packages/google-cloud-run/src/v2/jobs_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/jobs_proto_list.json +++ b/packages/google-cloud-run/src/v2/jobs_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/revisions_client.ts b/packages/google-cloud-run/src/v2/revisions_client.ts index e56fee66c10..c2d97a21619 100644 --- a/packages/google-cloud-run/src/v2/revisions_client.ts +++ b/packages/google-cloud-run/src/v2/revisions_client.ts @@ -190,6 +190,9 @@ export class RevisionsClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -1300,6 +1303,55 @@ export class RevisionsClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/revisions_proto_list.json b/packages/google-cloud-run/src/v2/revisions_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/revisions_proto_list.json +++ b/packages/google-cloud-run/src/v2/revisions_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/services_client.ts b/packages/google-cloud-run/src/v2/services_client.ts index 765e36f4549..3fabf84fd3c 100644 --- a/packages/google-cloud-run/src/v2/services_client.ts +++ b/packages/google-cloud-run/src/v2/services_client.ts @@ -187,6 +187,9 @@ export class ServicesClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -1816,6 +1819,55 @@ export class ServicesClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/services_proto_list.json b/packages/google-cloud-run/src/v2/services_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/services_proto_list.json +++ b/packages/google-cloud-run/src/v2/services_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/tasks_client.ts b/packages/google-cloud-run/src/v2/tasks_client.ts index 664c529070d..38b33a4e5dc 100644 --- a/packages/google-cloud-run/src/v2/tasks_client.ts +++ b/packages/google-cloud-run/src/v2/tasks_client.ts @@ -189,6 +189,9 @@ export class TasksClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -878,6 +881,55 @@ export class TasksClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/tasks_proto_list.json b/packages/google-cloud-run/src/v2/tasks_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/tasks_proto_list.json +++ b/packages/google-cloud-run/src/v2/tasks_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/worker_pools_client.ts b/packages/google-cloud-run/src/v2/worker_pools_client.ts index fd19709aef7..842874cf75c 100644 --- a/packages/google-cloud-run/src/v2/worker_pools_client.ts +++ b/packages/google-cloud-run/src/v2/worker_pools_client.ts @@ -187,6 +187,9 @@ export class WorkerPoolsClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -1827,6 +1830,55 @@ export class WorkerPoolsClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/worker_pools_proto_list.json b/packages/google-cloud-run/src/v2/worker_pools_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/worker_pools_proto_list.json +++ b/packages/google-cloud-run/src/v2/worker_pools_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/system-test/fixtures/sample/src/index.js b/packages/google-cloud-run/system-test/fixtures/sample/src/index.js index 18a87d0b3d9..b75bcd5378f 100644 --- a/packages/google-cloud-run/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-run/system-test/fixtures/sample/src/index.js @@ -23,6 +23,7 @@ const run = require('@google-cloud/run'); function main() { const buildsClient = new run.BuildsClient(); const executionsClient = new run.ExecutionsClient(); + const instancesClient = new run.InstancesClient(); const jobsClient = new run.JobsClient(); const revisionsClient = new run.RevisionsClient(); const servicesClient = new run.ServicesClient(); diff --git a/packages/google-cloud-run/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-run/system-test/fixtures/sample/src/index.ts index 7e87907d78b..bdf1cc11f53 100644 --- a/packages/google-cloud-run/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-run/system-test/fixtures/sample/src/index.ts @@ -16,7 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {BuildsClient, ExecutionsClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient} from '@google-cloud/run'; +import {BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient} from '@google-cloud/run'; // check that the client class type name can be used function doStuffWithBuildsClient(client: BuildsClient) { @@ -25,6 +25,9 @@ function doStuffWithBuildsClient(client: BuildsClient) { function doStuffWithExecutionsClient(client: ExecutionsClient) { client.close(); } +function doStuffWithInstancesClient(client: InstancesClient) { + client.close(); +} function doStuffWithJobsClient(client: JobsClient) { client.close(); } @@ -49,6 +52,9 @@ function main() { const executionsClient = new ExecutionsClient(); doStuffWithExecutionsClient(executionsClient); // check that the client instance can be created + const instancesClient = new InstancesClient(); + doStuffWithInstancesClient(instancesClient); + // check that the client instance can be created const jobsClient = new JobsClient(); doStuffWithJobsClient(jobsClient); // check that the client instance can be created diff --git a/packages/google-cloud-run/test/gapic_builds_v2.ts b/packages/google-cloud-run/test/gapic_builds_v2.ts index d52cd1b6cbb..a0a18108510 100644 --- a/packages/google-cloud-run/test/gapic_builds_v2.ts +++ b/packages/google-cloud-run/test/gapic_builds_v2.ts @@ -562,6 +562,52 @@ describe('v2.BuildsClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/packages/google-cloud-run/test/gapic_executions_v2.ts b/packages/google-cloud-run/test/gapic_executions_v2.ts index f4f44849a6f..69f44a4308b 100644 --- a/packages/google-cloud-run/test/gapic_executions_v2.ts +++ b/packages/google-cloud-run/test/gapic_executions_v2.ts @@ -1413,6 +1413,52 @@ describe('v2.ExecutionsClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-run/test/gapic_instances_v2.ts b/packages/google-cloud-run/test/gapic_instances_v2.ts similarity index 100% rename from owl-bot-staging/google-cloud-run/test/gapic_instances_v2.ts rename to packages/google-cloud-run/test/gapic_instances_v2.ts diff --git a/packages/google-cloud-run/test/gapic_jobs_v2.ts b/packages/google-cloud-run/test/gapic_jobs_v2.ts index f3732088b84..014c64087bf 100644 --- a/packages/google-cloud-run/test/gapic_jobs_v2.ts +++ b/packages/google-cloud-run/test/gapic_jobs_v2.ts @@ -2022,6 +2022,52 @@ describe('v2.JobsClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/packages/google-cloud-run/test/gapic_revisions_v2.ts b/packages/google-cloud-run/test/gapic_revisions_v2.ts index 46f6cc643d7..19e6f48c13f 100644 --- a/packages/google-cloud-run/test/gapic_revisions_v2.ts +++ b/packages/google-cloud-run/test/gapic_revisions_v2.ts @@ -1298,6 +1298,52 @@ describe('v2.RevisionsClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/packages/google-cloud-run/test/gapic_services_v2.ts b/packages/google-cloud-run/test/gapic_services_v2.ts index 8436c6f91e6..5a5ff605ed7 100644 --- a/packages/google-cloud-run/test/gapic_services_v2.ts +++ b/packages/google-cloud-run/test/gapic_services_v2.ts @@ -1872,6 +1872,52 @@ describe('v2.ServicesClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/packages/google-cloud-run/test/gapic_tasks_v2.ts b/packages/google-cloud-run/test/gapic_tasks_v2.ts index 88a211f091d..02f293fcb32 100644 --- a/packages/google-cloud-run/test/gapic_tasks_v2.ts +++ b/packages/google-cloud-run/test/gapic_tasks_v2.ts @@ -888,6 +888,52 @@ describe('v2.TasksClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/packages/google-cloud-run/test/gapic_worker_pools_v2.ts b/packages/google-cloud-run/test/gapic_worker_pools_v2.ts index 20d7efec56a..f74aef7c940 100644 --- a/packages/google-cloud-run/test/gapic_worker_pools_v2.ts +++ b/packages/google-cloud-run/test/gapic_worker_pools_v2.ts @@ -1872,6 +1872,52 @@ describe('v2.WorkerPoolsClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { From 0436c4d06dac16f2fee7cc4e54d414ae439b83f7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 21 Jan 2026 20:42:44 +0000 Subject: [PATCH 3/3] =?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-run/.eslintignore | 7 - .../google-cloud-run/.eslintrc.json | 3 - .../google-cloud-run/.gitattributes | 4 - owl-bot-staging/google-cloud-run/.gitignore | 14 - owl-bot-staging/google-cloud-run/.jsdoc.js | 55 - owl-bot-staging/google-cloud-run/.mocharc.js | 33 - owl-bot-staging/google-cloud-run/.nycrc | 24 - .../google-cloud-run/.prettierignore | 6 - .../google-cloud-run/.prettierrc.js | 22 - .../google-cloud-run/CODE_OF_CONDUCT.md | 94 - .../google-cloud-run/CONTRIBUTING.md | 76 - owl-bot-staging/google-cloud-run/LICENSE | 202 - owl-bot-staging/google-cloud-run/README.md | 155 - .../protos/google/cloud/run/v2/build.proto | 175 - .../google/cloud/run/v2/condition.proto | 221 - .../google/cloud/run/v2/execution.proto | 316 - .../cloud/run/v2/execution_template.proto | 73 - .../google/cloud/run/v2/instance_split.proto | 67 - .../protos/google/cloud/run/v2/job.proto | 540 - .../protos/google/cloud/run/v2/k8s.min.proto | 483 - .../protos/google/cloud/run/v2/revision.proto | 331 - .../cloud/run/v2/revision_template.proto | 131 - .../protos/google/cloud/run/v2/service.proto | 520 - .../protos/google/cloud/run/v2/status.proto | 28 - .../protos/google/cloud/run/v2/task.proto | 291 - .../google/cloud/run/v2/task_template.proto | 80 - .../google/cloud/run/v2/traffic_target.proto | 77 - .../google/cloud/run/v2/vendor_settings.proto | 285 - .../google/cloud/run/v2/worker_pool.proto | 492 - .../v2/worker_pool_revision_template.proto | 109 - .../google-cloud-run/protos/protos.d.ts | 22927 ------ .../google-cloud-run/protos/protos.js | 61975 ---------------- .../google-cloud-run/protos/protos.json | 7802 -- .../generated/v2/builds.submit_build.js | 114 - .../v2/executions.cancel_execution.js | 75 - .../v2/executions.delete_execution.js | 75 - .../generated/v2/executions.get_execution.js | 64 - .../v2/executions.list_executions.js | 79 - .../samples/generated/v2/jobs.create_job.js | 80 - .../samples/generated/v2/jobs.delete_job.js | 74 - .../generated/v2/jobs.get_iam_policy.js | 67 - .../samples/generated/v2/jobs.get_job.js | 63 - .../samples/generated/v2/jobs.list_jobs.js | 78 - .../samples/generated/v2/jobs.run_job.js | 79 - .../generated/v2/jobs.set_iam_policy.js | 77 - .../generated/v2/jobs.test_iam_permissions.js | 70 - .../samples/generated/v2/jobs.update_job.js | 73 - .../generated/v2/revisions.delete_revision.js | 74 - .../generated/v2/revisions.get_revision.js | 63 - .../generated/v2/revisions.list_revisions.js | 79 - .../generated/v2/services.create_service.js | 81 - .../generated/v2/services.delete_service.js | 74 - .../generated/v2/services.get_iam_policy.js | 67 - .../generated/v2/services.get_service.js | 63 - .../generated/v2/services.list_services.js | 79 - .../generated/v2/services.set_iam_policy.js | 77 - .../v2/services.test_iam_permissions.js | 70 - .../generated/v2/services.update_service.js | 77 - .../snippet_metadata_google.cloud.run.v2.json | 1995 - .../samples/generated/v2/tasks.get_task.js | 63 - .../samples/generated/v2/tasks.list_tasks.js | 79 - .../v2/worker_pools.create_worker_pool.js | 83 - .../v2/worker_pools.delete_worker_pool.js | 75 - .../v2/worker_pools.get_iam_policy.js | 67 - .../v2/worker_pools.get_worker_pool.js | 64 - .../v2/worker_pools.list_worker_pools.js | 79 - .../v2/worker_pools.set_iam_policy.js | 77 - .../v2/worker_pools.test_iam_permissions.js | 70 - .../v2/worker_pools.update_worker_pool.js | 87 - owl-bot-staging/google-cloud-run/src/index.ts | 41 - .../google-cloud-run/src/v2/builds_client.ts | 974 - .../src/v2/builds_client_config.json | 30 - .../src/v2/builds_proto_list.json | 21 - .../src/v2/executions_client.ts | 1722 - .../src/v2/executions_client_config.json | 42 - .../src/v2/executions_proto_list.json | 21 - .../src/v2/gapic_metadata.json | 559 - .../google-cloud-run/src/v2/index.ts | 26 - .../google-cloud-run/src/v2/jobs_client.ts | 2361 - .../src/v2/jobs_client_config.json | 62 - .../src/v2/jobs_proto_list.json | 21 - .../src/v2/revisions_client.ts | 1716 - .../src/v2/revisions_client_config.json | 38 - .../src/v2/revisions_proto_list.json | 21 - .../src/v2/services_client.ts | 2232 - .../src/v2/services_client_config.json | 75 - .../src/v2/services_proto_list.json | 21 - .../google-cloud-run/src/v2/tasks_client.ts | 1293 - .../src/v2/tasks_client_config.json | 34 - .../src/v2/tasks_proto_list.json | 21 - .../src/v2/worker_pools_client.ts | 2243 - .../src/v2/worker_pools_client_config.json | 58 - .../src/v2/worker_pools_proto_list.json | 21 - .../system-test/fixtures/sample/src/index.js | 34 - .../system-test/fixtures/sample/src/index.ts | 74 - .../google-cloud-run/system-test/install.ts | 49 - .../google-cloud-run/test/gapic_builds_v2.ts | 865 - .../test/gapic_executions_v2.ts | 1784 - .../google-cloud-run/test/gapic_jobs_v2.ts | 2393 - .../test/gapic_revisions_v2.ts | 1669 - .../test/gapic_services_v2.ts | 2243 - .../google-cloud-run/test/gapic_tasks_v2.ts | 1259 - .../test/gapic_worker_pools_v2.ts | 2243 - .../google-cloud-run/tsconfig.json | 22 - .../google-cloud-run/webpack.config.js | 64 - packages/google-cloud-run/README.md | 6 + .../cloud/run/v2/container_status.proto | 0 .../protos/google/cloud/run/v2/instance.proto | 0 .../protos/google/cloud/run/v2/k8s.min.proto | 3 + packages/google-cloud-run/protos/protos.d.ts | 1329 + packages/google-cloud-run/protos/protos.js | 3657 + packages/google-cloud-run/protos/protos.json | 627 + .../generated/v2/instances.create_instance.js | 0 .../generated/v2/instances.delete_instance.js | 0 .../generated/v2/instances.get_instance.js | 0 .../generated/v2/instances.list_instances.js | 0 .../generated/v2/instances.start_instance.js | 0 .../generated/v2/instances.stop_instance.js | 0 .../snippet_metadata_google.cloud.run.v2.json | 288 + packages/google-cloud-run/src/index.ts | 6 +- .../google-cloud-run/src/v2/builds_client.ts | 52 + .../src/v2/builds_proto_list.json | 2 + .../src/v2/executions_client.ts | 52 + .../src/v2/executions_proto_list.json | 2 + .../src/v2/gapic_metadata.json | 78 + packages/google-cloud-run/src/v2/index.ts | 1 + .../src/v2/instances_client.ts | 0 .../src/v2/instances_client_config.json | 0 .../src/v2/instances_proto_list.json | 0 .../google-cloud-run/src/v2/jobs_client.ts | 52 + .../src/v2/jobs_proto_list.json | 2 + .../src/v2/revisions_client.ts | 52 + .../src/v2/revisions_proto_list.json | 2 + .../src/v2/services_client.ts | 52 + .../src/v2/services_proto_list.json | 2 + .../google-cloud-run/src/v2/tasks_client.ts | 52 + .../src/v2/tasks_proto_list.json | 2 + .../src/v2/worker_pools_client.ts | 52 + .../src/v2/worker_pools_proto_list.json | 2 + .../system-test/fixtures/sample/src/index.js | 1 + .../system-test/fixtures/sample/src/index.ts | 8 +- .../google-cloud-run/test/gapic_builds_v2.ts | 46 + .../test/gapic_executions_v2.ts | 46 + .../test/gapic_instances_v2.ts | 0 .../google-cloud-run/test/gapic_jobs_v2.ts | 46 + .../test/gapic_revisions_v2.ts | 46 + .../test/gapic_services_v2.ts | 46 + .../google-cloud-run/test/gapic_tasks_v2.ts | 46 + .../test/gapic_worker_pools_v2.ts | 46 + 149 files changed, 6701 insertions(+), 128584 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-run/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-run/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-run/.gitattributes delete mode 100644 owl-bot-staging/google-cloud-run/.gitignore delete mode 100644 owl-bot-staging/google-cloud-run/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-run/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-run/.nycrc delete mode 100644 owl-bot-staging/google-cloud-run/.prettierignore delete mode 100644 owl-bot-staging/google-cloud-run/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/google-cloud-run/CONTRIBUTING.md delete mode 100644 owl-bot-staging/google-cloud-run/LICENSE delete mode 100644 owl-bot-staging/google-cloud-run/README.md delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto delete mode 100644 owl-bot-staging/google-cloud-run/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-run/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-run/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.cancel_execution.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.delete_execution.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.get_execution.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/executions.list_executions.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.create_job.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.delete_job.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_job.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.list_jobs.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.run_job.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.update_job.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.delete_revision.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.get_revision.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.list_revisions.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.create_service.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.delete_service.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_service.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.list_services.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.set_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/services.update_service.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.list_tasks.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js delete mode 100644 owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js delete mode 100644 owl-bot-staging/google-cloud-run/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/builds_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/executions_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/index.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/services_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/services_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json delete mode 100644 owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-run/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_builds_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts delete mode 100644 owl-bot-staging/google-cloud-run/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-run/webpack.config.js rename {owl-bot-staging => packages}/google-cloud-run/protos/google/cloud/run/v2/container_status.proto (100%) rename {owl-bot-staging => packages}/google-cloud-run/protos/google/cloud/run/v2/instance.proto (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.create_instance.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.delete_instance.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.get_instance.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.list_instances.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.start_instance.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/samples/generated/v2/instances.stop_instance.js (100%) rename {owl-bot-staging => packages}/google-cloud-run/src/v2/instances_client.ts (100%) rename {owl-bot-staging => packages}/google-cloud-run/src/v2/instances_client_config.json (100%) rename {owl-bot-staging => packages}/google-cloud-run/src/v2/instances_proto_list.json (100%) rename {owl-bot-staging => packages}/google-cloud-run/test/gapic_instances_v2.ts (100%) diff --git a/owl-bot-staging/google-cloud-run/.eslintignore b/owl-bot-staging/google-cloud-run/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-run/.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-run/.eslintrc.json b/owl-bot-staging/google-cloud-run/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-run/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-run/.gitattributes b/owl-bot-staging/google-cloud-run/.gitattributes deleted file mode 100644 index 33739cb74e4..00000000000 --- a/owl-bot-staging/google-cloud-run/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-run/.gitignore b/owl-bot-staging/google-cloud-run/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-run/.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-run/.jsdoc.js b/owl-bot-staging/google-cloud-run/.jsdoc.js deleted file mode 100644 index d1458969c83..00000000000 --- a/owl-bot-staging/google-cloud-run/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2026 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/run', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-run/.mocharc.js b/owl-bot-staging/google-cloud-run/.mocharc.js deleted file mode 100644 index 5eb34e86c87..00000000000 --- a/owl-bot-staging/google-cloud-run/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-run/.nycrc b/owl-bot-staging/google-cloud-run/.nycrc deleted file mode 100644 index 81a95fc94b0..00000000000 --- a/owl-bot-staging/google-cloud-run/.nycrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "report-dir": "./.coverage", - "reporter": ["text", "lcov"], - "exclude": [ - "**/*-test", - "**/.coverage", - "**/apis", - "**/benchmark", - "**/conformance", - "**/docs", - "**/samples", - "**/scripts", - "**/protos", - "**/test", - "**/*.d.ts", - ".jsdoc.js", - "**/.jsdoc.js", - "karma.conf.js", - "webpack-tests.config.js", - "webpack.config.js" - ], - "exclude-after-remap": false, - "all": true -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/.prettierignore b/owl-bot-staging/google-cloud-run/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/owl-bot-staging/google-cloud-run/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/google-cloud-run/.prettierrc.js b/owl-bot-staging/google-cloud-run/.prettierrc.js deleted file mode 100644 index 7649ee3c254..00000000000 --- a/owl-bot-staging/google-cloud-run/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a81..00000000000 --- a/owl-bot-staging/google-cloud-run/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/CONTRIBUTING.md b/owl-bot-staging/google-cloud-run/CONTRIBUTING.md deleted file mode 100644 index 5368c76a957..00000000000 --- a/owl-bot-staging/google-cloud-run/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Run API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - - -## Running the tests - -1. [Prepare your environment for Node.js setup][setup]. - -1. Install dependencies: - - npm install - -1. Run the tests: - - # Run unit tests. - npm test - - # Run sample integration tests. - npm run samples-test - - # Run all system tests. - npm run system-test - -1. Lint (and maybe fix) any changes: - - npm run fix - -[setup]: https://cloud.google.com/nodejs/docs/setup -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=run.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/LICENSE b/owl-bot-staging/google-cloud-run/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/owl-bot-staging/google-cloud-run/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-run/README.md b/owl-bot-staging/google-cloud-run/README.md deleted file mode 100644 index 5e764dd1d71..00000000000 --- a/owl-bot-staging/google-cloud-run/README.md +++ /dev/null @@ -1,155 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "The comments you see below are used to generate those parts of the template in later states." -Google Cloud Platform logo - -# [Cloud Run Admin API: Nodejs Client][homepage] - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority - -[![npm version](https://img.shields.io/npm/v/@google-cloud/run.svg)](https://www.npmjs.org/package/@google-cloud/run) - -Cloud Run Admin API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Cloud Run Admin API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/run/latest) - - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Cloud Run Admin API API][enable_api]. -1. [Set up authentication][auth] so you can access the - API from your local workstation. -### Installing the client library - -```bash -npm install @google-cloud/run -``` - -[//]: # "partials.body" - -## Samples - -Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | -| --------------------------- | --------------------------------- | -| submit build | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/builds.submit_build.js) | -| cancel execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js) | -| delete execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js) | -| get execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js) | -| list executions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js) | -| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.create_instance.js) | -| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.delete_instance.js) | -| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.get_instance.js) | -| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.list_instances.js) | -| start instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.start_instance.js) | -| stop instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.stop_instance.js) | -| create job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.create_job.js) | -| delete job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.delete_job.js) | -| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js) | -| get job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.get_job.js) | -| list jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.list_jobs.js) | -| run job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.run_job.js) | -| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js) | -| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js) | -| update job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.update_job.js) | -| delete revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/revisions.delete_revision.js) | -| get revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/revisions.get_revision.js) | -| list revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/revisions.list_revisions.js) | -| create service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.create_service.js) | -| delete service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.delete_service.js) | -| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.get_iam_policy.js) | -| get service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.get_service.js) | -| list services | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.list_services.js) | -| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.set_iam_policy.js) | -| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js) | -| update service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/services.update_service.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json) | -| get task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/tasks.get_task.js) | -| list tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/tasks.list_tasks.js) | -| create worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js) | -| delete worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js) | -| get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js) | -| get worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js) | -| list worker pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js) | -| set iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js) | -| test iam permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js) | -| update worker pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js) | - - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). -Libraries are compatible with all current _active_ and _maintenance_ versions of -Node.js. -If you are using an end-of-life version of Node.js, we recommend that you update -as soon as possible to an actively supported LTS version. - -Google's client libraries support legacy versions of Node.js runtimes on a -best-efforts basis with the following warnings: - -* Legacy versions are not tested in continuous integration. -* Some security patches and features cannot be backported. -* Dependencies cannot be kept up-to-date. - -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. -For example, `npm install @google-cloud/run@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/CONTRIBUTING.md). - -Please note that this `README.md` -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/LICENSE) - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing -[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=run.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local -[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto deleted file mode 100644 index d2eb5f6566e..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/build.proto +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "BuildProto"; -option java_package = "com.google.cloud.run.v2"; -option (google.api.resource_definition) = { - type: "cloudbuild.googleapis.com/BuildWorkerPool" - pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" -}; - -// Cloud Run Build Control Plane API -service Builds { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Submits a build in a given project. - rpc SubmitBuild(SubmitBuildRequest) returns (SubmitBuildResponse) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/locations/*}/builds:submit" - body: "*" - }; - } -} - -// Request message for submitting a Build. -message SubmitBuildRequest { - // Build the source using Docker. This means the source has a Dockerfile. - message DockerBuild {} - - // Build the source using Buildpacks. - message BuildpacksBuild { - // The runtime name, e.g. 'go113'. Leave blank for generic builds. - string runtime = 1 [deprecated = true]; - - // Optional. Name of the function target if the source is a function source. - // Required for function builds. - string function_target = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. cache_image_uri is the GCR/AR URL where the cache image will be - // stored. cache_image_uri is optional and omitting it will disable caching. - // This URL must be stable across builds. It is used to derive a - // build-specific temporary URL by substituting the tag with the build ID. - // The build will clean up the temporary image on a best-effort basis. - string cache_image_uri = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The base image to use for the build. - string base_image = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. User-provided build-time environment variables. - map environment_variables = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether or not the application container will be enrolled in - // automatic base image updates. When true, the application will be built on - // a scratch base image, so the base layers can be appended at run time. - bool enable_automatic_updates = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. project_descriptor stores the path to the project descriptor - // file. When empty, it means that there is no project descriptor file in - // the source. - string project_descriptor = 7 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The project and location to build in. Location must be a region, - // e.g., 'us-central1' or 'global' if the global builder is to be used. - // Format: - // `projects/{project}/locations/{location}` - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // Location of source. - oneof source { - // Required. Source for the build. - StorageSource storage_source = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Artifact Registry URI to store the built image. - string image_uri = 3 [(google.api.field_behavior) = REQUIRED]; - - // Build type must be one of the following. - oneof build_type { - // Build the source using Buildpacks. - BuildpacksBuild buildpack_build = 4; - - // Build the source using Docker. This means the source has a Dockerfile. - DockerBuild docker_build = 5; - } - - // Optional. The service account to use for the build. If not set, the default - // Cloud Build service account for the project will be used. - string service_account = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Name of the Cloud Build Custom Worker Pool that should be used to - // build the function. The format of this field is - // `projects/{project}/locations/{region}/workerPools/{workerPool}` where - // `{project}` and `{region}` are the project id and region respectively where - // the worker pool is defined and `{workerPool}` is the short name of the - // worker pool. - string worker_pool = 7 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudbuild.googleapis.com/BuildWorkerPool" - } - ]; - - // Optional. Additional tags to annotate the build. - repeated string tags = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The machine type from default pool to use for the build. If left - // blank, cloudbuild will use a sensible default. Currently only E2_HIGHCPU_8 - // is supported. If worker_pool is set, this field will be ignored. - string machine_type = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The release track of the client that initiated the build request. - google.api.LaunchStage release_track = 10 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The client that initiated the build request. - string client = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for submitting a Build. -message SubmitBuildResponse { - // Cloud Build operation to be polled via CloudBuild API. - google.longrunning.Operation build_operation = 1; - - // URI of the base builder image in Artifact Registry being used in the build. - // Used to opt into automatic base image updates. - string base_image_uri = 2; - - // Warning message for the base image. - string base_image_warning = 3; -} - -// Location of the source in an archive file in Google Cloud Storage. -message StorageSource { - // Required. Google Cloud Storage bucket containing the source (see - // [Bucket Name - // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - string bucket = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Google Cloud Storage object containing the source. - // - // This object must be a gzipped archive file (`.tar.gz`) containing source to - // build. - string object = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Google Cloud Storage generation for the object. If the generation - // is omitted, the latest generation will be used. - int64 generation = 3 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto deleted file mode 100644 index b7b5b10d15e..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/condition.proto +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "ConditionProto"; -option java_package = "com.google.cloud.run.v2"; - -// Defines a status condition for a resource. -message Condition { - // Represents the possible Condition states. - enum State { - // The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0; - - // Transient state: Reconciliation has not started yet. - CONDITION_PENDING = 1; - - // Transient state: reconciliation is still in progress. - CONDITION_RECONCILING = 2; - - // Terminal state: Reconciliation did not succeed. - CONDITION_FAILED = 3; - - // Terminal state: Reconciliation completed successfully. - CONDITION_SUCCEEDED = 4; - } - - // Represents the severity of the condition failures. - enum Severity { - // Unspecified severity - SEVERITY_UNSPECIFIED = 0; - - // Error severity. - ERROR = 1; - - // Warning severity. - WARNING = 2; - - // Info severity. - INFO = 3; - } - - // Reasons common to all types of conditions. - enum CommonReason { - // Default value. - COMMON_REASON_UNDEFINED = 0; - - // Reason unknown. Further details will be in message. - UNKNOWN = 1; - - // Revision creation process failed. - REVISION_FAILED = 3; - - // Timed out waiting for completion. - PROGRESS_DEADLINE_EXCEEDED = 4; - - // The container image path is incorrect. - CONTAINER_MISSING = 6; - - // Insufficient permissions on the container image. - CONTAINER_PERMISSION_DENIED = 7; - - // Container image is not authorized by policy. - CONTAINER_IMAGE_UNAUTHORIZED = 8; - - // Container image policy authorization check failed. - CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9; - - // Insufficient permissions on encryption key. - ENCRYPTION_KEY_PERMISSION_DENIED = 10; - - // Permission check on encryption key failed. - ENCRYPTION_KEY_CHECK_FAILED = 11; - - // At least one Access check on secrets failed. - SECRETS_ACCESS_CHECK_FAILED = 12; - - // Waiting for operation to complete. - WAITING_FOR_OPERATION = 13; - - // System will retry immediately. - IMMEDIATE_RETRY = 14; - - // System will retry later; current attempt failed. - POSTPONED_RETRY = 15; - - // An internal error occurred. Further information may be in the message. - INTERNAL = 16; - - // User-provided VPC network was not found. - VPC_NETWORK_NOT_FOUND = 17; - } - - // Reasons specific to Revision resource. - enum RevisionReason { - // Default value. - REVISION_REASON_UNDEFINED = 0; - - // Revision in Pending state. - PENDING = 1; - - // Revision is in Reserve state. - RESERVE = 2; - - // Revision is Retired. - RETIRED = 3; - - // Revision is being retired. - RETIRING = 4; - - // Revision is being recreated. - RECREATING = 5; - - // There was a health check error. - HEALTH_CHECK_CONTAINER_ERROR = 6; - - // Health check failed due to user error from customized path of the - // container. System will retry. - CUSTOMIZED_PATH_RESPONSE_PENDING = 7; - - // A revision with min_instance_count > 0 was created and is reserved, but - // it was not configured to serve traffic, so it's not live. This can also - // happen momentarily during traffic migration. - MIN_INSTANCES_NOT_PROVISIONED = 8; - - // The maximum allowed number of active revisions has been reached. - ACTIVE_REVISION_LIMIT_REACHED = 9; - - // There was no deployment defined. - // This value is no longer used, but Services created in older versions of - // the API might contain this value. - NO_DEPLOYMENT = 10; - - // A revision's container has no port specified since the revision is of a - // manually scaled service with 0 instance count - HEALTH_CHECK_SKIPPED = 11; - - // A revision with min_instance_count > 0 was created and is waiting for - // enough instances to begin a traffic migration. - MIN_INSTANCES_WARMING = 12; - } - - // Reasons specific to Execution resource. - enum ExecutionReason { - // Default value. - EXECUTION_REASON_UNDEFINED = 0; - - // Internal system error getting execution status. System will retry. - JOB_STATUS_SERVICE_POLLING_ERROR = 1; - - // A task reached its retry limit and the last attempt failed due to the - // user container exiting with a non-zero exit code. - NON_ZERO_EXIT_CODE = 2; - - // The execution was cancelled by users. - CANCELLED = 3; - - // The execution is in the process of being cancelled. - CANCELLING = 4; - - // The execution was deleted. - DELETED = 5; - - // A delayed execution is waiting for a start time. - DELAYED_START_PENDING = 6; - } - - // type is used to communicate the status of the reconciliation process. - // See also: - // https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting - // Types common to all resources include: - // * "Ready": True when the Resource is ready. - string type = 1; - - // State of the condition. - State state = 2; - - // Human readable message indicating details about the current status. - string message = 3; - - // Last time the condition transitioned from one status to another. - google.protobuf.Timestamp last_transition_time = 4; - - // How to interpret failures of this condition, one of Error, Warning, Info - Severity severity = 5; - - // The reason for this condition. Depending on the condition type, - // it will populate one of these fields. - // Successful conditions cannot have a reason. - oneof reasons { - // Output only. A common (service-level) reason for this condition. - CommonReason reason = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A reason for the revision condition. - RevisionReason revision_reason = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A reason for the execution condition. - ExecutionReason execution_reason = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto deleted file mode 100644 index a181fb1bd26..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution.proto +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/task_template.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "ExecutionProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run Execution Control Plane API. -service Executions { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Gets information about an Execution. - rpc GetExecution(GetExecutionRequest) returns (Execution) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Executions from a Job. Results are sorted by creation time, - // descending. - rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*/jobs/*}/executions" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes an Execution. - rpc DeleteExecution(DeleteExecutionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Execution" - metadata_type: "Execution" - }; - } - - // Cancels an Execution. - rpc CancelExecution(CancelExecutionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Execution" - metadata_type: "Execution" - }; - } -} - -// Request message for obtaining a Execution by its full name. -message GetExecutionRequest { - // Required. The full name of the Execution. - // Format: - // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - // where `{project}` can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } - ]; -} - -// Request message for retrieving a list of Executions. -message ListExecutionsRequest { - // Required. The Execution from which the Executions should be listed. - // To list all Executions across Jobs, use "-" instead of Job name. - // Format: `projects/{project}/locations/{location}/jobs/{job}`, where - // `{project}` can be project id or number. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/Execution" - } - ]; - - // Maximum number of Executions to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListExecutions. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of Executions. -message ListExecutionsResponse { - // The resulting list of Executions. - repeated Execution executions = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListExecutions request to continue. - string next_page_token = 2; -} - -// Request message for deleting an Execution. -message DeleteExecutionRequest { - // Required. The name of the Execution to delete. - // Format: - // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - // where `{project}` can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } - ]; - - // Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 2; - - // A system-generated fingerprint for this version of the resource. - // This may be used to detect modification conflict during updates. - string etag = 3; -} - -// Request message for deleting an Execution. -message CancelExecutionRequest { - // Required. The name of the Execution to cancel. - // Format: - // `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - // where `{project}` can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } - ]; - - // Indicates that the request should be validated without actually - // cancelling any resources. - bool validate_only = 2; - - // A system-generated fingerprint for this version of the resource. - // This may be used to detect modification conflict during updates. - string etag = 3; -} - -// Execution represents the configuration of a single execution. A execution an -// immutable resource that references a container image which is run to -// completion. -message Execution { - option (google.api.resource) = { - type: "run.googleapis.com/Execution" - pattern: "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}" - style: DECLARATIVE_FRIENDLY - }; - - // Output only. The unique name of this Execution. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server assigned unique identifier for the Execution. The value - // is a UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the authenticated creator. - string creator = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels - map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that may - // be set by external tools to store and arbitrary metadata. - // They are not queryable and should be preserved - // when modifying objects. - map annotations = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the execution was acknowledged by the - // execution controller. It is not guaranteed to be set in happens-before - // order across separate operations. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the execution started to run. - // It is not guaranteed to be set in happens-before order across separate - // operations. - google.protobuf.Timestamp start_time = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the execution was completed. It is not - // guaranteed to be set in happens-before order across separate operations. - google.protobuf.Timestamp completion_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the deletion time. It is only - // populated as a response to a Delete request. - google.protobuf.Timestamp delete_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permamently deleted. It is only populated as a response to a Delete - // request. - google.protobuf.Timestamp expire_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The least stable launch stage needed to create this resource, as defined by - // [Google Cloud Platform Launch - // Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - // `ALPHA`, `BETA`, and `GA`. - // - // Note that this value might not be what was used - // as input. For example, if ALPHA was provided as input in the parent - // resource, but only BETA and GA-level features are were, this field will be - // BETA. - google.api.LaunchStage launch_stage = 11; - - // Output only. The name of the parent Job. - string job = 12 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Job" } - ]; - - // Output only. Specifies the maximum desired number of tasks the execution - // should run at any given time. Must be <= task_count. The actual number of - // tasks running in steady state will be less than this number when - // ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when - // the work left to do is less than max parallelism. - int32 parallelism = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Specifies the desired number of tasks the execution should - // run. Setting to 1 means that parallelism is limited to 1 and the success of - // that task signals the success of the execution. - int32 task_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The template used to create tasks for this execution. - TaskTemplate template = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Indicates whether the resource's reconciliation is still in - // progress. See comments in `Job.reconciling` for additional information on - // reconciliation process in Cloud Run. - bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this Execution, containing its readiness - // status, and detailed error information in case it did not reach the desired - // state. - repeated Condition conditions = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The generation of this Execution. See comments in - // `reconciling` for additional information on reconciliation process in Cloud - // Run. - int64 observed_generation = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of actively running tasks. - int32 running_count = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of tasks which reached phase Succeeded. - int32 succeeded_count = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of tasks which reached phase Failed. - int32 failed_count = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of tasks which reached phase Cancelled. - int32 cancelled_count = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of tasks which have retried at least once. - int32 retried_count = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. URI where logs for this execution can be found in Cloud - // Console. - string log_uri = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto deleted file mode 100644 index 5a57620efd7..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/execution_template.proto +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/cloud/run/v2/task_template.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "ExecutionTemplateProto"; -option java_package = "com.google.cloud.run.v2"; - -// ExecutionTemplate describes the data an execution should have when created -// from a template. -message ExecutionTemplate { - // Unstructured key value map that can be used to organize and categorize - // objects. - // User-provided labels are shared with Google's billing system, so they can - // be used to filter, or break down billing charges by team, component, - // environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - //

Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 ExecutionTemplate. - map labels = 1; - - // Unstructured key value map that may be set by external tools to store and - // arbitrary metadata. They are not queryable and should be preserved - // when modifying objects. - // - //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system annotations in v1 now - // have a corresponding field in v2 ExecutionTemplate. - // - //

This field follows Kubernetes annotations' namespacing, limits, and - // rules. - map annotations = 2; - - // Optional. Specifies the maximum desired number of tasks the execution - // should run at given time. When the job is run, if this field is 0 or unset, - // the maximum possible value will be used for that execution. The actual - // number of tasks running in steady state will be less than this number when - // there are fewer tasks waiting to be completed remaining, i.e. when the work - // left to do is less than max parallelism. - int32 parallelism = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Specifies the desired number of tasks the execution should run. - // Setting to 1 means that parallelism is limited to 1 and the success of - // that task signals the success of the execution. Defaults to 1. - int32 task_count = 4; - - // Required. Describes the task(s) that will be created when executing an - // execution. - TaskTemplate template = 5 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto deleted file mode 100644 index bfce369f857..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance_split.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "InstanceSplitProto"; -option java_package = "com.google.cloud.run.v2"; - -// Holds a single instance split entry for the Worker. Allocations can be done -// to a specific Revision name, or pointing to the latest Ready Revision. -message InstanceSplit { - // The allocation type for this instance split. - InstanceSplitAllocationType type = 1; - - // Revision to which to assign this portion of instances, if split allocation - // is by revision. - string revision = 2 [ - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Specifies percent of the instance split to this Revision. - // This defaults to zero if unspecified. - int32 percent = 3; -} - -// Represents the observed state of a single `InstanceSplit` entry. -message InstanceSplitStatus { - // The allocation type for this instance split. - InstanceSplitAllocationType type = 1; - - // Revision to which this instance split is assigned. - string revision = 2 [ - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Specifies percent of the instance split to this Revision. - int32 percent = 3; -} - -// The type of instance split allocation. -enum InstanceSplitAllocationType { - // Unspecified instance allocation type. - INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED = 0; - - // Allocates instances to the Service's latest ready Revision. - INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST = 1; - - // Allocates instances to a Revision by name. - INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION = 2; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto deleted file mode 100644 index ad54a7268cb..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/job.proto +++ /dev/null @@ -1,540 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/api/routing.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/execution.proto"; -import "google/cloud/run/v2/execution_template.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "JobProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run Job Control Plane API. -service Jobs { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a Job. - rpc CreateJob(CreateJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/locations/*}/jobs" - body: "job" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent,job,job_id"; - option (google.longrunning.operation_info) = { - response_type: "Job" - metadata_type: "Job" - }; - } - - // Gets information about a Job. - rpc GetJob(GetJobRequest) returns (Job) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists Jobs. Results are sorted by creation time, descending. - rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*}/jobs" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a Job. - rpc UpdateJob(UpdateJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v2/{job.name=projects/*/locations/*/jobs/*}" - body: "job" - }; - option (google.api.routing) = { - routing_parameters { - field: "job.name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "job"; - option (google.longrunning.operation_info) = { - response_type: "Job" - metadata_type: "Job" - }; - } - - // Deletes a Job. - rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Job" - metadata_type: "Job" - }; - } - - // Triggers creation of a new Execution of this Job. - rpc RunJob(RunJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/jobs/*}:run" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Execution" - metadata_type: "Execution" - }; - } - - // Gets the IAM Access Control policy currently in effect for the given Job. - // This result does not include any inherited policies. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - get: "/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy" - }; - } - - // Sets the IAM Access control policy for the specified Job. Overwrites - // any existing policy. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy" - body: "*" - }; - } - - // Returns permissions that a caller has on the specified Project. - // - // There are no permissions required for making this API call. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions" - body: "*" - }; - } -} - -// Request message for creating a Job. -message CreateJobRequest { - // Required. The location and project in which this Job should be created. - // Format: projects/{project}/locations/{location}, where {project} can be - // project id or number. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "run.googleapis.com/Job" } - ]; - - // Required. The Job instance to create. - Job job = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The unique identifier for the Job. The name of the job becomes - // {parent}/jobs/{job_id}. - string job_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Indicates that the request should be validated and default values - // populated, without persisting the request or creating any resources. - bool validate_only = 4; -} - -// Request message for obtaining a Job by its full name. -message GetJobRequest { - // Required. The full name of the Job. - // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - // can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Job" } - ]; -} - -// Request message for updating a Job. -message UpdateJobRequest { - // Required. The Job to be updated. - Job job = 1 [(google.api.field_behavior) = REQUIRED]; - - // Indicates that the request should be validated and default values - // populated, without persisting the request or updating any resources. - bool validate_only = 3; - - // Optional. If set to true, and if the Job does not exist, it will create a - // new one. Caller must have both create and update permissions for this call - // if this is set to true. - bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for retrieving a list of Jobs. -message ListJobsRequest { - // Required. The location and project to list resources on. - // Format: projects/{project}/locations/{location}, where {project} can be - // project id or number. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "run.googleapis.com/Job" } - ]; - - // Maximum number of Jobs to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListJobs. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of Jobs. -message ListJobsResponse { - // The resulting list of Jobs. - repeated Job jobs = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListJobs request to continue. - string next_page_token = 2; -} - -// Request message to delete a Job by its full name. -message DeleteJobRequest { - // Required. The full name of the Job. - // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - // can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Job" } - ]; - - // Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 3; - - // A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 4; -} - -// Request message to create a new Execution of a Job. -message RunJobRequest { - // RunJob Overrides that contains Execution fields to be overridden. - message Overrides { - // Per-container override specification. - message ContainerOverride { - // The name of the container specified as a DNS_LABEL. - string name = 1; - - // Optional. Arguments to the entrypoint. Will replace existing args for - // override. - repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; - - // List of environment variables to set in the container. Will be merged - // with existing env for override. - repeated EnvVar env = 3; - - // Optional. True if the intention is to clear out existing args list. - bool clear_args = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Per container override specification. - repeated ContainerOverride container_overrides = 1; - - // Optional. The desired number of tasks the execution should run. Will - // replace existing task_count value. - int32 task_count = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Duration in seconds the task may be active before the system will - // actively try to mark it failed and kill associated containers. Will - // replace existing timeout_seconds value. - google.protobuf.Duration timeout = 4; - } - - // Required. The full name of the Job. - // Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - // can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Job" } - ]; - - // Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 2; - - // A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 3; - - // Overrides specification for a given execution of a job. If provided, - // overrides will be applied to update the execution or task spec. - Overrides overrides = 4; -} - -// Job represents the configuration of a single job, which references a -// container image that is run to completion. -message Job { - option (google.api.resource) = { - type: "run.googleapis.com/Job" - pattern: "projects/{project}/locations/{location}/jobs/{job}" - style: DECLARATIVE_FRIENDLY - }; - - // The fully qualified name of this Job. - // - // Format: - // projects/{project}/locations/{location}/jobs/{job} - string name = 1; - - // Output only. Server assigned unique identifier for the Execution. The value - // is a UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Unstructured key value map that can be used to organize and categorize - // objects. - // User-provided labels are shared with Google's billing system, so they can - // be used to filter, or break down billing charges by team, component, - // environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - //

Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 Job. - map labels = 4; - - // Unstructured key value map that may - // be set by external tools to store and arbitrary metadata. - // They are not queryable and should be preserved - // when modifying objects. - // - //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected on new resources. All system - // annotations in v1 now have a corresponding field in v2 Job. - // - //

This field follows Kubernetes annotations' namespacing, limits, and - // rules. - map annotations = 5; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The deletion time. It is only populated as a response to a - // Delete request. - google.protobuf.Timestamp delete_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permamently deleted. - google.protobuf.Timestamp expire_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the authenticated creator. - string creator = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the last authenticated modifier. - string last_modifier = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Arbitrary identifier for the API client. - string client = 12; - - // Arbitrary version identifier for the API client. - string client_version = 13; - - // The launch stage as defined by [Google Cloud Platform - // Launch Stages](https://cloud.google.com/terms/launch-stages). - // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - // is assumed. - // Set the launch stage to a preview stage on input to allow use of preview - // features in that stage. On read (or output), describes whether the resource - // uses preview features. - // - // For example, if ALPHA is provided as input, but only BETA and GA-level - // features are used, this field will be BETA on output. - google.api.LaunchStage launch_stage = 14; - - // Settings for the Binary Authorization feature. - BinaryAuthorization binary_authorization = 15; - - // Required. The template used to create executions for this Job. - ExecutionTemplate template = 16 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The generation of this Job. See comments in `reconciling` for - // additional information on reconciliation process in Cloud Run. - int64 observed_generation = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this Job, containing its readiness status, - // and detailed error information in case it did not reach the desired state. - Condition terminal_condition = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Conditions of all other associated sub-resources. They - // contain additional diagnostics information in case the Job does not reach - // its desired state. See comments in `reconciling` for additional information - // on reconciliation process in Cloud Run. - repeated Condition conditions = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Number of executions created for this job. - int32 execution_count = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the last created execution. - ExecutionReference latest_created_execution = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Returns true if the Job is currently being acted upon by the - // system to bring it into the desired state. - // - // When a new Job is created, or an existing one is updated, Cloud Run - // will asynchronously perform all necessary steps to bring the Job to the - // desired state. This process is called reconciliation. - // While reconciliation is in process, `observed_generation` and - // `latest_succeeded_execution`, will have transient values that might - // mismatch the intended state: Once reconciliation is over (and this field is - // false), there are two possible outcomes: reconciliation succeeded and the - // state matches the Job, or there was an error, and reconciliation failed. - // This state can be found in `terminal_condition.state`. - // - // If reconciliation succeeded, the following fields will match: - // `observed_generation` and `generation`, `latest_succeeded_execution` and - // `latest_created_execution`. - // - // If reconciliation failed, `observed_generation` and - // `latest_succeeded_execution` will have the state of the last succeeded - // execution or empty for newly created Job. Additional information on the - // failure can be found in `terminal_condition` and `conditions`. - bool reconciling = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; - - oneof create_execution { - // A unique string used as a suffix creating a new execution. The Job will - // become ready when the execution is successfully started. - // The sum of job name and token length must be fewer than 63 characters. - string start_execution_token = 26; - - // A unique string used as a suffix for creating a new execution. The Job - // will become ready when the execution is successfully completed. - // The sum of job name and token length must be fewer than 63 characters. - string run_execution_token = 27; - } - - // Optional. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OPTIONAL]; -} - -// Reference to an Execution. Use /Executions.GetExecution with the given name -// to get full execution including the latest status. -message ExecutionReference { - // Possible execution completion status. - enum CompletionStatus { - // The default value. This value is used if the state is omitted. - COMPLETION_STATUS_UNSPECIFIED = 0; - - // Job execution has succeeded. - EXECUTION_SUCCEEDED = 1; - - // Job execution has failed. - EXECUTION_FAILED = 2; - - // Job execution is running normally. - EXECUTION_RUNNING = 3; - - // Waiting for backing resources to be provisioned. - EXECUTION_PENDING = 4; - - // Job execution has been cancelled by the user. - EXECUTION_CANCELLED = 5; - } - - // Name of the execution. - string name = 1 [ - (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } - ]; - - // Creation timestamp of the execution. - google.protobuf.Timestamp create_time = 2; - - // Creation timestamp of the execution. - google.protobuf.Timestamp completion_time = 3; - - // The deletion time of the execution. It is only - // populated as a response to a Delete request. - google.protobuf.Timestamp delete_time = 5; - - // Status for the execution completion. - CompletionStatus completion_status = 4; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto deleted file mode 100644 index 0fe03f27aac..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto +++ /dev/null @@ -1,483 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "K8sMinProto"; -option java_package = "com.google.cloud.run.v2"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" -}; -option (google.api.resource_definition) = { - type: "secretmanager.googleapis.com/Secret" - pattern: "projects/{project}/secrets/{secret}" -}; -option (google.api.resource_definition) = { - type: "secretmanager.googleapis.com/SecretVersion" - pattern: "projects/{project}/secrets/{secret}/versions/{version}" -}; -option (google.api.resource_definition) = { - type: "vpcaccess.googleapis.com/Connector" - pattern: "projects/{project}/locations/{location}/connectors/{connector}" -}; - -// A single application container. -// This specifies both the container to run, the command to run in the container -// and the arguments to supply to it. -// Note that additional arguments can be supplied by the system to the container -// at runtime. -message Container { - // Name of the container specified as a DNS_LABEL (RFC 1123). - string name = 1; - - // Required. Name of the container image in Dockerhub, Google Artifact - // Registry, or Google Container Registry. If the host is not provided, - // Dockerhub is assumed. - string image = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Location of the source. - SourceCode source_code = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Entrypoint array. Not executed within a shell. - // The docker image's ENTRYPOINT is used if this is not provided. - repeated string command = 3; - - // Arguments to the entrypoint. - // The docker image's CMD is used if this is not provided. - repeated string args = 4; - - // List of environment variables to set in the container. - repeated EnvVar env = 5; - - // Compute Resource requirements by this container. - ResourceRequirements resources = 6; - - // List of ports to expose from the container. Only a single port can be - // specified. The specified ports must be listening on all interfaces - // (0.0.0.0) within the container to be accessible. - // - // If omitted, a port number will be chosen and passed to the container - // through the PORT environment variable for the container to listen on. - repeated ContainerPort ports = 7; - - // Volume to mount into the container's filesystem. - repeated VolumeMount volume_mounts = 8; - - // Container's working directory. - // If not specified, the container runtime's default will be used, which - // might be configured in the container image. - string working_dir = 9; - - // Periodic probe of container liveness. - // Container will be restarted if the probe fails. - Probe liveness_probe = 10; - - // Startup probe of application within the container. - // All other probes are disabled if a startup probe is provided, until it - // succeeds. Container will not be added to service endpoints if the probe - // fails. - Probe startup_probe = 11; - - // Readiness probe to be used for health checks. - Probe readiness_probe = 14; - - // Names of the containers that must start before this container. - repeated string depends_on = 12; - - // Base image for this container. Only supported for services. If set, it - // indicates that the service is enrolled into automatic base image update. - string base_image_uri = 13; - - // Output only. The build info of the container image. - BuildInfo build_info = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// ResourceRequirements describes the compute resource requirements. -message ResourceRequirements { - // Only `memory`, `cpu` and `nvidia.com/gpu` keys in the map are supported. - // - //

Notes: - // * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 - // CPU requires at least 2Gi of memory. For more information, go to - // https://cloud.google.com/run/docs/configuring/cpu. - // * For supported 'memory' values and syntax, go to - // https://cloud.google.com/run/docs/configuring/memory-limits - // * The only supported 'nvidia.com/gpu' value is '1'. - map limits = 1; - - // Determines whether CPU is only allocated during requests (true by default). - // However, if ResourceRequirements is set, the caller must explicitly - // set this field to true to preserve the default behavior. - bool cpu_idle = 2; - - // Determines whether CPU should be boosted on startup of a new container - // instance above the requested CPU threshold, this can help reduce cold-start - // latency. - bool startup_cpu_boost = 3; -} - -// EnvVar represents an environment variable present in a Container. -message EnvVar { - // Required. Name of the environment variable. Must not exceed 32768 - // characters. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - oneof values { - // Literal value of the environment variable. - // Defaults to "", and the maximum length is 32768 bytes. - // Variable references are not supported in Cloud Run. - string value = 2; - - // Source for the environment variable's value. - EnvVarSource value_source = 3; - } -} - -// EnvVarSource represents a source for the value of an EnvVar. -message EnvVarSource { - // Selects a secret and a specific version from Cloud Secret Manager. - SecretKeySelector secret_key_ref = 1; -} - -// SecretEnvVarSource represents a source for the value of an EnvVar. -message SecretKeySelector { - // Required. The name of the secret in Cloud Secret Manager. - // Format: {secret_name} if the secret is in the same project. - // projects/{project}/secrets/{secret_name} if the secret is - // in a different project. - string secret = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "secretmanager.googleapis.com/Secret" - } - ]; - - // The Cloud Secret Manager secret version. - // Can be 'latest' for the latest version, an integer for a specific version, - // or a version alias. - string version = 2 [(google.api.resource_reference) = { - type: "secretmanager.googleapis.com/SecretVersion" - }]; -} - -// ContainerPort represents a network port in a single container. -message ContainerPort { - // If specified, used to specify which protocol to use. - // Allowed values are "http1" and "h2c". - string name = 1; - - // Port number the container listens on. - // This must be a valid TCP port number, 0 < container_port < 65536. - int32 container_port = 3; -} - -// VolumeMount describes a mounting of a Volume within a container. -message VolumeMount { - // Required. This must match the Name of a Volume. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Path within the container at which the volume should be mounted. - // Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must - // otherwise be `/cloudsql`. All instances defined in the Volume will be - // available as `/cloudsql/[instance]`. For more information on Cloud SQL - // volumes, visit https://cloud.google.com/sql/docs/mysql/connect-run - string mount_path = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Path within the volume from which the container's volume should - // be mounted. Defaults to "" (volume's root). - string sub_path = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Volume represents a named volume in a container. -message Volume { - // Required. Volume's name. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - oneof volume_type { - // Secret represents a secret that should populate this volume. - SecretVolumeSource secret = 2; - - // For Cloud SQL volumes, contains the specific instances that should be - // mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for - // more information on how to connect Cloud SQL and Cloud Run. - CloudSqlInstance cloud_sql_instance = 3; - - // Ephemeral storage used as a shared volume. - EmptyDirVolumeSource empty_dir = 4; - - // For NFS Voumes, contains the path to the nfs Volume - NFSVolumeSource nfs = 5; - - // Persistent storage backed by a Google Cloud Storage bucket. - GCSVolumeSource gcs = 6; - } -} - -// The secret's value will be presented as the content of a file whose -// name is defined in the item path. If no items are defined, the name of -// the file is the secret. -message SecretVolumeSource { - // Required. The name of the secret in Cloud Secret Manager. - // Format: {secret} if the secret is in the same project. - // projects/{project}/secrets/{secret} if the secret is - // in a different project. - string secret = 1 [(google.api.field_behavior) = REQUIRED]; - - // If unspecified, the volume will expose a file whose name is the - // secret, relative to VolumeMount.mount_path + VolumeMount.sub_path. - // If specified, the key will be used as the version to fetch from Cloud - // Secret Manager and the path will be the name of the file exposed in the - // volume. When items are defined, they must specify a path and a version. - repeated VersionToPath items = 2; - - // Integer representation of mode bits to use on created files by default. - // Must be a value between 0000 and 0777 (octal), defaulting to 0444. - // Directories within the path are not affected by this setting. - // - // Notes - // - // * Internally, a umask of 0222 will be applied to any non-zero value. - // * This is an integer representation of the mode bits. So, the octal - // integer value should look exactly as the chmod numeric notation with a - // leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - // or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - // 493 (base-10). - // * This might be in conflict with other options that affect the - // file mode, like fsGroup, and the result can be other mode bits set. - // - // This might be in conflict with other options that affect the - // file mode, like fsGroup, and as a result, other mode bits could be set. - int32 default_mode = 3; -} - -// VersionToPath maps a specific version of a secret to a relative file to mount -// to, relative to VolumeMount's mount_path. -message VersionToPath { - // Required. The relative path of the secret in the container. - string path = 1 [(google.api.field_behavior) = REQUIRED]; - - // The Cloud Secret Manager secret version. - // Can be 'latest' for the latest value, or an integer or a secret alias for a - // specific version. - string version = 2; - - // Integer octal mode bits to use on this file, must be a value between - // 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be - // used. - // - // Notes - // - // * Internally, a umask of 0222 will be applied to any non-zero value. - // * This is an integer representation of the mode bits. So, the octal - // integer value should look exactly as the chmod numeric notation with a - // leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal) - // or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or - // 493 (base-10). - // * This might be in conflict with other options that affect the - // file mode, like fsGroup, and the result can be other mode bits set. - int32 mode = 3; -} - -// Represents a set of Cloud SQL instances. Each one will be available under -// /cloudsql/[instance]. Visit -// https://cloud.google.com/sql/docs/mysql/connect-run for more information on -// how to connect Cloud SQL and Cloud Run. -message CloudSqlInstance { - // The Cloud SQL instance connection names, as can be found in - // https://console.cloud.google.com/sql/instances. Visit - // https://cloud.google.com/sql/docs/mysql/connect-run for more information on - // how to connect Cloud SQL and Cloud Run. Format: - // {project}:{location}:{instance} - repeated string instances = 1; -} - -// In memory (tmpfs) ephemeral storage. -// It is ephemeral in the sense that when the sandbox is taken down, the data is -// destroyed with it (it does not persist across sandbox runs). -message EmptyDirVolumeSource { - // The different types of medium supported for EmptyDir. - enum Medium { - // When not specified, falls back to the default implementation which - // is currently in memory (this may change over time). - MEDIUM_UNSPECIFIED = 0; - - // Explicitly set the EmptyDir to be in memory. Uses tmpfs. - MEMORY = 1; - } - - // The medium on which the data is stored. Acceptable values today is only - // MEMORY or none. When none, the default will currently be backed by memory - // but could change over time. +optional - Medium medium = 1; - - // Limit on the storage usable by this EmptyDir volume. - // The size limit is also applicable for memory medium. - // The maximum usage on memory medium EmptyDir would be the minimum value - // between the SizeLimit specified here and the sum of memory limits of all - // containers. The default is nil which means that the limit is undefined. - // More info: - // https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume. - // Info in Kubernetes: - // https://kubernetes.io/docs/concepts/storage/volumes/#emptydir - string size_limit = 2; -} - -// Represents an NFS mount. -message NFSVolumeSource { - // Hostname or IP address of the NFS server - string server = 1; - - // Path that is exported by the NFS server. - string path = 2; - - // If true, the volume will be mounted as read only for all mounts. - bool read_only = 3; -} - -// Represents a volume backed by a Cloud Storage bucket using Cloud Storage -// FUSE. -message GCSVolumeSource { - // Cloud Storage Bucket name. - string bucket = 1; - - // If true, the volume will be mounted as read only for all mounts. - bool read_only = 2; - - // A list of additional flags to pass to the gcsfuse CLI. - // Options should be specified without the leading "--". - repeated string mount_options = 3; -} - -// Probe describes a health check to be performed against a container to -// determine whether it is alive or ready to receive traffic. -message Probe { - // Optional. Number of seconds after the container has started before the - // probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum - // value for liveness probe is 3600. Maximum value for startup probe is 240. - int32 initial_delay_seconds = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Number of seconds after which the probe times out. - // Defaults to 1 second. Minimum value is 1. Maximum value is 3600. - // Must be smaller than period_seconds. - int32 timeout_seconds = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. How often (in seconds) to perform the probe. - // Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe - // is 3600. Maximum value for startup probe is 240. - // Must be greater or equal than timeout_seconds. - int32 period_seconds = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Minimum consecutive failures for the probe to be considered - // failed after having succeeded. Defaults to 3. Minimum value is 1. - int32 failure_threshold = 4 [(google.api.field_behavior) = OPTIONAL]; - - oneof probe_type { - // Optional. HTTPGet specifies the http request to perform. - // Exactly one of httpGet, tcpSocket, or grpc must be specified. - HTTPGetAction http_get = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. TCPSocket specifies an action involving a TCP port. - // Exactly one of httpGet, tcpSocket, or grpc must be specified. - TCPSocketAction tcp_socket = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. GRPC specifies an action involving a gRPC port. - // Exactly one of httpGet, tcpSocket, or grpc must be specified. - GRPCAction grpc = 7 [(google.api.field_behavior) = OPTIONAL]; - } -} - -// HTTPGetAction describes an action based on HTTP Get requests. -message HTTPGetAction { - // Optional. Path to access on the HTTP server. Defaults to '/'. - string path = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Custom headers to set in the request. HTTP allows repeated - // headers. - repeated HTTPHeader http_headers = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Port number to access on the container. Must be in the range 1 to - // 65535. If not specified, defaults to the exposed port of the container, - // which is the value of container.ports[0].containerPort. - int32 port = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// HTTPHeader describes a custom header to be used in HTTP probes -message HTTPHeader { - // Required. The header field name - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The header field value - string value = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// TCPSocketAction describes an action based on opening a socket -message TCPSocketAction { - // Optional. Port number to access on the container. Must be in the range 1 to - // 65535. If not specified, defaults to the exposed port of the container, - // which is the value of container.ports[0].containerPort. - int32 port = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// GRPCAction describes an action involving a GRPC port. -message GRPCAction { - // Optional. Port number of the gRPC service. Number must be in the range 1 to - // 65535. If not specified, defaults to the exposed port of the container, - // which is the value of container.ports[0].containerPort. - int32 port = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Service is the name of the service to place in the gRPC - // HealthCheckRequest (see - // https://github.com/grpc/grpc/blob/master/doc/health-checking.md ). If this - // is not specified, the default behavior is defined by gRPC. - string service = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Build information of the image. -message BuildInfo { - // Output only. Entry point of the function when the image is a Cloud Run - // function. - string function_target = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Source code location of the image. - string source_location = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Source type for the container. -message SourceCode { - // Cloud Storage source. - message CloudStorageSource { - // Required. The Cloud Storage bucket name. - string bucket = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Cloud Storage object name. - string object = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The Cloud Storage object generation. - int64 generation = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // The source type. - oneof source_type { - // The source is a Cloud Storage bucket. - CloudStorageSource cloud_storage_source = 1; - } -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto deleted file mode 100644 index 8b75df33929..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision.proto +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/api/routing.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/status.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "RevisionProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run Revision Control Plane API. -service Revisions { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Gets information about a Revision. - rpc GetRevision(GetRevisionRequest) returns (Revision) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/services/*/revisions/*}" - additional_bindings { - get: "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists Revisions from a given Service, or from a given location. Results - // are sorted by creation time, descending. - rpc ListRevisions(ListRevisionsRequest) returns (ListRevisionsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*/services/*}/revisions" - additional_bindings { - get: "/v2/{parent=projects/*/locations/*/workerPools/*}/revisions" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a Revision. - rpc DeleteRevision(DeleteRevisionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/services/*/revisions/*}" - additional_bindings { - delete: "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" - } - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Revision" - metadata_type: "Revision" - }; - } -} - -// Request message for obtaining a Revision by its full name. -message GetRevisionRequest { - // Required. The full name of the Revision. - // Format: - // projects/{project}/locations/{location}/services/{service}/revisions/{revision} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; -} - -// Request message for retrieving a list of Revisions. -message ListRevisionsRequest { - // Required. The Service from which the Revisions should be listed. - // To list all Revisions across Services, use "-" instead of Service name. - // Format: - // projects/{project}/locations/{location}/services/{service} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/Revision" - } - ]; - - // Maximum number of revisions to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListRevisions. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of Revisions. -message ListRevisionsResponse { - // The resulting list of Revisions. - repeated Revision revisions = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListRevisions request to continue. - string next_page_token = 2; -} - -// Request message for deleting a retired Revision. -// Revision lifecycle is usually managed by making changes to the parent -// Service. Only retired revisions can be deleted with this API. -message DeleteRevisionRequest { - // Required. The name of the Revision to delete. - // Format: - // projects/{project}/locations/{location}/services/{service}/revisions/{revision} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 2; - - // A system-generated fingerprint for this version of the - // resource. This may be used to detect modification conflict during updates. - string etag = 3; -} - -// A Revision is an immutable snapshot of code and configuration. A Revision -// references a container image. Revisions are only created by updates to its -// parent Service. -message Revision { - option (google.api.resource) = { - type: "run.googleapis.com/Revision" - pattern: "projects/{project}/locations/{location}/services/{service}/revisions/{revision}" - style: DECLARATIVE_FRIENDLY - }; - - // Output only. The unique name of this Revision. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server assigned unique identifier for the Revision. The value - // is a UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that may - // be set by external tools to store and arbitrary metadata. - // They are not queryable and should be preserved - // when modifying objects. - map annotations = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the deletion time. It is only - // populated as a response to a Delete request. - google.protobuf.Timestamp delete_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permamently deleted. It is only populated as a response to a Delete - // request. - google.protobuf.Timestamp expire_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The least stable launch stage needed to create this resource, as defined by - // [Google Cloud Platform Launch - // Stages](https://cloud.google.com/terms/launch-stages). Cloud Run supports - // `ALPHA`, `BETA`, and `GA`. - // - // Note that this value might not be what was used - // as input. For example, if ALPHA was provided as input in the parent - // resource, but only BETA and GA-level features are were, this field will be - // BETA. - google.api.LaunchStage launch_stage = 10; - - // Output only. The name of the parent service. - string service = 11 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Service" } - ]; - - // Scaling settings for this revision. - RevisionScaling scaling = 12; - - // VPC Access configuration for this Revision. For more information, visit - // https://cloud.google.com/run/docs/configuring/connecting-vpc. - VpcAccess vpc_access = 13; - - // Sets the maximum number of requests that each serving instance can receive. - int32 max_instance_request_concurrency = 34; - - // Max allowed time for an instance to respond to a request. - google.protobuf.Duration timeout = 15; - - // Email address of the IAM service account associated with the revision of - // the service. The service account represents the identity of the running - // revision, and determines what permissions the revision has. - string service_account = 16; - - // Holds the single container that defines the unit of execution for this - // Revision. - repeated Container containers = 17; - - // A list of Volumes to make available to containers. - repeated Volume volumes = 18; - - // The execution environment being used to host this Revision. - ExecutionEnvironment execution_environment = 20; - - // A reference to a customer managed encryption key (CMEK) to use to encrypt - // this container image. For more information, go to - // https://cloud.google.com/run/docs/securing/using-cmek - string encryption_key = 21 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Enables service mesh connectivity. - ServiceMesh service_mesh = 22; - - // The action to take if the encryption key is revoked. - EncryptionKeyRevocationAction encryption_key_revocation_action = 23; - - // If encryption_key_revocation_action is SHUTDOWN, the duration before - // shutting down all instances. The minimum increment is 1 hour. - google.protobuf.Duration encryption_key_shutdown_duration = 24; - - // Output only. Indicates whether the resource's reconciliation is still in - // progress. See comments in `Service.reconciling` for additional information - // on reconciliation process in Cloud Run. - bool reconciling = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this Revision, containing its readiness - // status, and detailed error information in case it did not reach a serving - // state. - repeated Condition conditions = 31 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The generation of this Revision currently serving traffic. See - // comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. - int64 observed_generation = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Google Console URI to obtain logs for the Revision. - string log_uri = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 37 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Enable session affinity. - bool session_affinity = 38; - - // Output only. The current effective scaling settings for the revision. - RevisionScalingStatus scaling_status = 39 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The node selector for the revision. - NodeSelector node_selector = 40; - - // Optional. Output only. True if GPU zonal redundancy is disabled on this - // revision. - optional bool gpu_zonal_redundancy_disabled = 48 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. Email address of the authenticated creator. - string creator = 49 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto deleted file mode 100644 index b29c95c4892..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/revision_template.proto +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "RevisionTemplateProto"; -option java_package = "com.google.cloud.run.v2"; - -// RevisionTemplate describes the data a revision should have when created from -// a template. -message RevisionTemplate { - // Optional. The unique name for the revision. If this field is omitted, it - // will be automatically generated based on the Service name. - string revision = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Optional. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - //

Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 RevisionTemplate. - map labels = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Unstructured key value map that may be set by external tools to - // store and arbitrary metadata. They are not queryable and should be - // preserved when modifying objects. - // - //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system annotations in v1 now - // have a corresponding field in v2 RevisionTemplate. - // - //

This field follows Kubernetes annotations' namespacing, limits, and - // rules. - map annotations = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Scaling settings for this Revision. - RevisionScaling scaling = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. VPC Access configuration to use for this Revision. For more - // information, visit - // https://cloud.google.com/run/docs/configuring/connecting-vpc. - VpcAccess vpc_access = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Max allowed time for an instance to respond to a request. - google.protobuf.Duration timeout = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Email address of the IAM service account associated with the - // revision of the service. The service account represents the identity of the - // running revision, and determines what permissions the revision has. If not - // provided, the revision will use the project's default service account. - string service_account = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Holds the single container that defines the unit of execution for this - // Revision. - repeated Container containers = 10; - - // Optional. A list of Volumes to make available to containers. - repeated Volume volumes = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The sandbox environment to host this Revision. - ExecutionEnvironment execution_environment = 13 - [(google.api.field_behavior) = OPTIONAL]; - - // A reference to a customer managed encryption key (CMEK) to use to encrypt - // this container image. For more information, go to - // https://cloud.google.com/run/docs/securing/using-cmek - string encryption_key = 14 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Optional. Sets the maximum number of requests that each serving instance - // can receive. If not specified or 0, concurrency defaults to 80 when - // requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`. - int32 max_instance_request_concurrency = 15 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enables service mesh connectivity. - ServiceMesh service_mesh = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The action to take if the encryption key is revoked. - EncryptionKeyRevocationAction encryption_key_revocation_action = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If encryption_key_revocation_action is SHUTDOWN, the duration - // before shutting down all instances. The minimum increment is 1 hour. - google.protobuf.Duration encryption_key_shutdown_duration = 18 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enable session affinity. - bool session_affinity = 19 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Disables health checking containers during deployment. - bool health_check_disabled = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The node selector for the revision template. - NodeSelector node_selector = 21 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. True if GPU zonal redundancy is disabled on this revision. - optional bool gpu_zonal_redundancy_disabled = 24 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto deleted file mode 100644 index 506638a1a07..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/service.proto +++ /dev/null @@ -1,520 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/api/routing.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/revision_template.proto"; -import "google/cloud/run/v2/traffic_target.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "ServiceProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run Service Control Plane API -service Services { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a new Service in a given project and location. - rpc CreateService(CreateServiceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/locations/*}/services" - body: "service" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent,service,service_id"; - option (google.longrunning.operation_info) = { - response_type: "Service" - metadata_type: "Service" - }; - } - - // Gets information about a Service. - rpc GetService(GetServiceRequest) returns (Service) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/services/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists Services. Results are sorted by creation time, descending. - rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*}/services" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a Service. - rpc UpdateService(UpdateServiceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v2/{service.name=projects/*/locations/*/services/*}" - body: "service" - }; - option (google.api.routing) = { - routing_parameters { - field: "service.name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "service"; - option (google.api.method_signature) = "service,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Service" - metadata_type: "Service" - }; - } - - // Deletes a Service. - // This will cause the Service to stop serving traffic and will delete all - // revisions. - rpc DeleteService(DeleteServiceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/services/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Service" - metadata_type: "Service" - }; - } - - // Gets the IAM Access Control policy currently in effect for the given - // Cloud Run Service. This result does not include any inherited policies. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - get: "/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy" - }; - } - - // Sets the IAM Access control policy for the specified Service. Overwrites - // any existing policy. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy" - body: "*" - }; - } - - // Returns permissions that a caller has on the specified Project. - // - // There are no permissions required for making this API call. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions" - body: "*" - }; - } -} - -// Request message for creating a Service. -message CreateServiceRequest { - // Required. The location and project in which this service should be created. - // Format: projects/{project}/locations/{location}, where {project} can be - // project id or number. Only lowercase characters, digits, and hyphens. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/Service" - } - ]; - - // Required. The Service instance to create. - Service service = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The unique identifier for the Service. It must begin with letter, - // and cannot end with hyphen; must contain fewer than 50 characters. - // The name of the service becomes {parent}/services/{service_id}. - string service_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Indicates that the request should be validated and default values - // populated, without persisting the request or creating any resources. - bool validate_only = 4; -} - -// Request message for updating a service. -message UpdateServiceRequest { - // Optional. The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The Service to be updated. - Service service = 1 [(google.api.field_behavior) = REQUIRED]; - - // Indicates that the request should be validated and default values - // populated, without persisting the request or updating any resources. - bool validate_only = 3; - - // Optional. If set to true, and if the Service does not exist, it will create - // a new one. The caller must have 'run.services.create' permissions if this - // is set to true and the Service does not exist. - bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for retrieving a list of Services. -message ListServicesRequest { - // Required. The location and project to list resources on. - // Location must be a valid Google Cloud region, and cannot be the "-" - // wildcard. Format: projects/{project}/locations/{location}, where {project} - // can be project id or number. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/Service" - } - ]; - - // Maximum number of Services to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListServices. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of Services. -message ListServicesResponse { - // The resulting list of Services. - repeated Service services = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListServices request to continue. - string next_page_token = 2; - - // Output only. For global requests, returns the list of regions that could - // not be reached within the deadline. - repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for obtaining a Service by its full name. -message GetServiceRequest { - // Required. The full name of the Service. - // Format: projects/{project}/locations/{location}/services/{service}, where - // {project} can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Service" } - ]; -} - -// Request message to delete a Service by its full name. -message DeleteServiceRequest { - // Required. The full name of the Service. - // Format: projects/{project}/locations/{location}/services/{service}, where - // {project} can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Service" } - ]; - - // Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 2; - - // A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 3; -} - -// Service acts as a top-level container that manages a set of -// configurations and revision templates which implement a network service. -// Service exists to provide a singular abstraction which can be access -// controlled, reasoned about, and which encapsulates software lifecycle -// decisions such as rollout policy and team resource ownership. -message Service { - option (google.api.resource) = { - type: "run.googleapis.com/Service" - pattern: "projects/{project}/locations/{location}/services/{service}" - style: DECLARATIVE_FRIENDLY - }; - - // Settings for multi-region deployment. - message MultiRegionSettings { - // Required. List of regions to deploy to, including primary region. - repeated string regions = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. System-generated unique id for the multi-region Service. - string multi_region_id = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Identifier. The fully qualified name of this Service. In - // CreateServiceRequest, this field is ignored, and instead composed from - // CreateServiceRequest.parent and CreateServiceRequest.service_id. - // - // Format: - // projects/{project}/locations/{location}/services/{service_id} - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // User-provided description of the Service. This field currently has a - // 512-character limit. - string description = 2; - - // Output only. Server assigned unique identifier for the trigger. The value - // is a UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - // Please note that unlike v1, this is an int64 value. As with most Google - // APIs, its JSON representation will be a `string` instead of an `integer`. - int64 generation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - //

Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 Service. - map labels = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Unstructured key value map that may be set by external tools to - // store and arbitrary metadata. They are not queryable and should be - // preserved when modifying objects. - // - //

Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected in new resources. All system - // annotations in v1 now have a corresponding field in v2 Service. - // - //

This field follows Kubernetes - // annotations' namespacing, limits, and rules. - map annotations = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The deletion time. It is only populated as a response to a - // Delete request. - google.protobuf.Timestamp delete_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permanently deleted. - google.protobuf.Timestamp expire_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the authenticated creator. - string creator = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the last authenticated modifier. - string last_modifier = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Arbitrary identifier for the API client. - string client = 13; - - // Arbitrary version identifier for the API client. - string client_version = 14; - - // Optional. Provides the ingress settings for this Service. On output, - // returns the currently observed ingress settings, or - // INGRESS_TRAFFIC_UNSPECIFIED if no revision is active. - IngressTraffic ingress = 15 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The launch stage as defined by [Google Cloud Platform - // Launch Stages](https://cloud.google.com/terms/launch-stages). - // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - // is assumed. - // Set the launch stage to a preview stage on input to allow use of preview - // features in that stage. On read (or output), describes whether the resource - // uses preview features. - // - // For example, if ALPHA is provided as input, but only BETA and GA-level - // features are used, this field will be BETA on output. - google.api.LaunchStage launch_stage = 16 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings for the Binary Authorization feature. - BinaryAuthorization binary_authorization = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The template used to create revisions for this Service. - RevisionTemplate template = 18 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifies how to distribute traffic over a collection of - // Revisions belonging to the Service. If traffic is empty or not provided, - // defaults to 100% traffic to the latest `Ready` Revision. - repeated TrafficTarget traffic = 19 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies service-level scaling settings - ServiceScaling scaling = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Disables IAM permission check for run.routes.invoke for callers - // of this service. For more information, visit - // https://cloud.google.com/run/docs/securing/managing-access#invoker_check. - bool invoker_iam_disabled = 21 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Disables public resolution of the default URI of this service. - bool default_uri_disabled = 22 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. All URLs serving traffic for this Service. - repeated string urls = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. IAP settings on the Service. - bool iap_enabled = 25 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings for multi-region deployment. - MultiRegionSettings multi_region_settings = 26 - [(google.api.field_behavior) = OPTIONAL]; - - // One or more custom audiences that you want this service to support. Specify - // each custom audience as the full URL in a string. The custom audiences are - // encoded in the token and used to authenticate requests. For more - // information, see - // https://cloud.google.com/run/docs/configuring/custom-audiences. - repeated string custom_audiences = 37; - - // Output only. The generation of this Service currently serving traffic. See - // comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. Please note that unlike v1, this is an int64 value. - // As with most Google APIs, its JSON representation will be a `string` - // instead of an `integer`. - int64 observed_generation = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this Service, containing its readiness - // status, and detailed error information in case it did not reach a serving - // state. See comments in `reconciling` for additional information on - // reconciliation process in Cloud Run. - Condition terminal_condition = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Conditions of all other associated sub-resources. They - // contain additional diagnostics information in case the Service does not - // reach its Serving state. See comments in `reconciling` for additional - // information on reconciliation process in Cloud Run. - repeated Condition conditions = 32 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the latest revision that is serving traffic. See - // comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. - string latest_ready_revision = 33 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Output only. Name of the last created revision. See comments in - // `reconciling` for additional information on reconciliation process in Cloud - // Run. - string latest_created_revision = 34 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Output only. Detailed status information for corresponding traffic targets. - // See comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. - repeated TrafficTargetStatus traffic_statuses = 35 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The main URI in which this Service is serving traffic. - string uri = 36 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. True if Cloud Run Threat Detection monitoring is enabled for - // the parent project of this Service. - bool threat_detection_enabled = 40 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Configuration for building a Cloud Run function. - BuildConfig build_config = 41 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Returns true if the Service is currently being acted upon by - // the system to bring it into the desired state. - // - // When a new Service is created, or an existing one is updated, Cloud Run - // will asynchronously perform all necessary steps to bring the Service to the - // desired serving state. This process is called reconciliation. - // While reconciliation is in process, `observed_generation`, - // `latest_ready_revision`, `traffic_statuses`, and `uri` will have transient - // values that might mismatch the intended state: Once reconciliation is over - // (and this field is false), there are two possible outcomes: reconciliation - // succeeded and the serving state matches the Service, or there was an error, - // and reconciliation failed. This state can be found in - // `terminal_condition.state`. - // - // If reconciliation succeeded, the following fields will match: `traffic` and - // `traffic_statuses`, `observed_generation` and `generation`, - // `latest_ready_revision` and `latest_created_revision`. - // - // If reconciliation failed, `traffic_statuses`, `observed_generation`, and - // `latest_ready_revision` will have the state of the last serving revision, - // or empty for newly created Services. Additional information on the failure - // can be found in `terminal_condition` and `conditions`. - bool reconciling = 98 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto deleted file mode 100644 index 68e98cfd839..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/status.proto +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "StatusProto"; -option java_package = "com.google.cloud.run.v2"; - -// Effective settings for the current revision -message RevisionScalingStatus { - // The current number of min instances provisioned for this revision. - int32 desired_min_instance_count = 1; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto deleted file mode 100644 index a4bb905576e..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task.proto +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "TaskProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run Task Control Plane API. -service Tasks { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Gets information about a Task. - rpc GetTask(GetTaskRequest) returns (Task) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Tasks from an Execution of a Job. - rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for obtaining a Task by its full name. -message GetTaskRequest { - // Required. The full name of the Task. - // Format: - // projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/Task" } - ]; -} - -// Request message for retrieving a list of Tasks. -message ListTasksRequest { - // Required. The Execution from which the Tasks should be listed. - // To list all Tasks across Executions of a Job, use "-" instead of Execution - // name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - // projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "run.googleapis.com/Task" } - ]; - - // Maximum number of Tasks to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListTasks. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of Tasks. -message ListTasksResponse { - // The resulting list of Tasks. - repeated Task tasks = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListTasks request to continue. - string next_page_token = 2; -} - -// Task represents a single run of a container to completion. -message Task { - option (google.api.resource) = { - type: "run.googleapis.com/Task" - pattern: "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}" - style: DECLARATIVE_FRIENDLY - }; - - // Output only. The unique name of this Task. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server assigned unique identifier for the Task. The value is a - // UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - int64 generation = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels - map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Unstructured key value map that may - // be set by external tools to store and arbitrary metadata. - // They are not queryable and should be preserved - // when modifying objects. - map annotations = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the task was created by the system. - // It is not guaranteed to be set in happens-before order across separate - // operations. - google.protobuf.Timestamp create_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the task was scheduled to run by the - // system. It is not guaranteed to be set in happens-before order across - // separate operations. - google.protobuf.Timestamp scheduled_time = 34 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the task started to run. - // It is not guaranteed to be set in happens-before order across separate - // operations. - google.protobuf.Timestamp start_time = 27 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Represents time when the Task was completed. It is not - // guaranteed to be set in happens-before order across separate operations. - google.protobuf.Timestamp completion_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the deletion time. It is only - // populated as a response to a Delete request. - google.protobuf.Timestamp delete_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permamently deleted. It is only populated as a response to a Delete - // request. - google.protobuf.Timestamp expire_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The name of the parent Job. - string job = 12 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Job" } - ]; - - // Output only. The name of the parent Execution. - string execution = 13 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Execution" } - ]; - - // Holds the single container that defines the unit of execution for this - // task. - repeated Container containers = 14; - - // A list of Volumes to make available to containers. - repeated Volume volumes = 15; - - // Number of retries allowed per Task, before marking this Task failed. - int32 max_retries = 16; - - // Max allowed time duration the Task may be active before the system will - // actively try to mark it failed and kill associated containers. This applies - // per attempt of a task, meaning each retry can run for the full timeout. - google.protobuf.Duration timeout = 17; - - // Email address of the IAM service account associated with the Task of a - // Job. The service account represents the identity of the - // running task, and determines what permissions the task has. If - // not provided, the task will use the project's default service account. - string service_account = 18; - - // The execution environment being used to host this Task. - ExecutionEnvironment execution_environment = 20; - - // Output only. Indicates whether the resource's reconciliation is still in - // progress. See comments in `Job.reconciling` for additional information on - // reconciliation process in Cloud Run. - bool reconciling = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this Task, containing its readiness status, - // and detailed error information in case it did not reach the desired state. - repeated Condition conditions = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The generation of this Task. See comments in `Job.reconciling` - // for additional information on reconciliation process in Cloud Run. - int64 observed_generation = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Index of the Task, unique per execution, and beginning at 0. - int32 index = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of times this Task was retried. - // Tasks are retried when they fail up to the maxRetries limit. - int32 retried = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Result of the last attempt of this Task. - TaskAttemptResult last_attempt_result = 26 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A reference to a customer managed encryption key (CMEK) to use - // to encrypt this container image. For more information, go to - // https://cloud.google.com/run/docs/securing/using-cmek - string encryption_key = 28 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; - - // Output only. VPC Access configuration to use for this Task. For more - // information, visit - // https://cloud.google.com/run/docs/configuring/connecting-vpc. - VpcAccess vpc_access = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. URI where logs for this execution can be found in Cloud - // Console. - string log_uri = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The node selector for the task. - NodeSelector node_selector = 36 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Output only. True if GPU zonal redundancy is disabled on this - // task. - optional bool gpu_zonal_redundancy_disabled = 37 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Result of a task attempt. -message TaskAttemptResult { - // Output only. The status of this attempt. - // If the status code is OK, then the attempt succeeded. - google.rpc.Status status = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The exit code of this attempt. - // This may be unset if the container was unable to exit cleanly with a code - // due to some other failure. - // See status field for possible failure details. - // - // At most one of exit_code or term_signal will be set. - int32 exit_code = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Termination signal of the container. This is set to non-zero - // if the container is terminated by the system. - // - // At most one of exit_code or term_signal will be set. - int32 term_signal = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto deleted file mode 100644 index fddfe2d394d..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/task_template.proto +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "TaskTemplateProto"; -option java_package = "com.google.cloud.run.v2"; - -// TaskTemplate describes the data a task should have when created -// from a template. -message TaskTemplate { - // Holds the single container that defines the unit of execution for this - // task. - repeated Container containers = 1; - - // Optional. A list of Volumes to make available to containers. - repeated Volume volumes = 2 [(google.api.field_behavior) = OPTIONAL]; - - oneof retries { - // Number of retries allowed per Task, before marking this Task failed. - // Defaults to 3. - int32 max_retries = 3; - } - - // Optional. Max allowed time duration the Task may be active before the - // system will actively try to mark it failed and kill associated containers. - // This applies per attempt of a task, meaning each retry can run for the full - // timeout. Defaults to 600 seconds. - google.protobuf.Duration timeout = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Email address of the IAM service account associated with the Task - // of a Job. The service account represents the identity of the running task, - // and determines what permissions the task has. If not provided, the task - // will use the project's default service account. - string service_account = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The execution environment being used to host this Task. - ExecutionEnvironment execution_environment = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // A reference to a customer managed encryption key (CMEK) to use to encrypt - // this container image. For more information, go to - // https://cloud.google.com/run/docs/securing/using-cmek - string encryption_key = 7 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Optional. VPC Access configuration to use for this Task. For more - // information, visit - // https://cloud.google.com/run/docs/configuring/connecting-vpc. - VpcAccess vpc_access = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The node selector for the task template. - NodeSelector node_selector = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. True if GPU zonal redundancy is disabled on this task template. - optional bool gpu_zonal_redundancy_disabled = 12 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto deleted file mode 100644 index 7dfec861029..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/traffic_target.proto +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "TrafficTargetProto"; -option java_package = "com.google.cloud.run.v2"; - -// Holds a single traffic routing entry for the Service. Allocations can be done -// to a specific Revision name, or pointing to the latest Ready Revision. -message TrafficTarget { - // The allocation type for this traffic target. - TrafficTargetAllocationType type = 1; - - // Revision to which to send this portion of traffic, if traffic allocation is - // by revision. - string revision = 2 [ - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Specifies percent of the traffic to this Revision. - // This defaults to zero if unspecified. - int32 percent = 3; - - // Indicates a string to be part of the URI to exclusively reference this - // target. - string tag = 4; -} - -// Represents the observed state of a single `TrafficTarget` entry. -message TrafficTargetStatus { - // The allocation type for this traffic target. - TrafficTargetAllocationType type = 1; - - // Revision to which this traffic is sent. - string revision = 2 [ - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Specifies percent of the traffic to this Revision. - int32 percent = 3; - - // Indicates the string used in the URI to exclusively reference this target. - string tag = 4; - - // Displays the target URI. - string uri = 5; -} - -// The type of instance allocation. -enum TrafficTargetAllocationType { - // Unspecified instance allocation type. - TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0; - - // Allocates instances to the Service's latest ready Revision. - TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1; - - // Allocates instances to a Revision by name. - TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto deleted file mode 100644 index 67074b4c875..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/vendor_settings.proto +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "VendorSettingsProto"; -option java_package = "com.google.cloud.run.v2"; -option (google.api.resource_definition) = { - type: "binaryauthorization.googleapis.com/Policy" - pattern: "projects/{project}/policy" - pattern: "locations/{location}/policy" -}; -option (google.api.resource_definition) = { - type: "networkservices.googleapis.com/Mesh" - pattern: "projects/{project}/locations/{location}/meshes/{mesh}" -}; -option (google.api.resource_definition) = { - type: "cloudbuild.googleapis.com/Build" - pattern: "projects/{project}/locations/{location}/builds/{build}" -}; - -// VPC Access settings. For more information on sending traffic to a VPC -// network, visit https://cloud.google.com/run/docs/configuring/connecting-vpc. -message VpcAccess { - // Egress options for VPC access. - enum VpcEgress { - // Unspecified - VPC_EGRESS_UNSPECIFIED = 0; - - // All outbound traffic is routed through the VPC connector. - ALL_TRAFFIC = 1; - - // Only private IP ranges are routed through the VPC connector. - PRIVATE_RANGES_ONLY = 2; - } - - // Direct VPC egress settings. - message NetworkInterface { - // Optional. The VPC network that the Cloud Run resource will be able to - // send traffic to. At least one of network or subnetwork must be specified. - // If both network and subnetwork are specified, the given VPC subnetwork - // must belong to the given VPC network. If network is not specified, it - // will be looked up from the subnetwork. - string network = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The VPC subnetwork that the Cloud Run resource will get IPs - // from. At least one of network or subnetwork must be specified. If both - // network and subnetwork are specified, the given VPC subnetwork must - // belong to the given VPC network. If subnetwork is not specified, the - // subnetwork with the same name with the network will be used. - string subnetwork = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Network tags applied to this Cloud Run resource. - repeated string tags = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // VPC Access connector name. - // Format: `projects/{project}/locations/{location}/connectors/{connector}`, - // where `{project}` can be project id or number. - // For more information on sending traffic to a VPC network via a connector, - // visit https://cloud.google.com/run/docs/configuring/vpc-connectors. - string connector = 1 [(google.api.resource_reference) = { - type: "vpcaccess.googleapis.com/Connector" - }]; - - // Optional. Traffic VPC egress settings. If not provided, it defaults to - // PRIVATE_RANGES_ONLY. - VpcEgress egress = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Direct VPC egress settings. Currently only single network - // interface is supported. - repeated NetworkInterface network_interfaces = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings for Binary Authorization feature. -message BinaryAuthorization { - oneof binauthz_method { - // Optional. If True, indicates to use the default project's binary - // authorization policy. If False, binary authorization will be disabled. - bool use_default = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The path to a binary authorization policy. - // Format: `projects/{project}/platforms/cloudRun/{policy-name}` - string policy = 3 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "binaryauthorization.googleapis.com/Policy" - } - ]; - } - - // Optional. If present, indicates to use Breakglass using this justification. - // If use_default is False, then it must be empty. - // For more information on breakglass, see - // https://cloud.google.com/binary-authorization/docs/using-breakglass - string breakglass_justification = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings for revision-level scaling settings. -message RevisionScaling { - // Optional. Minimum number of serving instances that this resource should - // have. - int32 min_instance_count = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum number of serving instances that this resource should - // have. When unspecified, the field is set to the server default value of - // 100. For more information see - // https://cloud.google.com/run/docs/configuring/max-instances - int32 max_instance_count = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings for Cloud Service Mesh. For more information see -// https://cloud.google.com/service-mesh/docs/overview. -message ServiceMesh { - // The Mesh resource name. Format: - // `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can - // be project id or number. - string mesh = 1 [(google.api.resource_reference) = { - type: "networkservices.googleapis.com/Mesh" - }]; -} - -// Scaling settings applied at the service level rather than -// at the revision level. -message ServiceScaling { - // The scaling mode for the service. If not provided, it defaults to - // AUTOMATIC. - enum ScalingMode { - // Unspecified. - SCALING_MODE_UNSPECIFIED = 0; - - // Scale based on traffic between min and max instances. - AUTOMATIC = 1; - - // Scale to exactly min instances and ignore max instances. - MANUAL = 2; - } - - // Optional. total min instances for the service. This number of instances is - // divided among all revisions with specified traffic based on the percent - // of traffic they are receiving. - int32 min_instance_count = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The scaling mode for the service. - ScalingMode scaling_mode = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. total max instances for the service. This number of instances is - // divided among all revisions with specified traffic based on the percent - // of traffic they are receiving. - int32 max_instance_count = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. total instance count for the service in manual scaling mode. This - // number of instances is divided among all revisions with specified traffic - // based on the percent of traffic they are receiving. - optional int32 manual_instance_count = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Worker pool scaling settings. -message WorkerPoolScaling { - // Optional. The total number of instances in manual scaling mode. - optional int32 manual_instance_count = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Hardware constraints configuration. -message NodeSelector { - // Required. GPU accelerator type to attach to an instance. - string accelerator = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Describes the Build step of the function that builds a container from the -// given source. -message BuildConfig { - // Output only. The Cloud Build name of the latest successful deployment of - // the function. - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudbuild.googleapis.com/Build" - } - ]; - - // The Cloud Storage bucket URI where the function source code is located. - string source_location = 2; - - // Optional. The name of the function (as defined in source code) that will be - // executed. Defaults to the resource name suffix, if not specified. For - // backward compatibility, if function with given name is not found, then the - // system will try to use function named "function". - string function_target = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Artifact Registry URI to store the built image. - string image_uri = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The base image used to build the function. - string base_image = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Sets whether the function will receive automatic base image - // updates. - bool enable_automatic_updates = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Name of the Cloud Build Custom Worker Pool that should be used to - // build the Cloud Run function. The format of this field is - // `projects/{project}/locations/{region}/workerPools/{workerPool}` where - // `{project}` and `{region}` are the project id and region respectively where - // the worker pool is defined and `{workerPool}` is the short name of the - // worker pool. - string worker_pool = 7 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudbuild.googleapis.com/BuildWorkerPool" - } - ]; - - // Optional. User-provided build-time environment variables for the function - map environment_variables = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Service account to be used for building the container. The format - // of this field is - // `projects/{projectId}/serviceAccounts/{serviceAccountEmail}`. - string service_account = 9 [(google.api.field_behavior) = OPTIONAL]; -} - -// Allowed ingress traffic for the Container. -enum IngressTraffic { - // Unspecified - INGRESS_TRAFFIC_UNSPECIFIED = 0; - - // All inbound traffic is allowed. - INGRESS_TRAFFIC_ALL = 1; - - // Only internal traffic is allowed. - INGRESS_TRAFFIC_INTERNAL_ONLY = 2; - - // Both internal and Google Cloud Load Balancer traffic is allowed. - INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; - - // No ingress traffic is allowed. - INGRESS_TRAFFIC_NONE = 4; -} - -// Alternatives for execution environments. -enum ExecutionEnvironment { - // Unspecified - EXECUTION_ENVIRONMENT_UNSPECIFIED = 0; - - // Uses the First Generation environment. - EXECUTION_ENVIRONMENT_GEN1 = 1; - - // Uses Second Generation environment. - EXECUTION_ENVIRONMENT_GEN2 = 2; -} - -// Specifies behavior if an encryption key used by a resource is revoked. -enum EncryptionKeyRevocationAction { - // Unspecified - ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0; - - // Prevents the creation of new instances. - PREVENT_NEW = 1; - - // Shuts down existing instances, and prevents creation of new ones. - SHUTDOWN = 2; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto deleted file mode 100644 index 5a19ae2b1ef..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool.proto +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; -import "google/api/routing.proto"; -import "google/cloud/run/v2/condition.proto"; -import "google/cloud/run/v2/instance_split.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/cloud/run/v2/worker_pool_revision_template.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "WorkerPoolProto"; -option java_package = "com.google.cloud.run.v2"; - -// Cloud Run WorkerPool Control Plane API. -service WorkerPools { - option (google.api.default_host) = "run.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a new WorkerPool in a given project and location. - rpc CreateWorkerPool(CreateWorkerPoolRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/locations/*}/workerPools" - body: "worker_pool" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent,worker_pool,worker_pool_id"; - option (google.longrunning.operation_info) = { - response_type: "WorkerPool" - metadata_type: "WorkerPool" - }; - } - - // Gets information about a WorkerPool. - rpc GetWorkerPool(GetWorkerPoolRequest) returns (WorkerPool) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/workerPools/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists WorkerPools. Results are sorted by creation time, descending. - rpc ListWorkerPools(ListWorkerPoolsRequest) - returns (ListWorkerPoolsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*}/workerPools" - }; - option (google.api.routing) = { - routing_parameters { - field: "parent" - path_template: "projects/*/locations/{location=*}" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a WorkerPool. - rpc UpdateWorkerPool(UpdateWorkerPoolRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v2/{worker_pool.name=projects/*/locations/*/workerPools/*}" - body: "worker_pool" - }; - option (google.api.routing) = { - routing_parameters { - field: "worker_pool.name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "worker_pool"; - option (google.api.method_signature) = "worker_pool,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "WorkerPool" - metadata_type: "WorkerPool" - }; - } - - // Deletes a WorkerPool. - rpc DeleteWorkerPool(DeleteWorkerPoolRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/workerPools/*}" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "projects/*/locations/{location=*}/**" - } - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "WorkerPool" - metadata_type: "WorkerPool" - }; - } - - // Gets the IAM Access Control policy currently in effect for the given - // Cloud Run WorkerPool. This result does not include any inherited policies. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - get: "/v2/{resource=projects/*/locations/*/workerPools/*}:getIamPolicy" - }; - } - - // Sets the IAM Access control policy for the specified WorkerPool. Overwrites - // any existing policy. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/workerPools/*}:setIamPolicy" - body: "*" - }; - } - - // Returns permissions that a caller has on the specified Project. - // - // There are no permissions required for making this API call. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/workerPools/*}:testIamPermissions" - body: "*" - }; - } -} - -// Request message for creating a WorkerPool. -message CreateWorkerPoolRequest { - // Required. The location and project in which this worker pool should be - // created. Format: `projects/{project}/locations/{location}`, where - // `{project}` can be project id or number. Only lowercase characters, digits, - // and hyphens. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/WorkerPool" - } - ]; - - // Required. The WorkerPool instance to create. - WorkerPool worker_pool = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The unique identifier for the WorkerPool. It must begin with - // letter, and cannot end with hyphen; must contain fewer than 50 characters. - // The name of the worker pool becomes - // `{parent}/workerPools/{worker_pool_id}`. - string worker_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Indicates that the request should be validated and default values - // populated, without persisting the request or creating any resources. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for updating a worker pool. -message UpdateWorkerPoolRequest { - // Optional. The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The WorkerPool to be updated. - WorkerPool worker_pool = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Indicates that the request should be validated and default values - // populated, without persisting the request or updating any resources. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, and if the WorkerPool does not exist, it will - // create a new one. The caller must have 'run.workerpools.create' permissions - // if this is set to true and the WorkerPool does not exist. - bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, a new revision will be created from the template - // even if the system doesn't detect any changes from the previously deployed - // revision. - // - // This may be useful for cases where the underlying resources need to be - // recreated or reinitialized. For example if the image is specified by label, - // but the underlying image digest has changed) or if the container performs - // deployment initialization work that needs to be performed again. - bool force_new_revision = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for retrieving a list of WorkerPools. -message ListWorkerPoolsRequest { - // Required. The location and project to list resources on. - // Location must be a valid Google Cloud region, and cannot be the "-" - // wildcard. Format: `projects/{project}/locations/{location}`, where - // `{project}` can be project id or number. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "run.googleapis.com/WorkerPool" - } - ]; - - // Maximum number of WorkerPools to return in this call. - int32 page_size = 2; - - // A page token received from a previous call to ListWorkerPools. - // All other parameters must match. - string page_token = 3; - - // If true, returns deleted (but unexpired) resources along with active ones. - bool show_deleted = 4; -} - -// Response message containing a list of WorkerPools. -message ListWorkerPoolsResponse { - // The resulting list of WorkerPools. - repeated WorkerPool worker_pools = 1; - - // A token indicating there are more items than page_size. Use it in the next - // ListWorkerPools request to continue. - string next_page_token = 2; -} - -// Request message for obtaining a WorkerPool by its full name. -message GetWorkerPoolRequest { - // Required. The full name of the WorkerPool. - // Format: - // `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - // `{project}` can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/WorkerPool" } - ]; -} - -// Request message to delete a WorkerPool by its full name. -message DeleteWorkerPoolRequest { - // Required. The full name of the WorkerPool. - // Format: - // `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - // `{project}` can be project id or number. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "run.googleapis.com/WorkerPool" } - ]; - - // Optional. Indicates that the request should be validated without actually - // deleting any resources. - bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; - - // A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 3; -} - -// WorkerPool acts as a top-level container that manages a set of -// configurations and revision templates which implement a pull-based workload. -// WorkerPool exists to provide a singular abstraction which can be access -// controlled, reasoned about, and which encapsulates software lifecycle -// decisions such as rollout policy and team resource ownership. -message WorkerPool { - option (google.api.resource) = { - type: "run.googleapis.com/WorkerPool" - pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" - plural: "workerPools" - singular: "workerPool" - style: DECLARATIVE_FRIENDLY - }; - - // The fully qualified name of this WorkerPool. In CreateWorkerPoolRequest, - // this field is ignored, and instead composed from - // CreateWorkerPoolRequest.parent and CreateWorkerPoolRequest.worker_id. - // - // Format: - // `projects/{project}/locations/{location}/workerPools/{worker_id}` - string name = 1; - - // User-provided description of the WorkerPool. This field currently has a - // 512-character limit. - string description = 2; - - // Output only. Server assigned unique identifier for the trigger. The value - // is a UUID4 string and guaranteed to remain unchanged until the resource is - // deleted. - string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A number that monotonically increases every time the user - // modifies the desired state. - // Please note that unlike v1, this is an int64 value. As with most Google - // APIs, its JSON representation will be a `string` instead of an `integer`. - int64 generation = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - // Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 WorkerPool. - map labels = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Unstructured key value map that may be set by external tools to - // store and arbitrary metadata. They are not queryable and should be - // preserved when modifying objects. - // - // Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected in new resources. All system - // annotations in v1 now have a corresponding field in v2 WorkerPool. - // - //

This field follows Kubernetes - // annotations' namespacing, limits, and rules. - map annotations = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The creation time. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last-modified time. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The deletion time. It is only populated as a response to a - // Delete request. - google.protobuf.Timestamp delete_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. For a deleted resource, the time after which it will be - // permamently deleted. - google.protobuf.Timestamp expire_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the authenticated creator. - string creator = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Email address of the last authenticated modifier. - string last_modifier = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Arbitrary identifier for the API client. - string client = 13; - - // Arbitrary version identifier for the API client. - string client_version = 14; - - // Optional. The launch stage as defined by [Google Cloud Platform - // Launch Stages](https://cloud.google.com/terms/launch-stages). - // Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA - // is assumed. - // Set the launch stage to a preview stage on input to allow use of preview - // features in that stage. On read (or output), describes whether the - // resource uses preview features. - // - // For example, if ALPHA is provided as input, but only BETA and GA-level - // features are used, this field will be BETA on output. - google.api.LaunchStage launch_stage = 16 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Settings for the Binary Authorization feature. - BinaryAuthorization binary_authorization = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. The template used to create revisions for this WorkerPool. - WorkerPoolRevisionTemplate template = 18 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifies how to distribute instances over a collection of - // Revisions belonging to the WorkerPool. If instance split is empty or not - // provided, defaults to 100% instances assigned to the latest `Ready` - // Revision. - repeated InstanceSplit instance_splits = 26 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies worker-pool-level scaling settings - WorkerPoolScaling scaling = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The generation of this WorkerPool currently serving workloads. - // See comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. Please note that unlike v1, this is an int64 value. - // As with most Google APIs, its JSON representation will be a `string` - // instead of an `integer`. - int64 observed_generation = 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Condition of this WorkerPool, containing its readiness - // status, and detailed error information in case it did not reach a serving - // state. See comments in `reconciling` for additional information on - // reconciliation process in Cloud Run. - Condition terminal_condition = 31 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Conditions of all other associated sub-resources. They - // contain additional diagnostics information in case the WorkerPool does not - // reach its Serving state. See comments in `reconciling` for additional - // information on reconciliation process in Cloud Run. - repeated Condition conditions = 32 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the latest revision that is serving workloads. See - // comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. - string latest_ready_revision = 33 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Output only. Name of the last created revision. See comments in - // `reconciling` for additional information on reconciliation process in Cloud - // Run. - string latest_created_revision = 34 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Output only. Detailed status information for corresponding instance splits. - // See comments in `reconciling` for additional information on reconciliation - // process in Cloud Run. - repeated InstanceSplitStatus instance_split_statuses = 27 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Indicates whether Cloud Run Threat Detection monitoring is - // enabled for the parent project of this worker pool. - bool threat_detection_enabled = 28 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Not supported, and ignored by Cloud Run. - repeated string custom_audiences = 37; - - // Output only. Reserved for future use. - bool satisfies_pzs = 38 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Returns true if the WorkerPool is currently being acted upon - // by the system to bring it into the desired state. - // - // When a new WorkerPool is created, or an existing one is updated, Cloud Run - // will asynchronously perform all necessary steps to bring the WorkerPool to - // the desired serving state. This process is called reconciliation. While - // reconciliation is in process, `observed_generation`, - // `latest_ready_revison`, `instance_split_statuses`, and `uri` will have - // transient values that might mismatch the intended state: Once - // reconciliation is over (and this field is false), there are two possible - // outcomes: reconciliation succeeded and the serving state matches the - // WorkerPool, or there was an error, and reconciliation failed. This state - // can be found in `terminal_condition.state`. - // - // If reconciliation succeeded, the following fields will match: - // `instance_splits` and `instance_split_statuses`, `observed_generation` and - // `generation`, `latest_ready_revision` and `latest_created_revision`. - // - // If reconciliation failed, `instance_split_statuses`, `observed_generation`, - // and `latest_ready_revision` will have the state of the last serving - // revision, or empty for newly created WorkerPools. Additional information on - // the failure can be found in `terminal_condition` and `conditions`. - bool reconciling = 98 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. A system-generated fingerprint for this version of the - // resource. May be used to detect modification conflict during updates. - string etag = 99 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto b/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto deleted file mode 100644 index fa07f6f8e07..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/worker_pool_revision_template.proto +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.run.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/run/v2/k8s.min.proto"; -import "google/cloud/run/v2/vendor_settings.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; -option java_multiple_files = true; -option java_outer_classname = "WorkerPoolRevisionTemplateProto"; -option java_package = "com.google.cloud.run.v2"; - -// WorkerPoolRevisionTemplate describes the data a worker pool revision should -// have when created from a template. -message WorkerPoolRevisionTemplate { - // Optional. The unique name for the revision. If this field is omitted, it - // will be automatically generated based on the WorkerPool name. - string revision = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } - ]; - - // Optional. Unstructured key value map that can be used to organize and - // categorize objects. User-provided labels are shared with Google's billing - // system, so they can be used to filter, or break down billing charges by - // team, component, environment, state, etc. For more information, visit - // https://cloud.google.com/resource-manager/docs/creating-managing-labels or - // https://cloud.google.com/run/docs/configuring/labels. - // - // Cloud Run API v2 does not support labels with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system labels in v1 now have a - // corresponding field in v2 WorkerPoolRevisionTemplate. - map labels = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Unstructured key value map that may be set by external tools to - // store and arbitrary metadata. They are not queryable and should be - // preserved when modifying objects. - // - // Cloud Run API v2 does not support annotations with `run.googleapis.com`, - // `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` - // namespaces, and they will be rejected. All system annotations in v1 now - // have a corresponding field in v2 WorkerPoolRevisionTemplate. - // - // This field follows Kubernetes annotations' namespacing, limits, and - // rules. - map annotations = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. VPC Access configuration to use for this Revision. For more - // information, visit - // https://cloud.google.com/run/docs/configuring/connecting-vpc. - VpcAccess vpc_access = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Email address of the IAM service account associated with the - // revision of the service. The service account represents the identity of the - // running revision, and determines what permissions the revision has. If not - // provided, the revision will use the project's default service account. - string service_account = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Holds list of the containers that defines the unit of execution for this - // Revision. - repeated Container containers = 6; - - // Optional. A list of Volumes to make available to containers. - repeated Volume volumes = 7 [(google.api.field_behavior) = OPTIONAL]; - - // A reference to a customer managed encryption key (CMEK) to use to encrypt - // this container image. For more information, go to - // https://cloud.google.com/run/docs/securing/using-cmek - string encryption_key = 8 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - - // Optional. Enables service mesh connectivity. - ServiceMesh service_mesh = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The action to take if the encryption key is revoked. - EncryptionKeyRevocationAction encryption_key_revocation_action = 10 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If encryption_key_revocation_action is SHUTDOWN, the duration - // before shutting down all instances. The minimum increment is 1 hour. - google.protobuf.Duration encryption_key_shutdown_duration = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The node selector for the revision template. - NodeSelector node_selector = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. True if GPU zonal redundancy is disabled on this worker pool. - optional bool gpu_zonal_redundancy_disabled = 16 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-run/protos/protos.d.ts b/owl-bot-staging/google-cloud-run/protos/protos.d.ts deleted file mode 100644 index 0f969068560..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/protos.d.ts +++ /dev/null @@ -1,22927 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace run. */ - namespace run { - - /** Namespace v2. */ - namespace v2 { - - /** Represents a Builds */ - class Builds extends $protobuf.rpc.Service { - - /** - * Constructs a new Builds 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 Builds 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): Builds; - - /** - * Calls SubmitBuild. - * @param request SubmitBuildRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SubmitBuildResponse - */ - public submitBuild(request: google.cloud.run.v2.ISubmitBuildRequest, callback: google.cloud.run.v2.Builds.SubmitBuildCallback): void; - - /** - * Calls SubmitBuild. - * @param request SubmitBuildRequest message or plain object - * @returns Promise - */ - public submitBuild(request: google.cloud.run.v2.ISubmitBuildRequest): Promise; - } - - namespace Builds { - - /** - * Callback as used by {@link google.cloud.run.v2.Builds|submitBuild}. - * @param error Error, if any - * @param [response] SubmitBuildResponse - */ - type SubmitBuildCallback = (error: (Error|null), response?: google.cloud.run.v2.SubmitBuildResponse) => void; - } - - /** Properties of a SubmitBuildRequest. */ - interface ISubmitBuildRequest { - - /** SubmitBuildRequest parent */ - parent?: (string|null); - - /** SubmitBuildRequest storageSource */ - storageSource?: (google.cloud.run.v2.IStorageSource|null); - - /** SubmitBuildRequest imageUri */ - imageUri?: (string|null); - - /** SubmitBuildRequest buildpackBuild */ - buildpackBuild?: (google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null); - - /** SubmitBuildRequest dockerBuild */ - dockerBuild?: (google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null); - - /** SubmitBuildRequest serviceAccount */ - serviceAccount?: (string|null); - - /** SubmitBuildRequest workerPool */ - workerPool?: (string|null); - - /** SubmitBuildRequest tags */ - tags?: (string[]|null); - - /** SubmitBuildRequest machineType */ - machineType?: (string|null); - - /** SubmitBuildRequest releaseTrack */ - releaseTrack?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** SubmitBuildRequest client */ - client?: (string|null); - } - - /** Represents a SubmitBuildRequest. */ - class SubmitBuildRequest implements ISubmitBuildRequest { - - /** - * Constructs a new SubmitBuildRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ISubmitBuildRequest); - - /** SubmitBuildRequest parent. */ - public parent: string; - - /** SubmitBuildRequest storageSource. */ - public storageSource?: (google.cloud.run.v2.IStorageSource|null); - - /** SubmitBuildRequest imageUri. */ - public imageUri: string; - - /** SubmitBuildRequest buildpackBuild. */ - public buildpackBuild?: (google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null); - - /** SubmitBuildRequest dockerBuild. */ - public dockerBuild?: (google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null); - - /** SubmitBuildRequest serviceAccount. */ - public serviceAccount: string; - - /** SubmitBuildRequest workerPool. */ - public workerPool: string; - - /** SubmitBuildRequest tags. */ - public tags: string[]; - - /** SubmitBuildRequest machineType. */ - public machineType: string; - - /** SubmitBuildRequest releaseTrack. */ - public releaseTrack: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** SubmitBuildRequest client. */ - public client: string; - - /** SubmitBuildRequest source. */ - public source?: "storageSource"; - - /** SubmitBuildRequest buildType. */ - public buildType?: ("buildpackBuild"|"dockerBuild"); - - /** - * Creates a new SubmitBuildRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SubmitBuildRequest instance - */ - public static create(properties?: google.cloud.run.v2.ISubmitBuildRequest): google.cloud.run.v2.SubmitBuildRequest; - - /** - * Encodes the specified SubmitBuildRequest message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. - * @param message SubmitBuildRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ISubmitBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubmitBuildRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. - * @param message SubmitBuildRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ISubmitBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubmitBuildRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubmitBuildRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildRequest; - - /** - * Decodes a SubmitBuildRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubmitBuildRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildRequest; - - /** - * Verifies a SubmitBuildRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SubmitBuildRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubmitBuildRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildRequest; - - /** - * Creates a plain object from a SubmitBuildRequest message. Also converts values to other types if specified. - * @param message SubmitBuildRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SubmitBuildRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubmitBuildRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubmitBuildRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SubmitBuildRequest { - - /** Properties of a DockerBuild. */ - interface IDockerBuild { - } - - /** Represents a DockerBuild. */ - class DockerBuild implements IDockerBuild { - - /** - * Constructs a new DockerBuild. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild); - - /** - * Creates a new DockerBuild instance using the specified properties. - * @param [properties] Properties to set - * @returns DockerBuild instance - */ - public static create(properties?: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; - - /** - * Encodes the specified DockerBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. - * @param message DockerBuild message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DockerBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. - * @param message DockerBuild message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.SubmitBuildRequest.IDockerBuild, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DockerBuild message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DockerBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; - - /** - * Decodes a DockerBuild message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DockerBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; - - /** - * Verifies a DockerBuild message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DockerBuild message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DockerBuild - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildRequest.DockerBuild; - - /** - * Creates a plain object from a DockerBuild message. Also converts values to other types if specified. - * @param message DockerBuild - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SubmitBuildRequest.DockerBuild, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DockerBuild to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DockerBuild - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BuildpacksBuild. */ - interface IBuildpacksBuild { - - /** BuildpacksBuild runtime */ - runtime?: (string|null); - - /** BuildpacksBuild functionTarget */ - functionTarget?: (string|null); - - /** BuildpacksBuild cacheImageUri */ - cacheImageUri?: (string|null); - - /** BuildpacksBuild baseImage */ - baseImage?: (string|null); - - /** BuildpacksBuild environmentVariables */ - environmentVariables?: ({ [k: string]: string }|null); - - /** BuildpacksBuild enableAutomaticUpdates */ - enableAutomaticUpdates?: (boolean|null); - - /** BuildpacksBuild projectDescriptor */ - projectDescriptor?: (string|null); - } - - /** Represents a BuildpacksBuild. */ - class BuildpacksBuild implements IBuildpacksBuild { - - /** - * Constructs a new BuildpacksBuild. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild); - - /** BuildpacksBuild runtime. */ - public runtime: string; - - /** BuildpacksBuild functionTarget. */ - public functionTarget: string; - - /** BuildpacksBuild cacheImageUri. */ - public cacheImageUri: string; - - /** BuildpacksBuild baseImage. */ - public baseImage: string; - - /** BuildpacksBuild environmentVariables. */ - public environmentVariables: { [k: string]: string }; - - /** BuildpacksBuild enableAutomaticUpdates. */ - public enableAutomaticUpdates: boolean; - - /** BuildpacksBuild projectDescriptor. */ - public projectDescriptor: string; - - /** - * Creates a new BuildpacksBuild instance using the specified properties. - * @param [properties] Properties to set - * @returns BuildpacksBuild instance - */ - public static create(properties?: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; - - /** - * Encodes the specified BuildpacksBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. - * @param message BuildpacksBuild message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BuildpacksBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. - * @param message BuildpacksBuild message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BuildpacksBuild message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BuildpacksBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; - - /** - * Decodes a BuildpacksBuild message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BuildpacksBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; - - /** - * Verifies a BuildpacksBuild message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BuildpacksBuild message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BuildpacksBuild - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild; - - /** - * Creates a plain object from a BuildpacksBuild message. Also converts values to other types if specified. - * @param message BuildpacksBuild - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BuildpacksBuild to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BuildpacksBuild - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SubmitBuildResponse. */ - interface ISubmitBuildResponse { - - /** SubmitBuildResponse buildOperation */ - buildOperation?: (google.longrunning.IOperation|null); - - /** SubmitBuildResponse baseImageUri */ - baseImageUri?: (string|null); - - /** SubmitBuildResponse baseImageWarning */ - baseImageWarning?: (string|null); - } - - /** Represents a SubmitBuildResponse. */ - class SubmitBuildResponse implements ISubmitBuildResponse { - - /** - * Constructs a new SubmitBuildResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ISubmitBuildResponse); - - /** SubmitBuildResponse buildOperation. */ - public buildOperation?: (google.longrunning.IOperation|null); - - /** SubmitBuildResponse baseImageUri. */ - public baseImageUri: string; - - /** SubmitBuildResponse baseImageWarning. */ - public baseImageWarning: string; - - /** - * Creates a new SubmitBuildResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SubmitBuildResponse instance - */ - public static create(properties?: google.cloud.run.v2.ISubmitBuildResponse): google.cloud.run.v2.SubmitBuildResponse; - - /** - * Encodes the specified SubmitBuildResponse message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. - * @param message SubmitBuildResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ISubmitBuildResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubmitBuildResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. - * @param message SubmitBuildResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ISubmitBuildResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubmitBuildResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubmitBuildResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SubmitBuildResponse; - - /** - * Decodes a SubmitBuildResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubmitBuildResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SubmitBuildResponse; - - /** - * Verifies a SubmitBuildResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SubmitBuildResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubmitBuildResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SubmitBuildResponse; - - /** - * Creates a plain object from a SubmitBuildResponse message. Also converts values to other types if specified. - * @param message SubmitBuildResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SubmitBuildResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubmitBuildResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubmitBuildResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StorageSource. */ - interface IStorageSource { - - /** StorageSource bucket */ - bucket?: (string|null); - - /** StorageSource object */ - object?: (string|null); - - /** StorageSource generation */ - generation?: (number|Long|string|null); - } - - /** Represents a StorageSource. */ - class StorageSource implements IStorageSource { - - /** - * Constructs a new StorageSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IStorageSource); - - /** StorageSource bucket. */ - public bucket: string; - - /** StorageSource object. */ - public object: string; - - /** StorageSource generation. */ - public generation: (number|Long|string); - - /** - * Creates a new StorageSource instance using the specified properties. - * @param [properties] Properties to set - * @returns StorageSource instance - */ - public static create(properties?: google.cloud.run.v2.IStorageSource): google.cloud.run.v2.StorageSource; - - /** - * Encodes the specified StorageSource message. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. - * @param message StorageSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. - * @param message StorageSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StorageSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StorageSource; - - /** - * Decodes a StorageSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StorageSource; - - /** - * Verifies a StorageSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StorageSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StorageSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StorageSource; - - /** - * Creates a plain object from a StorageSource message. Also converts values to other types if specified. - * @param message StorageSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.StorageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StorageSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StorageSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Condition. */ - interface ICondition { - - /** Condition type */ - type?: (string|null); - - /** Condition state */ - state?: (google.cloud.run.v2.Condition.State|keyof typeof google.cloud.run.v2.Condition.State|null); - - /** Condition message */ - message?: (string|null); - - /** Condition lastTransitionTime */ - lastTransitionTime?: (google.protobuf.ITimestamp|null); - - /** Condition severity */ - severity?: (google.cloud.run.v2.Condition.Severity|keyof typeof google.cloud.run.v2.Condition.Severity|null); - - /** Condition reason */ - reason?: (google.cloud.run.v2.Condition.CommonReason|keyof typeof google.cloud.run.v2.Condition.CommonReason|null); - - /** Condition revisionReason */ - revisionReason?: (google.cloud.run.v2.Condition.RevisionReason|keyof typeof google.cloud.run.v2.Condition.RevisionReason|null); - - /** Condition executionReason */ - executionReason?: (google.cloud.run.v2.Condition.ExecutionReason|keyof typeof google.cloud.run.v2.Condition.ExecutionReason|null); - } - - /** Represents a Condition. */ - class Condition implements ICondition { - - /** - * Constructs a new Condition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICondition); - - /** Condition type. */ - public type: string; - - /** Condition state. */ - public state: (google.cloud.run.v2.Condition.State|keyof typeof google.cloud.run.v2.Condition.State); - - /** Condition message. */ - public message: string; - - /** Condition lastTransitionTime. */ - public lastTransitionTime?: (google.protobuf.ITimestamp|null); - - /** Condition severity. */ - public severity: (google.cloud.run.v2.Condition.Severity|keyof typeof google.cloud.run.v2.Condition.Severity); - - /** Condition reason. */ - public reason?: (google.cloud.run.v2.Condition.CommonReason|keyof typeof google.cloud.run.v2.Condition.CommonReason|null); - - /** Condition revisionReason. */ - public revisionReason?: (google.cloud.run.v2.Condition.RevisionReason|keyof typeof google.cloud.run.v2.Condition.RevisionReason|null); - - /** Condition executionReason. */ - public executionReason?: (google.cloud.run.v2.Condition.ExecutionReason|keyof typeof google.cloud.run.v2.Condition.ExecutionReason|null); - - /** Condition reasons. */ - public reasons?: ("reason"|"revisionReason"|"executionReason"); - - /** - * Creates a new Condition instance using the specified properties. - * @param [properties] Properties to set - * @returns Condition instance - */ - public static create(properties?: google.cloud.run.v2.ICondition): google.cloud.run.v2.Condition; - - /** - * Encodes the specified Condition message. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Condition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Condition; - - /** - * Decodes a Condition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Condition; - - /** - * Verifies a Condition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Condition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Condition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Condition; - - /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @param message Condition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Condition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Condition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Condition { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CONDITION_PENDING = 1, - CONDITION_RECONCILING = 2, - CONDITION_FAILED = 3, - CONDITION_SUCCEEDED = 4 - } - - /** Severity enum. */ - enum Severity { - SEVERITY_UNSPECIFIED = 0, - ERROR = 1, - WARNING = 2, - INFO = 3 - } - - /** CommonReason enum. */ - enum CommonReason { - COMMON_REASON_UNDEFINED = 0, - UNKNOWN = 1, - REVISION_FAILED = 3, - PROGRESS_DEADLINE_EXCEEDED = 4, - CONTAINER_MISSING = 6, - CONTAINER_PERMISSION_DENIED = 7, - CONTAINER_IMAGE_UNAUTHORIZED = 8, - CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED = 9, - ENCRYPTION_KEY_PERMISSION_DENIED = 10, - ENCRYPTION_KEY_CHECK_FAILED = 11, - SECRETS_ACCESS_CHECK_FAILED = 12, - WAITING_FOR_OPERATION = 13, - IMMEDIATE_RETRY = 14, - POSTPONED_RETRY = 15, - INTERNAL = 16, - VPC_NETWORK_NOT_FOUND = 17 - } - - /** RevisionReason enum. */ - enum RevisionReason { - REVISION_REASON_UNDEFINED = 0, - PENDING = 1, - RESERVE = 2, - RETIRED = 3, - RETIRING = 4, - RECREATING = 5, - HEALTH_CHECK_CONTAINER_ERROR = 6, - CUSTOMIZED_PATH_RESPONSE_PENDING = 7, - MIN_INSTANCES_NOT_PROVISIONED = 8, - ACTIVE_REVISION_LIMIT_REACHED = 9, - NO_DEPLOYMENT = 10, - HEALTH_CHECK_SKIPPED = 11, - MIN_INSTANCES_WARMING = 12 - } - - /** ExecutionReason enum. */ - enum ExecutionReason { - EXECUTION_REASON_UNDEFINED = 0, - JOB_STATUS_SERVICE_POLLING_ERROR = 1, - NON_ZERO_EXIT_CODE = 2, - CANCELLED = 3, - CANCELLING = 4, - DELETED = 5, - DELAYED_START_PENDING = 6 - } - } - - /** Properties of a ContainerStatus. */ - interface IContainerStatus { - - /** ContainerStatus name */ - name?: (string|null); - - /** ContainerStatus imageDigest */ - imageDigest?: (string|null); - } - - /** Represents a ContainerStatus. */ - class ContainerStatus implements IContainerStatus { - - /** - * Constructs a new ContainerStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IContainerStatus); - - /** ContainerStatus name. */ - public name: string; - - /** ContainerStatus imageDigest. */ - public imageDigest: string; - - /** - * Creates a new ContainerStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns ContainerStatus instance - */ - public static create(properties?: google.cloud.run.v2.IContainerStatus): google.cloud.run.v2.ContainerStatus; - - /** - * Encodes the specified ContainerStatus message. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. - * @param message ContainerStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IContainerStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContainerStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. - * @param message ContainerStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IContainerStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContainerStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContainerStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ContainerStatus; - - /** - * Decodes a ContainerStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContainerStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ContainerStatus; - - /** - * Verifies a ContainerStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContainerStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContainerStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ContainerStatus; - - /** - * Creates a plain object from a ContainerStatus message. Also converts values to other types if specified. - * @param message ContainerStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ContainerStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContainerStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContainerStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an Executions */ - class Executions extends $protobuf.rpc.Service { - - /** - * Constructs a new Executions 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 Executions 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): Executions; - - /** - * Calls GetExecution. - * @param request GetExecutionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Execution - */ - public getExecution(request: google.cloud.run.v2.IGetExecutionRequest, callback: google.cloud.run.v2.Executions.GetExecutionCallback): void; - - /** - * Calls GetExecution. - * @param request GetExecutionRequest message or plain object - * @returns Promise - */ - public getExecution(request: google.cloud.run.v2.IGetExecutionRequest): Promise; - - /** - * Calls ListExecutions. - * @param request ListExecutionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListExecutionsResponse - */ - public listExecutions(request: google.cloud.run.v2.IListExecutionsRequest, callback: google.cloud.run.v2.Executions.ListExecutionsCallback): void; - - /** - * Calls ListExecutions. - * @param request ListExecutionsRequest message or plain object - * @returns Promise - */ - public listExecutions(request: google.cloud.run.v2.IListExecutionsRequest): Promise; - - /** - * Calls DeleteExecution. - * @param request DeleteExecutionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteExecution(request: google.cloud.run.v2.IDeleteExecutionRequest, callback: google.cloud.run.v2.Executions.DeleteExecutionCallback): void; - - /** - * Calls DeleteExecution. - * @param request DeleteExecutionRequest message or plain object - * @returns Promise - */ - public deleteExecution(request: google.cloud.run.v2.IDeleteExecutionRequest): Promise; - - /** - * Calls CancelExecution. - * @param request CancelExecutionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public cancelExecution(request: google.cloud.run.v2.ICancelExecutionRequest, callback: google.cloud.run.v2.Executions.CancelExecutionCallback): void; - - /** - * Calls CancelExecution. - * @param request CancelExecutionRequest message or plain object - * @returns Promise - */ - public cancelExecution(request: google.cloud.run.v2.ICancelExecutionRequest): Promise; - } - - namespace Executions { - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|getExecution}. - * @param error Error, if any - * @param [response] Execution - */ - type GetExecutionCallback = (error: (Error|null), response?: google.cloud.run.v2.Execution) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|listExecutions}. - * @param error Error, if any - * @param [response] ListExecutionsResponse - */ - type ListExecutionsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListExecutionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|deleteExecution}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteExecutionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|cancelExecution}. - * @param error Error, if any - * @param [response] Operation - */ - type CancelExecutionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a GetExecutionRequest. */ - interface IGetExecutionRequest { - - /** GetExecutionRequest name */ - name?: (string|null); - } - - /** Represents a GetExecutionRequest. */ - class GetExecutionRequest implements IGetExecutionRequest { - - /** - * Constructs a new GetExecutionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGetExecutionRequest); - - /** GetExecutionRequest name. */ - public name: string; - - /** - * Creates a new GetExecutionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetExecutionRequest instance - */ - public static create(properties?: google.cloud.run.v2.IGetExecutionRequest): google.cloud.run.v2.GetExecutionRequest; - - /** - * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. - * @param message GetExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. - * @param message GetExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGetExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetExecutionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetExecutionRequest; - - /** - * Decodes a GetExecutionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetExecutionRequest; - - /** - * Verifies a GetExecutionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetExecutionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetExecutionRequest; - - /** - * Creates a plain object from a GetExecutionRequest message. Also converts values to other types if specified. - * @param message GetExecutionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GetExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetExecutionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetExecutionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListExecutionsRequest. */ - interface IListExecutionsRequest { - - /** ListExecutionsRequest parent */ - parent?: (string|null); - - /** ListExecutionsRequest pageSize */ - pageSize?: (number|null); - - /** ListExecutionsRequest pageToken */ - pageToken?: (string|null); - - /** ListExecutionsRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListExecutionsRequest. */ - class ListExecutionsRequest implements IListExecutionsRequest { - - /** - * Constructs a new ListExecutionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListExecutionsRequest); - - /** ListExecutionsRequest parent. */ - public parent: string; - - /** ListExecutionsRequest pageSize. */ - public pageSize: number; - - /** ListExecutionsRequest pageToken. */ - public pageToken: string; - - /** ListExecutionsRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListExecutionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListExecutionsRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListExecutionsRequest): google.cloud.run.v2.ListExecutionsRequest; - - /** - * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. - * @param message ListExecutionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. - * @param message ListExecutionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListExecutionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListExecutionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListExecutionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListExecutionsRequest; - - /** - * Decodes a ListExecutionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListExecutionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListExecutionsRequest; - - /** - * Verifies a ListExecutionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListExecutionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListExecutionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListExecutionsRequest; - - /** - * Creates a plain object from a ListExecutionsRequest message. Also converts values to other types if specified. - * @param message ListExecutionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListExecutionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListExecutionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListExecutionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListExecutionsResponse. */ - interface IListExecutionsResponse { - - /** ListExecutionsResponse executions */ - executions?: (google.cloud.run.v2.IExecution[]|null); - - /** ListExecutionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListExecutionsResponse. */ - class ListExecutionsResponse implements IListExecutionsResponse { - - /** - * Constructs a new ListExecutionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListExecutionsResponse); - - /** ListExecutionsResponse executions. */ - public executions: google.cloud.run.v2.IExecution[]; - - /** ListExecutionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListExecutionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListExecutionsResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListExecutionsResponse): google.cloud.run.v2.ListExecutionsResponse; - - /** - * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. - * @param message ListExecutionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. - * @param message ListExecutionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListExecutionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListExecutionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListExecutionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListExecutionsResponse; - - /** - * Decodes a ListExecutionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListExecutionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListExecutionsResponse; - - /** - * Verifies a ListExecutionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListExecutionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListExecutionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListExecutionsResponse; - - /** - * Creates a plain object from a ListExecutionsResponse message. Also converts values to other types if specified. - * @param message ListExecutionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListExecutionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListExecutionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListExecutionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteExecutionRequest. */ - interface IDeleteExecutionRequest { - - /** DeleteExecutionRequest name */ - name?: (string|null); - - /** DeleteExecutionRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteExecutionRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteExecutionRequest. */ - class DeleteExecutionRequest implements IDeleteExecutionRequest { - - /** - * Constructs a new DeleteExecutionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteExecutionRequest); - - /** DeleteExecutionRequest name. */ - public name: string; - - /** DeleteExecutionRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteExecutionRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteExecutionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteExecutionRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteExecutionRequest): google.cloud.run.v2.DeleteExecutionRequest; - - /** - * Encodes the specified DeleteExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. - * @param message DeleteExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IDeleteExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. - * @param message DeleteExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IDeleteExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteExecutionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteExecutionRequest; - - /** - * Decodes a DeleteExecutionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteExecutionRequest; - - /** - * Verifies a DeleteExecutionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteExecutionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteExecutionRequest; - - /** - * Creates a plain object from a DeleteExecutionRequest message. Also converts values to other types if specified. - * @param message DeleteExecutionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.DeleteExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteExecutionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteExecutionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelExecutionRequest. */ - interface ICancelExecutionRequest { - - /** CancelExecutionRequest name */ - name?: (string|null); - - /** CancelExecutionRequest validateOnly */ - validateOnly?: (boolean|null); - - /** CancelExecutionRequest etag */ - etag?: (string|null); - } - - /** Represents a CancelExecutionRequest. */ - class CancelExecutionRequest implements ICancelExecutionRequest { - - /** - * Constructs a new CancelExecutionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICancelExecutionRequest); - - /** CancelExecutionRequest name. */ - public name: string; - - /** CancelExecutionRequest validateOnly. */ - public validateOnly: boolean; - - /** CancelExecutionRequest etag. */ - public etag: string; - - /** - * Creates a new CancelExecutionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelExecutionRequest instance - */ - public static create(properties?: google.cloud.run.v2.ICancelExecutionRequest): google.cloud.run.v2.CancelExecutionRequest; - - /** - * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. - * @param message CancelExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. - * @param message CancelExecutionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICancelExecutionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelExecutionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CancelExecutionRequest; - - /** - * Decodes a CancelExecutionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CancelExecutionRequest; - - /** - * Verifies a CancelExecutionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelExecutionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CancelExecutionRequest; - - /** - * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. - * @param message CancelExecutionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.CancelExecutionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelExecutionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelExecutionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Execution. */ - interface IExecution { - - /** Execution name */ - name?: (string|null); - - /** Execution uid */ - uid?: (string|null); - - /** Execution creator */ - creator?: (string|null); - - /** Execution generation */ - generation?: (number|Long|string|null); - - /** Execution labels */ - labels?: ({ [k: string]: string }|null); - - /** Execution annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Execution createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Execution startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Execution completionTime */ - completionTime?: (google.protobuf.ITimestamp|null); - - /** Execution updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Execution deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Execution expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Execution launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** Execution job */ - job?: (string|null); - - /** Execution parallelism */ - parallelism?: (number|null); - - /** Execution taskCount */ - taskCount?: (number|null); - - /** Execution template */ - template?: (google.cloud.run.v2.ITaskTemplate|null); - - /** Execution reconciling */ - reconciling?: (boolean|null); - - /** Execution conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Execution observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Execution runningCount */ - runningCount?: (number|null); - - /** Execution succeededCount */ - succeededCount?: (number|null); - - /** Execution failedCount */ - failedCount?: (number|null); - - /** Execution cancelledCount */ - cancelledCount?: (number|null); - - /** Execution retriedCount */ - retriedCount?: (number|null); - - /** Execution logUri */ - logUri?: (string|null); - - /** Execution satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Execution etag */ - etag?: (string|null); - } - - /** Represents an Execution. */ - class Execution implements IExecution { - - /** - * Constructs a new Execution. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IExecution); - - /** Execution name. */ - public name: string; - - /** Execution uid. */ - public uid: string; - - /** Execution creator. */ - public creator: string; - - /** Execution generation. */ - public generation: (number|Long|string); - - /** Execution labels. */ - public labels: { [k: string]: string }; - - /** Execution annotations. */ - public annotations: { [k: string]: string }; - - /** Execution createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Execution startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Execution completionTime. */ - public completionTime?: (google.protobuf.ITimestamp|null); - - /** Execution updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Execution deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Execution expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Execution launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** Execution job. */ - public job: string; - - /** Execution parallelism. */ - public parallelism: number; - - /** Execution taskCount. */ - public taskCount: number; - - /** Execution template. */ - public template?: (google.cloud.run.v2.ITaskTemplate|null); - - /** Execution reconciling. */ - public reconciling: boolean; - - /** Execution conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Execution observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Execution runningCount. */ - public runningCount: number; - - /** Execution succeededCount. */ - public succeededCount: number; - - /** Execution failedCount. */ - public failedCount: number; - - /** Execution cancelledCount. */ - public cancelledCount: number; - - /** Execution retriedCount. */ - public retriedCount: number; - - /** Execution logUri. */ - public logUri: string; - - /** Execution satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Execution etag. */ - public etag: string; - - /** - * Creates a new Execution instance using the specified properties. - * @param [properties] Properties to set - * @returns Execution instance - */ - public static create(properties?: google.cloud.run.v2.IExecution): google.cloud.run.v2.Execution; - - /** - * Encodes the specified Execution message. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. - * @param message Execution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. - * @param message Execution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Execution message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Execution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Execution; - - /** - * Decodes an Execution message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Execution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Execution; - - /** - * Verifies an Execution message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Execution message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Execution - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Execution; - - /** - * Creates a plain object from an Execution message. Also converts values to other types if specified. - * @param message Execution - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Execution, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Execution to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Execution - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskTemplate. */ - interface ITaskTemplate { - - /** TaskTemplate containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** TaskTemplate volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** TaskTemplate maxRetries */ - maxRetries?: (number|null); - - /** TaskTemplate timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** TaskTemplate serviceAccount */ - serviceAccount?: (string|null); - - /** TaskTemplate executionEnvironment */ - executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); - - /** TaskTemplate encryptionKey */ - encryptionKey?: (string|null); - - /** TaskTemplate vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** TaskTemplate nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** TaskTemplate gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - } - - /** Represents a TaskTemplate. */ - class TaskTemplate implements ITaskTemplate { - - /** - * Constructs a new TaskTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITaskTemplate); - - /** TaskTemplate containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** TaskTemplate volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** TaskTemplate maxRetries. */ - public maxRetries?: (number|null); - - /** TaskTemplate timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** TaskTemplate serviceAccount. */ - public serviceAccount: string; - - /** TaskTemplate executionEnvironment. */ - public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); - - /** TaskTemplate encryptionKey. */ - public encryptionKey: string; - - /** TaskTemplate vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** TaskTemplate nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** TaskTemplate gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** TaskTemplate retries. */ - public retries?: "maxRetries"; - - /** - * Creates a new TaskTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskTemplate instance - */ - public static create(properties?: google.cloud.run.v2.ITaskTemplate): google.cloud.run.v2.TaskTemplate; - - /** - * Encodes the specified TaskTemplate message. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. - * @param message TaskTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ITaskTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. - * @param message TaskTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ITaskTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TaskTemplate; - - /** - * Decodes a TaskTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TaskTemplate; - - /** - * Verifies a TaskTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TaskTemplate; - - /** - * Creates a plain object from a TaskTemplate message. Also converts values to other types if specified. - * @param message TaskTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.TaskTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Container. */ - interface IContainer { - - /** Container name */ - name?: (string|null); - - /** Container image */ - image?: (string|null); - - /** Container sourceCode */ - sourceCode?: (google.cloud.run.v2.ISourceCode|null); - - /** Container command */ - command?: (string[]|null); - - /** Container args */ - args?: (string[]|null); - - /** Container env */ - env?: (google.cloud.run.v2.IEnvVar[]|null); - - /** Container resources */ - resources?: (google.cloud.run.v2.IResourceRequirements|null); - - /** Container ports */ - ports?: (google.cloud.run.v2.IContainerPort[]|null); - - /** Container volumeMounts */ - volumeMounts?: (google.cloud.run.v2.IVolumeMount[]|null); - - /** Container workingDir */ - workingDir?: (string|null); - - /** Container livenessProbe */ - livenessProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container startupProbe */ - startupProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container readinessProbe */ - readinessProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container dependsOn */ - dependsOn?: (string[]|null); - - /** Container baseImageUri */ - baseImageUri?: (string|null); - - /** Container buildInfo */ - buildInfo?: (google.cloud.run.v2.IBuildInfo|null); - } - - /** Represents a Container. */ - class Container implements IContainer { - - /** - * Constructs a new Container. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IContainer); - - /** Container name. */ - public name: string; - - /** Container image. */ - public image: string; - - /** Container sourceCode. */ - public sourceCode?: (google.cloud.run.v2.ISourceCode|null); - - /** Container command. */ - public command: string[]; - - /** Container args. */ - public args: string[]; - - /** Container env. */ - public env: google.cloud.run.v2.IEnvVar[]; - - /** Container resources. */ - public resources?: (google.cloud.run.v2.IResourceRequirements|null); - - /** Container ports. */ - public ports: google.cloud.run.v2.IContainerPort[]; - - /** Container volumeMounts. */ - public volumeMounts: google.cloud.run.v2.IVolumeMount[]; - - /** Container workingDir. */ - public workingDir: string; - - /** Container livenessProbe. */ - public livenessProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container startupProbe. */ - public startupProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container readinessProbe. */ - public readinessProbe?: (google.cloud.run.v2.IProbe|null); - - /** Container dependsOn. */ - public dependsOn: string[]; - - /** Container baseImageUri. */ - public baseImageUri: string; - - /** Container buildInfo. */ - public buildInfo?: (google.cloud.run.v2.IBuildInfo|null); - - /** - * Creates a new Container instance using the specified properties. - * @param [properties] Properties to set - * @returns Container instance - */ - public static create(properties?: google.cloud.run.v2.IContainer): google.cloud.run.v2.Container; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 ResourceRequirements. */ - interface IResourceRequirements { - - /** ResourceRequirements limits */ - limits?: ({ [k: string]: string }|null); - - /** ResourceRequirements cpuIdle */ - cpuIdle?: (boolean|null); - - /** ResourceRequirements startupCpuBoost */ - startupCpuBoost?: (boolean|null); - } - - /** Represents a ResourceRequirements. */ - class ResourceRequirements implements IResourceRequirements { - - /** - * Constructs a new ResourceRequirements. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IResourceRequirements); - - /** ResourceRequirements limits. */ - public limits: { [k: string]: string }; - - /** ResourceRequirements cpuIdle. */ - public cpuIdle: boolean; - - /** ResourceRequirements startupCpuBoost. */ - public startupCpuBoost: boolean; - - /** - * Creates a new ResourceRequirements instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceRequirements instance - */ - public static create(properties?: google.cloud.run.v2.IResourceRequirements): google.cloud.run.v2.ResourceRequirements; - - /** - * Encodes the specified ResourceRequirements message. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. - * @param message ResourceRequirements message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IResourceRequirements, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceRequirements message, length delimited. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. - * @param message ResourceRequirements message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IResourceRequirements, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceRequirements message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceRequirements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ResourceRequirements; - - /** - * Decodes a ResourceRequirements message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceRequirements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ResourceRequirements; - - /** - * Verifies a ResourceRequirements message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceRequirements message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceRequirements - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ResourceRequirements; - - /** - * Creates a plain object from a ResourceRequirements message. Also converts values to other types if specified. - * @param message ResourceRequirements - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ResourceRequirements, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceRequirements to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceRequirements - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnvVar. */ - interface IEnvVar { - - /** EnvVar name */ - name?: (string|null); - - /** EnvVar value */ - value?: (string|null); - - /** EnvVar valueSource */ - valueSource?: (google.cloud.run.v2.IEnvVarSource|null); - } - - /** Represents an EnvVar. */ - class EnvVar implements IEnvVar { - - /** - * Constructs a new EnvVar. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IEnvVar); - - /** EnvVar name. */ - public name: string; - - /** EnvVar value. */ - public value?: (string|null); - - /** EnvVar valueSource. */ - public valueSource?: (google.cloud.run.v2.IEnvVarSource|null); - - /** EnvVar values. */ - public values?: ("value"|"valueSource"); - - /** - * Creates a new EnvVar instance using the specified properties. - * @param [properties] Properties to set - * @returns EnvVar instance - */ - public static create(properties?: google.cloud.run.v2.IEnvVar): google.cloud.run.v2.EnvVar; - - /** - * Encodes the specified EnvVar message. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. - * @param message EnvVar message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IEnvVar, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnvVar message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. - * @param message EnvVar message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IEnvVar, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnvVar message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnvVar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.EnvVar; - - /** - * Decodes an EnvVar message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnvVar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.EnvVar; - - /** - * Verifies an EnvVar message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnvVar message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnvVar - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.EnvVar; - - /** - * Creates a plain object from an EnvVar message. Also converts values to other types if specified. - * @param message EnvVar - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.EnvVar, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnvVar to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnvVar - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnvVarSource. */ - interface IEnvVarSource { - - /** EnvVarSource secretKeyRef */ - secretKeyRef?: (google.cloud.run.v2.ISecretKeySelector|null); - } - - /** Represents an EnvVarSource. */ - class EnvVarSource implements IEnvVarSource { - - /** - * Constructs a new EnvVarSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IEnvVarSource); - - /** EnvVarSource secretKeyRef. */ - public secretKeyRef?: (google.cloud.run.v2.ISecretKeySelector|null); - - /** - * Creates a new EnvVarSource instance using the specified properties. - * @param [properties] Properties to set - * @returns EnvVarSource instance - */ - public static create(properties?: google.cloud.run.v2.IEnvVarSource): google.cloud.run.v2.EnvVarSource; - - /** - * Encodes the specified EnvVarSource message. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. - * @param message EnvVarSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IEnvVarSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnvVarSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. - * @param message EnvVarSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IEnvVarSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnvVarSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnvVarSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.EnvVarSource; - - /** - * Decodes an EnvVarSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnvVarSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.EnvVarSource; - - /** - * Verifies an EnvVarSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnvVarSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnvVarSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.EnvVarSource; - - /** - * Creates a plain object from an EnvVarSource message. Also converts values to other types if specified. - * @param message EnvVarSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.EnvVarSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnvVarSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnvVarSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SecretKeySelector. */ - interface ISecretKeySelector { - - /** SecretKeySelector secret */ - secret?: (string|null); - - /** SecretKeySelector version */ - version?: (string|null); - } - - /** Represents a SecretKeySelector. */ - class SecretKeySelector implements ISecretKeySelector { - - /** - * Constructs a new SecretKeySelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ISecretKeySelector); - - /** SecretKeySelector secret. */ - public secret: string; - - /** SecretKeySelector version. */ - public version: string; - - /** - * Creates a new SecretKeySelector instance using the specified properties. - * @param [properties] Properties to set - * @returns SecretKeySelector instance - */ - public static create(properties?: google.cloud.run.v2.ISecretKeySelector): google.cloud.run.v2.SecretKeySelector; - - /** - * Encodes the specified SecretKeySelector message. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. - * @param message SecretKeySelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ISecretKeySelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecretKeySelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. - * @param message SecretKeySelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ISecretKeySelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecretKeySelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecretKeySelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SecretKeySelector; - - /** - * Decodes a SecretKeySelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecretKeySelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SecretKeySelector; - - /** - * Verifies a SecretKeySelector message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecretKeySelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecretKeySelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SecretKeySelector; - - /** - * Creates a plain object from a SecretKeySelector message. Also converts values to other types if specified. - * @param message SecretKeySelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SecretKeySelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecretKeySelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecretKeySelector - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ContainerPort. */ - interface IContainerPort { - - /** ContainerPort name */ - name?: (string|null); - - /** ContainerPort containerPort */ - containerPort?: (number|null); - } - - /** Represents a ContainerPort. */ - class ContainerPort implements IContainerPort { - - /** - * Constructs a new ContainerPort. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IContainerPort); - - /** ContainerPort name. */ - public name: string; - - /** ContainerPort containerPort. */ - public containerPort: number; - - /** - * Creates a new ContainerPort instance using the specified properties. - * @param [properties] Properties to set - * @returns ContainerPort instance - */ - public static create(properties?: google.cloud.run.v2.IContainerPort): google.cloud.run.v2.ContainerPort; - - /** - * Encodes the specified ContainerPort message. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. - * @param message ContainerPort message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IContainerPort, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContainerPort message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. - * @param message ContainerPort message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IContainerPort, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContainerPort message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContainerPort - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ContainerPort; - - /** - * Decodes a ContainerPort message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContainerPort - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ContainerPort; - - /** - * Verifies a ContainerPort message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContainerPort message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContainerPort - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ContainerPort; - - /** - * Creates a plain object from a ContainerPort message. Also converts values to other types if specified. - * @param message ContainerPort - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ContainerPort, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContainerPort to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContainerPort - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a VolumeMount. */ - interface IVolumeMount { - - /** VolumeMount name */ - name?: (string|null); - - /** VolumeMount mountPath */ - mountPath?: (string|null); - - /** VolumeMount subPath */ - subPath?: (string|null); - } - - /** Represents a VolumeMount. */ - class VolumeMount implements IVolumeMount { - - /** - * Constructs a new VolumeMount. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IVolumeMount); - - /** VolumeMount name. */ - public name: string; - - /** VolumeMount mountPath. */ - public mountPath: string; - - /** VolumeMount subPath. */ - public subPath: string; - - /** - * Creates a new VolumeMount instance using the specified properties. - * @param [properties] Properties to set - * @returns VolumeMount instance - */ - public static create(properties?: google.cloud.run.v2.IVolumeMount): google.cloud.run.v2.VolumeMount; - - /** - * Encodes the specified VolumeMount message. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. - * @param message VolumeMount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IVolumeMount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VolumeMount message, length delimited. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. - * @param message VolumeMount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IVolumeMount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VolumeMount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VolumeMount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.VolumeMount; - - /** - * Decodes a VolumeMount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VolumeMount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.VolumeMount; - - /** - * Verifies a VolumeMount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VolumeMount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VolumeMount - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.VolumeMount; - - /** - * Creates a plain object from a VolumeMount message. Also converts values to other types if specified. - * @param message VolumeMount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.VolumeMount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VolumeMount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VolumeMount - * @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 name */ - name?: (string|null); - - /** Volume secret */ - secret?: (google.cloud.run.v2.ISecretVolumeSource|null); - - /** Volume cloudSqlInstance */ - cloudSqlInstance?: (google.cloud.run.v2.ICloudSqlInstance|null); - - /** Volume emptyDir */ - emptyDir?: (google.cloud.run.v2.IEmptyDirVolumeSource|null); - - /** Volume nfs */ - nfs?: (google.cloud.run.v2.INFSVolumeSource|null); - - /** Volume gcs */ - gcs?: (google.cloud.run.v2.IGCSVolumeSource|null); - } - - /** Represents a Volume. */ - class Volume implements IVolume { - - /** - * Constructs a new Volume. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IVolume); - - /** Volume name. */ - public name: string; - - /** Volume secret. */ - public secret?: (google.cloud.run.v2.ISecretVolumeSource|null); - - /** Volume cloudSqlInstance. */ - public cloudSqlInstance?: (google.cloud.run.v2.ICloudSqlInstance|null); - - /** Volume emptyDir. */ - public emptyDir?: (google.cloud.run.v2.IEmptyDirVolumeSource|null); - - /** Volume nfs. */ - public nfs?: (google.cloud.run.v2.INFSVolumeSource|null); - - /** Volume gcs. */ - public gcs?: (google.cloud.run.v2.IGCSVolumeSource|null); - - /** Volume volumeType. */ - public volumeType?: ("secret"|"cloudSqlInstance"|"emptyDir"|"nfs"|"gcs"); - - /** - * Creates a new Volume instance using the specified properties. - * @param [properties] Properties to set - * @returns Volume instance - */ - public static create(properties?: google.cloud.run.v2.IVolume): google.cloud.run.v2.Volume; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 SecretVolumeSource. */ - interface ISecretVolumeSource { - - /** SecretVolumeSource secret */ - secret?: (string|null); - - /** SecretVolumeSource items */ - items?: (google.cloud.run.v2.IVersionToPath[]|null); - - /** SecretVolumeSource defaultMode */ - defaultMode?: (number|null); - } - - /** Represents a SecretVolumeSource. */ - class SecretVolumeSource implements ISecretVolumeSource { - - /** - * Constructs a new SecretVolumeSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ISecretVolumeSource); - - /** SecretVolumeSource secret. */ - public secret: string; - - /** SecretVolumeSource items. */ - public items: google.cloud.run.v2.IVersionToPath[]; - - /** SecretVolumeSource defaultMode. */ - public defaultMode: number; - - /** - * Creates a new SecretVolumeSource instance using the specified properties. - * @param [properties] Properties to set - * @returns SecretVolumeSource instance - */ - public static create(properties?: google.cloud.run.v2.ISecretVolumeSource): google.cloud.run.v2.SecretVolumeSource; - - /** - * Encodes the specified SecretVolumeSource message. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. - * @param message SecretVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ISecretVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecretVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. - * @param message SecretVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ISecretVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecretVolumeSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecretVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SecretVolumeSource; - - /** - * Decodes a SecretVolumeSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecretVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SecretVolumeSource; - - /** - * Verifies a SecretVolumeSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecretVolumeSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecretVolumeSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SecretVolumeSource; - - /** - * Creates a plain object from a SecretVolumeSource message. Also converts values to other types if specified. - * @param message SecretVolumeSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SecretVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecretVolumeSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecretVolumeSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a VersionToPath. */ - interface IVersionToPath { - - /** VersionToPath path */ - path?: (string|null); - - /** VersionToPath version */ - version?: (string|null); - - /** VersionToPath mode */ - mode?: (number|null); - } - - /** Represents a VersionToPath. */ - class VersionToPath implements IVersionToPath { - - /** - * Constructs a new VersionToPath. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IVersionToPath); - - /** VersionToPath path. */ - public path: string; - - /** VersionToPath version. */ - public version: string; - - /** VersionToPath mode. */ - public mode: number; - - /** - * Creates a new VersionToPath instance using the specified properties. - * @param [properties] Properties to set - * @returns VersionToPath instance - */ - public static create(properties?: google.cloud.run.v2.IVersionToPath): google.cloud.run.v2.VersionToPath; - - /** - * Encodes the specified VersionToPath message. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. - * @param message VersionToPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IVersionToPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VersionToPath message, length delimited. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. - * @param message VersionToPath message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IVersionToPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VersionToPath message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VersionToPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.VersionToPath; - - /** - * Decodes a VersionToPath message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VersionToPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.VersionToPath; - - /** - * Verifies a VersionToPath message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VersionToPath message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VersionToPath - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.VersionToPath; - - /** - * Creates a plain object from a VersionToPath message. Also converts values to other types if specified. - * @param message VersionToPath - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.VersionToPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VersionToPath to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VersionToPath - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudSqlInstance. */ - interface ICloudSqlInstance { - - /** CloudSqlInstance instances */ - instances?: (string[]|null); - } - - /** Represents a CloudSqlInstance. */ - class CloudSqlInstance implements ICloudSqlInstance { - - /** - * Constructs a new CloudSqlInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICloudSqlInstance); - - /** CloudSqlInstance instances. */ - public instances: string[]; - - /** - * Creates a new CloudSqlInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSqlInstance instance - */ - public static create(properties?: google.cloud.run.v2.ICloudSqlInstance): google.cloud.run.v2.CloudSqlInstance; - - /** - * Encodes the specified CloudSqlInstance message. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. - * @param message CloudSqlInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICloudSqlInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudSqlInstance message, length delimited. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. - * @param message CloudSqlInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICloudSqlInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudSqlInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudSqlInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CloudSqlInstance; - - /** - * Decodes a CloudSqlInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudSqlInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CloudSqlInstance; - - /** - * Verifies a CloudSqlInstance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudSqlInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudSqlInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CloudSqlInstance; - - /** - * Creates a plain object from a CloudSqlInstance message. Also converts values to other types if specified. - * @param message CloudSqlInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.CloudSqlInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudSqlInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudSqlInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EmptyDirVolumeSource. */ - interface IEmptyDirVolumeSource { - - /** EmptyDirVolumeSource medium */ - medium?: (google.cloud.run.v2.EmptyDirVolumeSource.Medium|keyof typeof google.cloud.run.v2.EmptyDirVolumeSource.Medium|null); - - /** EmptyDirVolumeSource sizeLimit */ - sizeLimit?: (string|null); - } - - /** Represents an EmptyDirVolumeSource. */ - class EmptyDirVolumeSource implements IEmptyDirVolumeSource { - - /** - * Constructs a new EmptyDirVolumeSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IEmptyDirVolumeSource); - - /** EmptyDirVolumeSource medium. */ - public medium: (google.cloud.run.v2.EmptyDirVolumeSource.Medium|keyof typeof google.cloud.run.v2.EmptyDirVolumeSource.Medium); - - /** EmptyDirVolumeSource sizeLimit. */ - public sizeLimit: string; - - /** - * Creates a new EmptyDirVolumeSource instance using the specified properties. - * @param [properties] Properties to set - * @returns EmptyDirVolumeSource instance - */ - public static create(properties?: google.cloud.run.v2.IEmptyDirVolumeSource): google.cloud.run.v2.EmptyDirVolumeSource; - - /** - * Encodes the specified EmptyDirVolumeSource message. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. - * @param message EmptyDirVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IEmptyDirVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EmptyDirVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. - * @param message EmptyDirVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IEmptyDirVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EmptyDirVolumeSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EmptyDirVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.EmptyDirVolumeSource; - - /** - * Decodes an EmptyDirVolumeSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EmptyDirVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.EmptyDirVolumeSource; - - /** - * Verifies an EmptyDirVolumeSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EmptyDirVolumeSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EmptyDirVolumeSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.EmptyDirVolumeSource; - - /** - * Creates a plain object from an EmptyDirVolumeSource message. Also converts values to other types if specified. - * @param message EmptyDirVolumeSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.EmptyDirVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EmptyDirVolumeSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EmptyDirVolumeSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EmptyDirVolumeSource { - - /** Medium enum. */ - enum Medium { - MEDIUM_UNSPECIFIED = 0, - MEMORY = 1 - } - } - - /** Properties of a NFSVolumeSource. */ - interface INFSVolumeSource { - - /** NFSVolumeSource server */ - server?: (string|null); - - /** NFSVolumeSource path */ - path?: (string|null); - - /** NFSVolumeSource readOnly */ - readOnly?: (boolean|null); - } - - /** Represents a NFSVolumeSource. */ - class NFSVolumeSource implements INFSVolumeSource { - - /** - * Constructs a new NFSVolumeSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.INFSVolumeSource); - - /** NFSVolumeSource server. */ - public server: string; - - /** NFSVolumeSource path. */ - public path: string; - - /** NFSVolumeSource readOnly. */ - public readOnly: boolean; - - /** - * Creates a new NFSVolumeSource instance using the specified properties. - * @param [properties] Properties to set - * @returns NFSVolumeSource instance - */ - public static create(properties?: google.cloud.run.v2.INFSVolumeSource): google.cloud.run.v2.NFSVolumeSource; - - /** - * Encodes the specified NFSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. - * @param message NFSVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.INFSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NFSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. - * @param message NFSVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.INFSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NFSVolumeSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NFSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.NFSVolumeSource; - - /** - * Decodes a NFSVolumeSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NFSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.NFSVolumeSource; - - /** - * Verifies a NFSVolumeSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NFSVolumeSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NFSVolumeSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.NFSVolumeSource; - - /** - * Creates a plain object from a NFSVolumeSource message. Also converts values to other types if specified. - * @param message NFSVolumeSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.NFSVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NFSVolumeSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NFSVolumeSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GCSVolumeSource. */ - interface IGCSVolumeSource { - - /** GCSVolumeSource bucket */ - bucket?: (string|null); - - /** GCSVolumeSource readOnly */ - readOnly?: (boolean|null); - - /** GCSVolumeSource mountOptions */ - mountOptions?: (string[]|null); - } - - /** Represents a GCSVolumeSource. */ - class GCSVolumeSource implements IGCSVolumeSource { - - /** - * Constructs a new GCSVolumeSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGCSVolumeSource); - - /** GCSVolumeSource bucket. */ - public bucket: string; - - /** GCSVolumeSource readOnly. */ - public readOnly: boolean; - - /** GCSVolumeSource mountOptions. */ - public mountOptions: string[]; - - /** - * Creates a new GCSVolumeSource instance using the specified properties. - * @param [properties] Properties to set - * @returns GCSVolumeSource instance - */ - public static create(properties?: google.cloud.run.v2.IGCSVolumeSource): google.cloud.run.v2.GCSVolumeSource; - - /** - * Encodes the specified GCSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. - * @param message GCSVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGCSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. - * @param message GCSVolumeSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGCSVolumeSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCSVolumeSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GCSVolumeSource; - - /** - * Decodes a GCSVolumeSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GCSVolumeSource; - - /** - * Verifies a GCSVolumeSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCSVolumeSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCSVolumeSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GCSVolumeSource; - - /** - * Creates a plain object from a GCSVolumeSource message. Also converts values to other types if specified. - * @param message GCSVolumeSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GCSVolumeSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCSVolumeSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCSVolumeSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Probe. */ - interface IProbe { - - /** Probe initialDelaySeconds */ - initialDelaySeconds?: (number|null); - - /** Probe timeoutSeconds */ - timeoutSeconds?: (number|null); - - /** Probe periodSeconds */ - periodSeconds?: (number|null); - - /** Probe failureThreshold */ - failureThreshold?: (number|null); - - /** Probe httpGet */ - httpGet?: (google.cloud.run.v2.IHTTPGetAction|null); - - /** Probe tcpSocket */ - tcpSocket?: (google.cloud.run.v2.ITCPSocketAction|null); - - /** Probe grpc */ - grpc?: (google.cloud.run.v2.IGRPCAction|null); - } - - /** Represents a Probe. */ - class Probe implements IProbe { - - /** - * Constructs a new Probe. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IProbe); - - /** Probe initialDelaySeconds. */ - public initialDelaySeconds: number; - - /** Probe timeoutSeconds. */ - public timeoutSeconds: number; - - /** Probe periodSeconds. */ - public periodSeconds: number; - - /** Probe failureThreshold. */ - public failureThreshold: number; - - /** Probe httpGet. */ - public httpGet?: (google.cloud.run.v2.IHTTPGetAction|null); - - /** Probe tcpSocket. */ - public tcpSocket?: (google.cloud.run.v2.ITCPSocketAction|null); - - /** Probe grpc. */ - public grpc?: (google.cloud.run.v2.IGRPCAction|null); - - /** Probe probeType. */ - public probeType?: ("httpGet"|"tcpSocket"|"grpc"); - - /** - * Creates a new Probe instance using the specified properties. - * @param [properties] Properties to set - * @returns Probe instance - */ - public static create(properties?: google.cloud.run.v2.IProbe): google.cloud.run.v2.Probe; - - /** - * Encodes the specified Probe message. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. - * @param message Probe message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IProbe, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Probe message, length delimited. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. - * @param message Probe message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IProbe, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Probe message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Probe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Probe; - - /** - * Decodes a Probe message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Probe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Probe; - - /** - * Verifies a Probe message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Probe message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Probe - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Probe; - - /** - * Creates a plain object from a Probe message. Also converts values to other types if specified. - * @param message Probe - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Probe, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Probe to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Probe - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HTTPGetAction. */ - interface IHTTPGetAction { - - /** HTTPGetAction path */ - path?: (string|null); - - /** HTTPGetAction httpHeaders */ - httpHeaders?: (google.cloud.run.v2.IHTTPHeader[]|null); - - /** HTTPGetAction port */ - port?: (number|null); - } - - /** Represents a HTTPGetAction. */ - class HTTPGetAction implements IHTTPGetAction { - - /** - * Constructs a new HTTPGetAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IHTTPGetAction); - - /** HTTPGetAction path. */ - public path: string; - - /** HTTPGetAction httpHeaders. */ - public httpHeaders: google.cloud.run.v2.IHTTPHeader[]; - - /** HTTPGetAction port. */ - public port: number; - - /** - * Creates a new HTTPGetAction instance using the specified properties. - * @param [properties] Properties to set - * @returns HTTPGetAction instance - */ - public static create(properties?: google.cloud.run.v2.IHTTPGetAction): google.cloud.run.v2.HTTPGetAction; - - /** - * Encodes the specified HTTPGetAction message. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. - * @param message HTTPGetAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IHTTPGetAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HTTPGetAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. - * @param message HTTPGetAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IHTTPGetAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HTTPGetAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HTTPGetAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.HTTPGetAction; - - /** - * Decodes a HTTPGetAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HTTPGetAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.HTTPGetAction; - - /** - * Verifies a HTTPGetAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HTTPGetAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HTTPGetAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.HTTPGetAction; - - /** - * Creates a plain object from a HTTPGetAction message. Also converts values to other types if specified. - * @param message HTTPGetAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.HTTPGetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HTTPGetAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HTTPGetAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HTTPHeader. */ - interface IHTTPHeader { - - /** HTTPHeader name */ - name?: (string|null); - - /** HTTPHeader value */ - value?: (string|null); - } - - /** Represents a HTTPHeader. */ - class HTTPHeader implements IHTTPHeader { - - /** - * Constructs a new HTTPHeader. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IHTTPHeader); - - /** HTTPHeader name. */ - public name: string; - - /** HTTPHeader value. */ - public value: string; - - /** - * Creates a new HTTPHeader instance using the specified properties. - * @param [properties] Properties to set - * @returns HTTPHeader instance - */ - public static create(properties?: google.cloud.run.v2.IHTTPHeader): google.cloud.run.v2.HTTPHeader; - - /** - * Encodes the specified HTTPHeader message. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. - * @param message HTTPHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IHTTPHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HTTPHeader message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. - * @param message HTTPHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IHTTPHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HTTPHeader message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HTTPHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.HTTPHeader; - - /** - * Decodes a HTTPHeader message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HTTPHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.HTTPHeader; - - /** - * Verifies a HTTPHeader message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HTTPHeader message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HTTPHeader - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.HTTPHeader; - - /** - * Creates a plain object from a HTTPHeader message. Also converts values to other types if specified. - * @param message HTTPHeader - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.HTTPHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HTTPHeader to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HTTPHeader - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TCPSocketAction. */ - interface ITCPSocketAction { - - /** TCPSocketAction port */ - port?: (number|null); - } - - /** Represents a TCPSocketAction. */ - class TCPSocketAction implements ITCPSocketAction { - - /** - * Constructs a new TCPSocketAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITCPSocketAction); - - /** TCPSocketAction port. */ - public port: number; - - /** - * Creates a new TCPSocketAction instance using the specified properties. - * @param [properties] Properties to set - * @returns TCPSocketAction instance - */ - public static create(properties?: google.cloud.run.v2.ITCPSocketAction): google.cloud.run.v2.TCPSocketAction; - - /** - * Encodes the specified TCPSocketAction message. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. - * @param message TCPSocketAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ITCPSocketAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TCPSocketAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. - * @param message TCPSocketAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ITCPSocketAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TCPSocketAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TCPSocketAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TCPSocketAction; - - /** - * Decodes a TCPSocketAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TCPSocketAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TCPSocketAction; - - /** - * Verifies a TCPSocketAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TCPSocketAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TCPSocketAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TCPSocketAction; - - /** - * Creates a plain object from a TCPSocketAction message. Also converts values to other types if specified. - * @param message TCPSocketAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.TCPSocketAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TCPSocketAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TCPSocketAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GRPCAction. */ - interface IGRPCAction { - - /** GRPCAction port */ - port?: (number|null); - - /** GRPCAction service */ - service?: (string|null); - } - - /** Represents a GRPCAction. */ - class GRPCAction implements IGRPCAction { - - /** - * Constructs a new GRPCAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGRPCAction); - - /** GRPCAction port. */ - public port: number; - - /** GRPCAction service. */ - public service: string; - - /** - * Creates a new GRPCAction instance using the specified properties. - * @param [properties] Properties to set - * @returns GRPCAction instance - */ - public static create(properties?: google.cloud.run.v2.IGRPCAction): google.cloud.run.v2.GRPCAction; - - /** - * Encodes the specified GRPCAction message. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. - * @param message GRPCAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGRPCAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GRPCAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. - * @param message GRPCAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGRPCAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GRPCAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GRPCAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GRPCAction; - - /** - * Decodes a GRPCAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GRPCAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GRPCAction; - - /** - * Verifies a GRPCAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GRPCAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GRPCAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GRPCAction; - - /** - * Creates a plain object from a GRPCAction message. Also converts values to other types if specified. - * @param message GRPCAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GRPCAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GRPCAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GRPCAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BuildInfo. */ - interface IBuildInfo { - - /** BuildInfo functionTarget */ - functionTarget?: (string|null); - - /** BuildInfo sourceLocation */ - sourceLocation?: (string|null); - } - - /** Represents a BuildInfo. */ - class BuildInfo implements IBuildInfo { - - /** - * Constructs a new BuildInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IBuildInfo); - - /** BuildInfo functionTarget. */ - public functionTarget: string; - - /** BuildInfo sourceLocation. */ - public sourceLocation: string; - - /** - * Creates a new BuildInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns BuildInfo instance - */ - public static create(properties?: google.cloud.run.v2.IBuildInfo): google.cloud.run.v2.BuildInfo; - - /** - * Encodes the specified BuildInfo message. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. - * @param message BuildInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IBuildInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BuildInfo message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. - * @param message BuildInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IBuildInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BuildInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BuildInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.BuildInfo; - - /** - * Decodes a BuildInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BuildInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.BuildInfo; - - /** - * Verifies a BuildInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BuildInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BuildInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.BuildInfo; - - /** - * Creates a plain object from a BuildInfo message. Also converts values to other types if specified. - * @param message BuildInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.BuildInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BuildInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BuildInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SourceCode. */ - interface ISourceCode { - - /** SourceCode cloudStorageSource */ - cloudStorageSource?: (google.cloud.run.v2.SourceCode.ICloudStorageSource|null); - } - - /** Represents a SourceCode. */ - class SourceCode implements ISourceCode { - - /** - * Constructs a new SourceCode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ISourceCode); - - /** SourceCode cloudStorageSource. */ - public cloudStorageSource?: (google.cloud.run.v2.SourceCode.ICloudStorageSource|null); - - /** SourceCode sourceType. */ - public sourceType?: "cloudStorageSource"; - - /** - * Creates a new SourceCode instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCode instance - */ - public static create(properties?: google.cloud.run.v2.ISourceCode): google.cloud.run.v2.SourceCode; - - /** - * Encodes the specified SourceCode message. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. - * @param message SourceCode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ISourceCode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCode message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. - * @param message SourceCode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ISourceCode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SourceCode; - - /** - * Decodes a SourceCode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SourceCode; - - /** - * Verifies a SourceCode message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SourceCode; - - /** - * Creates a plain object from a SourceCode message. Also converts values to other types if specified. - * @param message SourceCode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SourceCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCode { - - /** Properties of a CloudStorageSource. */ - interface ICloudStorageSource { - - /** CloudStorageSource bucket */ - bucket?: (string|null); - - /** CloudStorageSource object */ - object?: (string|null); - - /** CloudStorageSource generation */ - generation?: (number|Long|string|null); - } - - /** Represents a CloudStorageSource. */ - class CloudStorageSource implements ICloudStorageSource { - - /** - * Constructs a new CloudStorageSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.SourceCode.ICloudStorageSource); - - /** CloudStorageSource bucket. */ - public bucket: string; - - /** CloudStorageSource object. */ - public object: string; - - /** CloudStorageSource generation. */ - public generation: (number|Long|string); - - /** - * Creates a new CloudStorageSource instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudStorageSource instance - */ - public static create(properties?: google.cloud.run.v2.SourceCode.ICloudStorageSource): google.cloud.run.v2.SourceCode.CloudStorageSource; - - /** - * Encodes the specified CloudStorageSource message. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. - * @param message CloudStorageSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.SourceCode.ICloudStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudStorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. - * @param message CloudStorageSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.SourceCode.ICloudStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudStorageSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudStorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.SourceCode.CloudStorageSource; - - /** - * Decodes a CloudStorageSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudStorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.SourceCode.CloudStorageSource; - - /** - * Verifies a CloudStorageSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudStorageSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudStorageSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.SourceCode.CloudStorageSource; - - /** - * Creates a plain object from a CloudStorageSource message. Also converts values to other types if specified. - * @param message CloudStorageSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.SourceCode.CloudStorageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudStorageSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudStorageSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a VpcAccess. */ - interface IVpcAccess { - - /** VpcAccess connector */ - connector?: (string|null); - - /** VpcAccess egress */ - egress?: (google.cloud.run.v2.VpcAccess.VpcEgress|keyof typeof google.cloud.run.v2.VpcAccess.VpcEgress|null); - - /** VpcAccess networkInterfaces */ - networkInterfaces?: (google.cloud.run.v2.VpcAccess.INetworkInterface[]|null); - } - - /** Represents a VpcAccess. */ - class VpcAccess implements IVpcAccess { - - /** - * Constructs a new VpcAccess. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IVpcAccess); - - /** VpcAccess connector. */ - public connector: string; - - /** VpcAccess egress. */ - public egress: (google.cloud.run.v2.VpcAccess.VpcEgress|keyof typeof google.cloud.run.v2.VpcAccess.VpcEgress); - - /** VpcAccess networkInterfaces. */ - public networkInterfaces: google.cloud.run.v2.VpcAccess.INetworkInterface[]; - - /** - * Creates a new VpcAccess instance using the specified properties. - * @param [properties] Properties to set - * @returns VpcAccess instance - */ - public static create(properties?: google.cloud.run.v2.IVpcAccess): google.cloud.run.v2.VpcAccess; - - /** - * Encodes the specified VpcAccess message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. - * @param message VpcAccess message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IVpcAccess, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VpcAccess message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. - * @param message VpcAccess message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IVpcAccess, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VpcAccess message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VpcAccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.VpcAccess; - - /** - * Decodes a VpcAccess message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VpcAccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.VpcAccess; - - /** - * Verifies a VpcAccess message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VpcAccess message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VpcAccess - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.VpcAccess; - - /** - * Creates a plain object from a VpcAccess message. Also converts values to other types if specified. - * @param message VpcAccess - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.VpcAccess, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VpcAccess to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VpcAccess - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace VpcAccess { - - /** VpcEgress enum. */ - enum VpcEgress { - VPC_EGRESS_UNSPECIFIED = 0, - ALL_TRAFFIC = 1, - PRIVATE_RANGES_ONLY = 2 - } - - /** Properties of a NetworkInterface. */ - interface INetworkInterface { - - /** NetworkInterface network */ - network?: (string|null); - - /** NetworkInterface subnetwork */ - subnetwork?: (string|null); - - /** NetworkInterface tags */ - tags?: (string[]|null); - } - - /** Represents a NetworkInterface. */ - class NetworkInterface implements INetworkInterface { - - /** - * Constructs a new NetworkInterface. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.VpcAccess.INetworkInterface); - - /** NetworkInterface network. */ - public network: string; - - /** NetworkInterface subnetwork. */ - public subnetwork: string; - - /** NetworkInterface tags. */ - public tags: string[]; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkInterface instance - */ - public static create(properties?: google.cloud.run.v2.VpcAccess.INetworkInterface): google.cloud.run.v2.VpcAccess.NetworkInterface; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.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 BinaryAuthorization. */ - interface IBinaryAuthorization { - - /** BinaryAuthorization useDefault */ - useDefault?: (boolean|null); - - /** BinaryAuthorization policy */ - policy?: (string|null); - - /** BinaryAuthorization breakglassJustification */ - breakglassJustification?: (string|null); - } - - /** Represents a BinaryAuthorization. */ - class BinaryAuthorization implements IBinaryAuthorization { - - /** - * Constructs a new BinaryAuthorization. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IBinaryAuthorization); - - /** BinaryAuthorization useDefault. */ - public useDefault?: (boolean|null); - - /** BinaryAuthorization policy. */ - public policy?: (string|null); - - /** BinaryAuthorization breakglassJustification. */ - public breakglassJustification: string; - - /** BinaryAuthorization binauthzMethod. */ - public binauthzMethod?: ("useDefault"|"policy"); - - /** - * Creates a new BinaryAuthorization instance using the specified properties. - * @param [properties] Properties to set - * @returns BinaryAuthorization instance - */ - public static create(properties?: google.cloud.run.v2.IBinaryAuthorization): google.cloud.run.v2.BinaryAuthorization; - - /** - * Encodes the specified BinaryAuthorization message. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. - * @param message BinaryAuthorization message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IBinaryAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BinaryAuthorization message, length delimited. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. - * @param message BinaryAuthorization message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IBinaryAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BinaryAuthorization message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BinaryAuthorization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.BinaryAuthorization; - - /** - * Decodes a BinaryAuthorization message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BinaryAuthorization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.BinaryAuthorization; - - /** - * Verifies a BinaryAuthorization message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BinaryAuthorization message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BinaryAuthorization - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.BinaryAuthorization; - - /** - * Creates a plain object from a BinaryAuthorization message. Also converts values to other types if specified. - * @param message BinaryAuthorization - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.BinaryAuthorization, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BinaryAuthorization to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BinaryAuthorization - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RevisionScaling. */ - interface IRevisionScaling { - - /** RevisionScaling minInstanceCount */ - minInstanceCount?: (number|null); - - /** RevisionScaling maxInstanceCount */ - maxInstanceCount?: (number|null); - } - - /** Represents a RevisionScaling. */ - class RevisionScaling implements IRevisionScaling { - - /** - * Constructs a new RevisionScaling. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IRevisionScaling); - - /** RevisionScaling minInstanceCount. */ - public minInstanceCount: number; - - /** RevisionScaling maxInstanceCount. */ - public maxInstanceCount: number; - - /** - * Creates a new RevisionScaling instance using the specified properties. - * @param [properties] Properties to set - * @returns RevisionScaling instance - */ - public static create(properties?: google.cloud.run.v2.IRevisionScaling): google.cloud.run.v2.RevisionScaling; - - /** - * Encodes the specified RevisionScaling message. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. - * @param message RevisionScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IRevisionScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevisionScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. - * @param message RevisionScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IRevisionScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevisionScaling message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevisionScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RevisionScaling; - - /** - * Decodes a RevisionScaling message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevisionScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RevisionScaling; - - /** - * Verifies a RevisionScaling message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RevisionScaling message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevisionScaling - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RevisionScaling; - - /** - * Creates a plain object from a RevisionScaling message. Also converts values to other types if specified. - * @param message RevisionScaling - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RevisionScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevisionScaling to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevisionScaling - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceMesh. */ - interface IServiceMesh { - - /** ServiceMesh mesh */ - mesh?: (string|null); - } - - /** Represents a ServiceMesh. */ - class ServiceMesh implements IServiceMesh { - - /** - * Constructs a new ServiceMesh. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IServiceMesh); - - /** ServiceMesh mesh. */ - public mesh: string; - - /** - * Creates a new ServiceMesh instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceMesh instance - */ - public static create(properties?: google.cloud.run.v2.IServiceMesh): google.cloud.run.v2.ServiceMesh; - - /** - * Encodes the specified ServiceMesh message. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. - * @param message ServiceMesh message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IServiceMesh, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceMesh message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. - * @param message ServiceMesh message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IServiceMesh, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceMesh message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceMesh - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ServiceMesh; - - /** - * Decodes a ServiceMesh message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceMesh - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ServiceMesh; - - /** - * Verifies a ServiceMesh message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceMesh message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceMesh - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ServiceMesh; - - /** - * Creates a plain object from a ServiceMesh message. Also converts values to other types if specified. - * @param message ServiceMesh - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ServiceMesh, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceMesh to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceMesh - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceScaling. */ - interface IServiceScaling { - - /** ServiceScaling minInstanceCount */ - minInstanceCount?: (number|null); - - /** ServiceScaling scalingMode */ - scalingMode?: (google.cloud.run.v2.ServiceScaling.ScalingMode|keyof typeof google.cloud.run.v2.ServiceScaling.ScalingMode|null); - - /** ServiceScaling maxInstanceCount */ - maxInstanceCount?: (number|null); - - /** ServiceScaling manualInstanceCount */ - manualInstanceCount?: (number|null); - } - - /** Represents a ServiceScaling. */ - class ServiceScaling implements IServiceScaling { - - /** - * Constructs a new ServiceScaling. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IServiceScaling); - - /** ServiceScaling minInstanceCount. */ - public minInstanceCount: number; - - /** ServiceScaling scalingMode. */ - public scalingMode: (google.cloud.run.v2.ServiceScaling.ScalingMode|keyof typeof google.cloud.run.v2.ServiceScaling.ScalingMode); - - /** ServiceScaling maxInstanceCount. */ - public maxInstanceCount: number; - - /** ServiceScaling manualInstanceCount. */ - public manualInstanceCount?: (number|null); - - /** - * Creates a new ServiceScaling instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceScaling instance - */ - public static create(properties?: google.cloud.run.v2.IServiceScaling): google.cloud.run.v2.ServiceScaling; - - /** - * Encodes the specified ServiceScaling message. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. - * @param message ServiceScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IServiceScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. - * @param message ServiceScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IServiceScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceScaling message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ServiceScaling; - - /** - * Decodes a ServiceScaling message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ServiceScaling; - - /** - * Verifies a ServiceScaling message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceScaling message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceScaling - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ServiceScaling; - - /** - * Creates a plain object from a ServiceScaling message. Also converts values to other types if specified. - * @param message ServiceScaling - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ServiceScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceScaling to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceScaling - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ServiceScaling { - - /** ScalingMode enum. */ - enum ScalingMode { - SCALING_MODE_UNSPECIFIED = 0, - AUTOMATIC = 1, - MANUAL = 2 - } - } - - /** Properties of a WorkerPoolScaling. */ - interface IWorkerPoolScaling { - - /** WorkerPoolScaling manualInstanceCount */ - manualInstanceCount?: (number|null); - } - - /** Represents a WorkerPoolScaling. */ - class WorkerPoolScaling implements IWorkerPoolScaling { - - /** - * Constructs a new WorkerPoolScaling. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IWorkerPoolScaling); - - /** WorkerPoolScaling manualInstanceCount. */ - public manualInstanceCount?: (number|null); - - /** - * Creates a new WorkerPoolScaling instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkerPoolScaling instance - */ - public static create(properties?: google.cloud.run.v2.IWorkerPoolScaling): google.cloud.run.v2.WorkerPoolScaling; - - /** - * Encodes the specified WorkerPoolScaling message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. - * @param message WorkerPoolScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IWorkerPoolScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkerPoolScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. - * @param message WorkerPoolScaling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IWorkerPoolScaling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkerPoolScaling message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkerPoolScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.WorkerPoolScaling; - - /** - * Decodes a WorkerPoolScaling message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkerPoolScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.WorkerPoolScaling; - - /** - * Verifies a WorkerPoolScaling message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkerPoolScaling message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkerPoolScaling - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.WorkerPoolScaling; - - /** - * Creates a plain object from a WorkerPoolScaling message. Also converts values to other types if specified. - * @param message WorkerPoolScaling - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.WorkerPoolScaling, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkerPoolScaling to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkerPoolScaling - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSelector. */ - interface INodeSelector { - - /** NodeSelector accelerator */ - accelerator?: (string|null); - } - - /** Represents a NodeSelector. */ - class NodeSelector implements INodeSelector { - - /** - * Constructs a new NodeSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.INodeSelector); - - /** NodeSelector accelerator. */ - public accelerator: string; - - /** - * Creates a new NodeSelector instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSelector instance - */ - public static create(properties?: google.cloud.run.v2.INodeSelector): google.cloud.run.v2.NodeSelector; - - /** - * Encodes the specified NodeSelector message. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. - * @param message NodeSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.INodeSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. - * @param message NodeSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.INodeSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.NodeSelector; - - /** - * Decodes a NodeSelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.NodeSelector; - - /** - * Verifies a NodeSelector message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.NodeSelector; - - /** - * Creates a plain object from a NodeSelector message. Also converts values to other types if specified. - * @param message NodeSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.NodeSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSelector - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BuildConfig. */ - interface IBuildConfig { - - /** BuildConfig name */ - name?: (string|null); - - /** BuildConfig sourceLocation */ - sourceLocation?: (string|null); - - /** BuildConfig functionTarget */ - functionTarget?: (string|null); - - /** BuildConfig imageUri */ - imageUri?: (string|null); - - /** BuildConfig baseImage */ - baseImage?: (string|null); - - /** BuildConfig enableAutomaticUpdates */ - enableAutomaticUpdates?: (boolean|null); - - /** BuildConfig workerPool */ - workerPool?: (string|null); - - /** BuildConfig environmentVariables */ - environmentVariables?: ({ [k: string]: string }|null); - - /** BuildConfig serviceAccount */ - serviceAccount?: (string|null); - } - - /** Represents a BuildConfig. */ - class BuildConfig implements IBuildConfig { - - /** - * Constructs a new BuildConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IBuildConfig); - - /** BuildConfig name. */ - public name: string; - - /** BuildConfig sourceLocation. */ - public sourceLocation: string; - - /** BuildConfig functionTarget. */ - public functionTarget: string; - - /** BuildConfig imageUri. */ - public imageUri: string; - - /** BuildConfig baseImage. */ - public baseImage: string; - - /** BuildConfig enableAutomaticUpdates. */ - public enableAutomaticUpdates: boolean; - - /** BuildConfig workerPool. */ - public workerPool: string; - - /** BuildConfig environmentVariables. */ - public environmentVariables: { [k: string]: string }; - - /** BuildConfig serviceAccount. */ - public serviceAccount: string; - - /** - * Creates a new BuildConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BuildConfig instance - */ - public static create(properties?: google.cloud.run.v2.IBuildConfig): google.cloud.run.v2.BuildConfig; - - /** - * Encodes the specified BuildConfig message. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. - * @param message BuildConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IBuildConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BuildConfig message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. - * @param message BuildConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IBuildConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BuildConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BuildConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.BuildConfig; - - /** - * Decodes a BuildConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BuildConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.BuildConfig; - - /** - * Verifies a BuildConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BuildConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BuildConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.BuildConfig; - - /** - * Creates a plain object from a BuildConfig message. Also converts values to other types if specified. - * @param message BuildConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.BuildConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BuildConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BuildConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** IngressTraffic enum. */ - enum IngressTraffic { - INGRESS_TRAFFIC_UNSPECIFIED = 0, - INGRESS_TRAFFIC_ALL = 1, - INGRESS_TRAFFIC_INTERNAL_ONLY = 2, - INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3, - INGRESS_TRAFFIC_NONE = 4 - } - - /** ExecutionEnvironment enum. */ - enum ExecutionEnvironment { - EXECUTION_ENVIRONMENT_UNSPECIFIED = 0, - EXECUTION_ENVIRONMENT_GEN1 = 1, - EXECUTION_ENVIRONMENT_GEN2 = 2 - } - - /** EncryptionKeyRevocationAction enum. */ - enum EncryptionKeyRevocationAction { - ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0, - PREVENT_NEW = 1, - SHUTDOWN = 2 - } - - /** Properties of an ExecutionTemplate. */ - interface IExecutionTemplate { - - /** ExecutionTemplate labels */ - labels?: ({ [k: string]: string }|null); - - /** ExecutionTemplate annotations */ - annotations?: ({ [k: string]: string }|null); - - /** ExecutionTemplate parallelism */ - parallelism?: (number|null); - - /** ExecutionTemplate taskCount */ - taskCount?: (number|null); - - /** ExecutionTemplate template */ - template?: (google.cloud.run.v2.ITaskTemplate|null); - } - - /** Represents an ExecutionTemplate. */ - class ExecutionTemplate implements IExecutionTemplate { - - /** - * Constructs a new ExecutionTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IExecutionTemplate); - - /** ExecutionTemplate labels. */ - public labels: { [k: string]: string }; - - /** ExecutionTemplate annotations. */ - public annotations: { [k: string]: string }; - - /** ExecutionTemplate parallelism. */ - public parallelism: number; - - /** ExecutionTemplate taskCount. */ - public taskCount: number; - - /** ExecutionTemplate template. */ - public template?: (google.cloud.run.v2.ITaskTemplate|null); - - /** - * Creates a new ExecutionTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecutionTemplate instance - */ - public static create(properties?: google.cloud.run.v2.IExecutionTemplate): google.cloud.run.v2.ExecutionTemplate; - - /** - * Encodes the specified ExecutionTemplate message. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. - * @param message ExecutionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IExecutionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecutionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. - * @param message ExecutionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IExecutionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecutionTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecutionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ExecutionTemplate; - - /** - * Decodes an ExecutionTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecutionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ExecutionTemplate; - - /** - * Verifies an ExecutionTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecutionTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecutionTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ExecutionTemplate; - - /** - * Creates a plain object from an ExecutionTemplate message. Also converts values to other types if specified. - * @param message ExecutionTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ExecutionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecutionTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecutionTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an Instances */ - class Instances extends $protobuf.rpc.Service { - - /** - * Constructs a new Instances 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 Instances 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): Instances; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createInstance(request: google.cloud.run.v2.ICreateInstanceRequest, callback: google.cloud.run.v2.Instances.CreateInstanceCallback): void; - - /** - * Calls CreateInstance. - * @param request CreateInstanceRequest message or plain object - * @returns Promise - */ - public createInstance(request: google.cloud.run.v2.ICreateInstanceRequest): Promise; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteInstance(request: google.cloud.run.v2.IDeleteInstanceRequest, callback: google.cloud.run.v2.Instances.DeleteInstanceCallback): void; - - /** - * Calls DeleteInstance. - * @param request DeleteInstanceRequest message or plain object - * @returns Promise - */ - public deleteInstance(request: google.cloud.run.v2.IDeleteInstanceRequest): Promise; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Instance - */ - public getInstance(request: google.cloud.run.v2.IGetInstanceRequest, callback: google.cloud.run.v2.Instances.GetInstanceCallback): void; - - /** - * Calls GetInstance. - * @param request GetInstanceRequest message or plain object - * @returns Promise - */ - public getInstance(request: google.cloud.run.v2.IGetInstanceRequest): Promise; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListInstancesResponse - */ - public listInstances(request: google.cloud.run.v2.IListInstancesRequest, callback: google.cloud.run.v2.Instances.ListInstancesCallback): void; - - /** - * Calls ListInstances. - * @param request ListInstancesRequest message or plain object - * @returns Promise - */ - public listInstances(request: google.cloud.run.v2.IListInstancesRequest): Promise; - - /** - * Calls StopInstance. - * @param request StopInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public stopInstance(request: google.cloud.run.v2.IStopInstanceRequest, callback: google.cloud.run.v2.Instances.StopInstanceCallback): void; - - /** - * Calls StopInstance. - * @param request StopInstanceRequest message or plain object - * @returns Promise - */ - public stopInstance(request: google.cloud.run.v2.IStopInstanceRequest): Promise; - - /** - * Calls StartInstance. - * @param request StartInstanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public startInstance(request: google.cloud.run.v2.IStartInstanceRequest, callback: google.cloud.run.v2.Instances.StartInstanceCallback): void; - - /** - * Calls StartInstance. - * @param request StartInstanceRequest message or plain object - * @returns Promise - */ - public startInstance(request: google.cloud.run.v2.IStartInstanceRequest): Promise; - } - - namespace Instances { - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|createInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|deleteInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|getInstance}. - * @param error Error, if any - * @param [response] Instance - */ - type GetInstanceCallback = (error: (Error|null), response?: google.cloud.run.v2.Instance) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|listInstances}. - * @param error Error, if any - * @param [response] ListInstancesResponse - */ - type ListInstancesCallback = (error: (Error|null), response?: google.cloud.run.v2.ListInstancesResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|stopInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type StopInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|startInstance}. - * @param error Error, if any - * @param [response] Operation - */ - type StartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { - - /** CreateInstanceRequest parent */ - parent?: (string|null); - - /** CreateInstanceRequest instance */ - instance?: (google.cloud.run.v2.IInstance|null); - - /** CreateInstanceRequest instanceId */ - instanceId?: (string|null); - - /** CreateInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { - - /** - * Constructs a new CreateInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICreateInstanceRequest); - - /** CreateInstanceRequest parent. */ - public parent: string; - - /** CreateInstanceRequest instance. */ - public instance?: (google.cloud.run.v2.IInstance|null); - - /** CreateInstanceRequest instanceId. */ - public instanceId: string; - - /** CreateInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateInstanceRequest instance - */ - public static create(properties?: google.cloud.run.v2.ICreateInstanceRequest): google.cloud.run.v2.CreateInstanceRequest; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateInstanceRequest; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateInstanceRequest; - - /** - * Verifies a CreateInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateInstanceRequest; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetInstanceRequest. */ - interface IGetInstanceRequest { - - /** GetInstanceRequest name */ - name?: (string|null); - } - - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { - - /** - * Constructs a new GetInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGetInstanceRequest); - - /** GetInstanceRequest name. */ - public name: string; - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetInstanceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IGetInstanceRequest): google.cloud.run.v2.GetInstanceRequest; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetInstanceRequest; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetInstanceRequest; - - /** - * Verifies a GetInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetInstanceRequest; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteInstanceRequest. */ - interface IDeleteInstanceRequest { - - /** DeleteInstanceRequest name */ - name?: (string|null); - - /** DeleteInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteInstanceRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteInstanceRequest. */ - class DeleteInstanceRequest implements IDeleteInstanceRequest { - - /** - * Constructs a new DeleteInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteInstanceRequest); - - /** DeleteInstanceRequest name. */ - public name: string; - - /** DeleteInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteInstanceRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteInstanceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteInstanceRequest): google.cloud.run.v2.DeleteInstanceRequest; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. - * @param message DeleteInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteInstanceRequest; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteInstanceRequest; - - /** - * Verifies a DeleteInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteInstanceRequest; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @param message DeleteInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); - - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); - - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); - - /** ListInstancesRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { - - /** - * Constructs a new ListInstancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; - - /** ListInstancesRequest pageSize. */ - public pageSize: number; - - /** ListInstancesRequest pageToken. */ - public pageToken: string; - - /** ListInstancesRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListInstancesRequest): google.cloud.run.v2.ListInstancesRequest; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListInstancesRequest; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListInstancesRequest; - - /** - * Verifies a ListInstancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListInstancesRequest; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { - - /** ListInstancesResponse instances */ - instances?: (google.cloud.run.v2.IInstance[]|null); - - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { - - /** - * Constructs a new ListInstancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListInstancesResponse); - - /** ListInstancesResponse instances. */ - public instances: google.cloud.run.v2.IInstance[]; - - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListInstancesResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListInstancesResponse): google.cloud.run.v2.ListInstancesResponse; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListInstancesResponse; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListInstancesResponse; - - /** - * Verifies a ListInstancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListInstancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListInstancesResponse; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListInstancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListInstancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StopInstanceRequest. */ - interface IStopInstanceRequest { - - /** StopInstanceRequest name */ - name?: (string|null); - - /** StopInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** StopInstanceRequest etag */ - etag?: (string|null); - } - - /** Represents a StopInstanceRequest. */ - class StopInstanceRequest implements IStopInstanceRequest { - - /** - * Constructs a new StopInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IStopInstanceRequest); - - /** StopInstanceRequest name. */ - public name: string; - - /** StopInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** StopInstanceRequest etag. */ - public etag: string; - - /** - * Creates a new StopInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns StopInstanceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IStopInstanceRequest): google.cloud.run.v2.StopInstanceRequest; - - /** - * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. - * @param message StopInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. - * @param message StopInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StopInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StopInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StopInstanceRequest; - - /** - * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StopInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StopInstanceRequest; - - /** - * Verifies a StopInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StopInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StopInstanceRequest; - - /** - * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. - * @param message StopInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.StopInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StopInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StopInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StartInstanceRequest. */ - interface IStartInstanceRequest { - - /** StartInstanceRequest name */ - name?: (string|null); - - /** StartInstanceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** StartInstanceRequest etag */ - etag?: (string|null); - } - - /** Represents a StartInstanceRequest. */ - class StartInstanceRequest implements IStartInstanceRequest { - - /** - * Constructs a new StartInstanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IStartInstanceRequest); - - /** StartInstanceRequest name. */ - public name: string; - - /** StartInstanceRequest validateOnly. */ - public validateOnly: boolean; - - /** StartInstanceRequest etag. */ - public etag: string; - - /** - * Creates a new StartInstanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns StartInstanceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IStartInstanceRequest): google.cloud.run.v2.StartInstanceRequest; - - /** - * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. - * @param message StartInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. - * @param message StartInstanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StartInstanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StartInstanceRequest; - - /** - * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StartInstanceRequest; - - /** - * Verifies a StartInstanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StartInstanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StartInstanceRequest; - - /** - * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. - * @param message StartInstanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.StartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StartInstanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StartInstanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Instance. */ - interface IInstance { - - /** Instance name */ - name?: (string|null); - - /** Instance description */ - description?: (string|null); - - /** Instance uid */ - uid?: (string|null); - - /** Instance generation */ - generation?: (number|Long|string|null); - - /** Instance labels */ - labels?: ({ [k: string]: string }|null); - - /** Instance annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Instance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Instance expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Instance creator */ - creator?: (string|null); - - /** Instance lastModifier */ - lastModifier?: (string|null); - - /** Instance client */ - client?: (string|null); - - /** Instance clientVersion */ - clientVersion?: (string|null); - - /** Instance launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** Instance binaryAuthorization */ - binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Instance vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Instance serviceAccount */ - serviceAccount?: (string|null); - - /** Instance containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** Instance volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** Instance encryptionKey */ - encryptionKey?: (string|null); - - /** Instance encryptionKeyRevocationAction */ - encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); - - /** Instance encryptionKeyShutdownDuration */ - encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** Instance nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Instance gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - - /** Instance ingress */ - ingress?: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic|null); - - /** Instance invokerIamDisabled */ - invokerIamDisabled?: (boolean|null); - - /** Instance iapEnabled */ - iapEnabled?: (boolean|null); - - /** Instance observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Instance logUri */ - logUri?: (string|null); - - /** Instance terminalCondition */ - terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Instance conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Instance containerStatuses */ - containerStatuses?: (google.cloud.run.v2.IContainerStatus[]|null); - - /** Instance satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Instance urls */ - urls?: (string[]|null); - - /** Instance reconciling */ - reconciling?: (boolean|null); - - /** Instance etag */ - etag?: (string|null); - } - - /** Represents an Instance. */ - class Instance implements IInstance { - - /** - * Constructs a new Instance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IInstance); - - /** Instance name. */ - public name: string; - - /** Instance description. */ - public description: string; - - /** Instance uid. */ - public uid: string; - - /** Instance generation. */ - public generation: (number|Long|string); - - /** Instance labels. */ - public labels: { [k: string]: string }; - - /** Instance annotations. */ - public annotations: { [k: string]: string }; - - /** Instance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Instance updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Instance deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Instance expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Instance creator. */ - public creator: string; - - /** Instance lastModifier. */ - public lastModifier: string; - - /** Instance client. */ - public client: string; - - /** Instance clientVersion. */ - public clientVersion: string; - - /** Instance launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** Instance binaryAuthorization. */ - public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Instance vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Instance serviceAccount. */ - public serviceAccount: string; - - /** Instance containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** Instance volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** Instance encryptionKey. */ - public encryptionKey: string; - - /** Instance encryptionKeyRevocationAction. */ - public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); - - /** Instance encryptionKeyShutdownDuration. */ - public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** Instance nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Instance gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** Instance ingress. */ - public ingress: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic); - - /** Instance invokerIamDisabled. */ - public invokerIamDisabled: boolean; - - /** Instance iapEnabled. */ - public iapEnabled: boolean; - - /** Instance observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Instance logUri. */ - public logUri: string; - - /** Instance terminalCondition. */ - public terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Instance conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Instance containerStatuses. */ - public containerStatuses: google.cloud.run.v2.IContainerStatus[]; - - /** Instance satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Instance urls. */ - public urls: string[]; - - /** Instance reconciling. */ - public reconciling: boolean; - - /** Instance etag. */ - public etag: string; - - /** - * Creates a new Instance instance using the specified properties. - * @param [properties] Properties to set - * @returns Instance instance - */ - public static create(properties?: google.cloud.run.v2.IInstance): google.cloud.run.v2.Instance; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. - * @param message Instance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Instance; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Instance; - - /** - * Verifies an Instance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Instance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Instance; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @param message Instance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Instance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Instance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceSplit. */ - interface IInstanceSplit { - - /** InstanceSplit type */ - type?: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType|null); - - /** InstanceSplit revision */ - revision?: (string|null); - - /** InstanceSplit percent */ - percent?: (number|null); - } - - /** Represents an InstanceSplit. */ - class InstanceSplit implements IInstanceSplit { - - /** - * Constructs a new InstanceSplit. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IInstanceSplit); - - /** InstanceSplit type. */ - public type: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType); - - /** InstanceSplit revision. */ - public revision: string; - - /** InstanceSplit percent. */ - public percent: number; - - /** - * Creates a new InstanceSplit instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceSplit instance - */ - public static create(properties?: google.cloud.run.v2.IInstanceSplit): google.cloud.run.v2.InstanceSplit; - - /** - * Encodes the specified InstanceSplit message. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. - * @param message InstanceSplit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IInstanceSplit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceSplit message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. - * @param message InstanceSplit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IInstanceSplit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceSplit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceSplit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.InstanceSplit; - - /** - * Decodes an InstanceSplit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceSplit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.InstanceSplit; - - /** - * Verifies an InstanceSplit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceSplit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceSplit - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.InstanceSplit; - - /** - * Creates a plain object from an InstanceSplit message. Also converts values to other types if specified. - * @param message InstanceSplit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.InstanceSplit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceSplit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceSplit - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceSplitStatus. */ - interface IInstanceSplitStatus { - - /** InstanceSplitStatus type */ - type?: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType|null); - - /** InstanceSplitStatus revision */ - revision?: (string|null); - - /** InstanceSplitStatus percent */ - percent?: (number|null); - } - - /** Represents an InstanceSplitStatus. */ - class InstanceSplitStatus implements IInstanceSplitStatus { - - /** - * Constructs a new InstanceSplitStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IInstanceSplitStatus); - - /** InstanceSplitStatus type. */ - public type: (google.cloud.run.v2.InstanceSplitAllocationType|keyof typeof google.cloud.run.v2.InstanceSplitAllocationType); - - /** InstanceSplitStatus revision. */ - public revision: string; - - /** InstanceSplitStatus percent. */ - public percent: number; - - /** - * Creates a new InstanceSplitStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceSplitStatus instance - */ - public static create(properties?: google.cloud.run.v2.IInstanceSplitStatus): google.cloud.run.v2.InstanceSplitStatus; - - /** - * Encodes the specified InstanceSplitStatus message. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. - * @param message InstanceSplitStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IInstanceSplitStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceSplitStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. - * @param message InstanceSplitStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IInstanceSplitStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceSplitStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceSplitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.InstanceSplitStatus; - - /** - * Decodes an InstanceSplitStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceSplitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.InstanceSplitStatus; - - /** - * Verifies an InstanceSplitStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceSplitStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceSplitStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.InstanceSplitStatus; - - /** - * Creates a plain object from an InstanceSplitStatus message. Also converts values to other types if specified. - * @param message InstanceSplitStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.InstanceSplitStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceSplitStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceSplitStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** InstanceSplitAllocationType enum. */ - enum InstanceSplitAllocationType { - INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED = 0, - INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST = 1, - INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION = 2 - } - - /** Represents a Jobs */ - class Jobs extends $protobuf.rpc.Service { - - /** - * Constructs a new Jobs 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 Jobs 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): Jobs; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createJob(request: google.cloud.run.v2.ICreateJobRequest, callback: google.cloud.run.v2.Jobs.CreateJobCallback): void; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @returns Promise - */ - public createJob(request: google.cloud.run.v2.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.run.v2.IGetJobRequest, callback: google.cloud.run.v2.Jobs.GetJobCallback): void; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @returns Promise - */ - public getJob(request: google.cloud.run.v2.IGetJobRequest): 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.run.v2.IListJobsRequest, callback: google.cloud.run.v2.Jobs.ListJobsCallback): void; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @returns Promise - */ - public listJobs(request: google.cloud.run.v2.IListJobsRequest): Promise; - - /** - * Calls UpdateJob. - * @param request UpdateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateJob(request: google.cloud.run.v2.IUpdateJobRequest, callback: google.cloud.run.v2.Jobs.UpdateJobCallback): void; - - /** - * Calls UpdateJob. - * @param request UpdateJobRequest message or plain object - * @returns Promise - */ - public updateJob(request: google.cloud.run.v2.IUpdateJobRequest): 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.run.v2.IDeleteJobRequest, callback: google.cloud.run.v2.Jobs.DeleteJobCallback): void; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @returns Promise - */ - public deleteJob(request: google.cloud.run.v2.IDeleteJobRequest): Promise; - - /** - * Calls RunJob. - * @param request RunJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public runJob(request: google.cloud.run.v2.IRunJobRequest, callback: google.cloud.run.v2.Jobs.RunJobCallback): void; - - /** - * Calls RunJob. - * @param request RunJobRequest message or plain object - * @returns Promise - */ - public runJob(request: google.cloud.run.v2.IRunJobRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.run.v2.Jobs.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.run.v2.Jobs.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.run.v2.Jobs.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace Jobs { - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|createJob}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|getJob}. - * @param error Error, if any - * @param [response] Job - */ - type GetJobCallback = (error: (Error|null), response?: google.cloud.run.v2.Job) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|listJobs}. - * @param error Error, if any - * @param [response] ListJobsResponse - */ - type ListJobsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListJobsResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|updateJob}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|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.run.v2.Jobs|runJob}. - * @param error Error, if any - * @param [response] Operation - */ - type RunJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a CreateJobRequest. */ - interface ICreateJobRequest { - - /** CreateJobRequest parent */ - parent?: (string|null); - - /** CreateJobRequest job */ - job?: (google.cloud.run.v2.IJob|null); - - /** CreateJobRequest jobId */ - jobId?: (string|null); - - /** CreateJobRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateJobRequest. */ - class CreateJobRequest implements ICreateJobRequest { - - /** - * Constructs a new CreateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICreateJobRequest); - - /** CreateJobRequest parent. */ - public parent: string; - - /** CreateJobRequest job. */ - public job?: (google.cloud.run.v2.IJob|null); - - /** CreateJobRequest jobId. */ - public jobId: string; - - /** CreateJobRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateJobRequest instance - */ - public static create(properties?: google.cloud.run.v2.ICreateJobRequest): google.cloud.run.v2.CreateJobRequest; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.IGetJobRequest): google.cloud.run.v2.GetJobRequest; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 an UpdateJobRequest. */ - interface IUpdateJobRequest { - - /** UpdateJobRequest job */ - job?: (google.cloud.run.v2.IJob|null); - - /** UpdateJobRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateJobRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateJobRequest. */ - class UpdateJobRequest implements IUpdateJobRequest { - - /** - * Constructs a new UpdateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IUpdateJobRequest); - - /** UpdateJobRequest job. */ - public job?: (google.cloud.run.v2.IJob|null); - - /** UpdateJobRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateJobRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateJobRequest instance - */ - public static create(properties?: google.cloud.run.v2.IUpdateJobRequest): google.cloud.run.v2.UpdateJobRequest; - - /** - * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 pageSize */ - pageSize?: (number|null); - - /** ListJobsRequest pageToken */ - pageToken?: (string|null); - - /** ListJobsRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListJobsRequest. */ - class ListJobsRequest implements IListJobsRequest { - - /** - * Constructs a new ListJobsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListJobsRequest); - - /** ListJobsRequest parent. */ - public parent: string; - - /** ListJobsRequest pageSize. */ - public pageSize: number; - - /** ListJobsRequest pageToken. */ - public pageToken: string; - - /** ListJobsRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListJobsRequest): google.cloud.run.v2.ListJobsRequest; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.IJob[]|null); - - /** ListJobsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListJobsResponse. */ - class ListJobsResponse implements IListJobsResponse { - - /** - * Constructs a new ListJobsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListJobsResponse); - - /** ListJobsResponse jobs. */ - public jobs: google.cloud.run.v2.IJob[]; - - /** ListJobsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListJobsResponse): google.cloud.run.v2.ListJobsResponse; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 DeleteJobRequest. */ - interface IDeleteJobRequest { - - /** DeleteJobRequest name */ - name?: (string|null); - - /** DeleteJobRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteJobRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteJobRequest. */ - class DeleteJobRequest implements IDeleteJobRequest { - - /** - * Constructs a new DeleteJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteJobRequest); - - /** DeleteJobRequest name. */ - public name: string; - - /** DeleteJobRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteJobRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteJobRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteJobRequest): google.cloud.run.v2.DeleteJobRequest; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 RunJobRequest. */ - interface IRunJobRequest { - - /** RunJobRequest name */ - name?: (string|null); - - /** RunJobRequest validateOnly */ - validateOnly?: (boolean|null); - - /** RunJobRequest etag */ - etag?: (string|null); - - /** RunJobRequest overrides */ - overrides?: (google.cloud.run.v2.RunJobRequest.IOverrides|null); - } - - /** Represents a RunJobRequest. */ - class RunJobRequest implements IRunJobRequest { - - /** - * Constructs a new RunJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IRunJobRequest); - - /** RunJobRequest name. */ - public name: string; - - /** RunJobRequest validateOnly. */ - public validateOnly: boolean; - - /** RunJobRequest etag. */ - public etag: string; - - /** RunJobRequest overrides. */ - public overrides?: (google.cloud.run.v2.RunJobRequest.IOverrides|null); - - /** - * Creates a new RunJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunJobRequest instance - */ - public static create(properties?: google.cloud.run.v2.IRunJobRequest): google.cloud.run.v2.RunJobRequest; - - /** - * Encodes the specified RunJobRequest message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. - * @param message RunJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IRunJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. - * @param message RunJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IRunJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest; - - /** - * Decodes a RunJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest; - - /** - * Verifies a RunJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest; - - /** - * Creates a plain object from a RunJobRequest message. Also converts values to other types if specified. - * @param message RunJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RunJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RunJobRequest { - - /** Properties of an Overrides. */ - interface IOverrides { - - /** Overrides containerOverrides */ - containerOverrides?: (google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride[]|null); - - /** Overrides taskCount */ - taskCount?: (number|null); - - /** Overrides timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents an Overrides. */ - class Overrides implements IOverrides { - - /** - * Constructs a new Overrides. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.RunJobRequest.IOverrides); - - /** Overrides containerOverrides. */ - public containerOverrides: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride[]; - - /** Overrides taskCount. */ - public taskCount: number; - - /** Overrides timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new Overrides instance using the specified properties. - * @param [properties] Properties to set - * @returns Overrides instance - */ - public static create(properties?: google.cloud.run.v2.RunJobRequest.IOverrides): google.cloud.run.v2.RunJobRequest.Overrides; - - /** - * Encodes the specified Overrides message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. - * @param message Overrides message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.RunJobRequest.IOverrides, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Overrides message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. - * @param message Overrides message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.RunJobRequest.IOverrides, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Overrides message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Overrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest.Overrides; - - /** - * Decodes an Overrides message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Overrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest.Overrides; - - /** - * Verifies an Overrides message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Overrides message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Overrides - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest.Overrides; - - /** - * Creates a plain object from an Overrides message. Also converts values to other types if specified. - * @param message Overrides - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RunJobRequest.Overrides, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Overrides to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Overrides - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Overrides { - - /** Properties of a ContainerOverride. */ - interface IContainerOverride { - - /** ContainerOverride name */ - name?: (string|null); - - /** ContainerOverride args */ - args?: (string[]|null); - - /** ContainerOverride env */ - env?: (google.cloud.run.v2.IEnvVar[]|null); - - /** ContainerOverride clearArgs */ - clearArgs?: (boolean|null); - } - - /** Represents a ContainerOverride. */ - class ContainerOverride implements IContainerOverride { - - /** - * Constructs a new ContainerOverride. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride); - - /** ContainerOverride name. */ - public name: string; - - /** ContainerOverride args. */ - public args: string[]; - - /** ContainerOverride env. */ - public env: google.cloud.run.v2.IEnvVar[]; - - /** ContainerOverride clearArgs. */ - public clearArgs: boolean; - - /** - * Creates a new ContainerOverride instance using the specified properties. - * @param [properties] Properties to set - * @returns ContainerOverride instance - */ - public static create(properties?: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; - - /** - * Encodes the specified ContainerOverride message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. - * @param message ContainerOverride message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ContainerOverride message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. - * @param message ContainerOverride message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ContainerOverride message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContainerOverride - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; - - /** - * Decodes a ContainerOverride message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContainerOverride - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; - - /** - * Verifies a ContainerOverride message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ContainerOverride message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContainerOverride - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride; - - /** - * Creates a plain object from a ContainerOverride message. Also converts values to other types if specified. - * @param message ContainerOverride - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ContainerOverride to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ContainerOverride - * @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 generation */ - generation?: (number|Long|string|null); - - /** Job labels */ - labels?: ({ [k: string]: string }|null); - - /** Job annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Job createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Job deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Job expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Job creator */ - creator?: (string|null); - - /** Job lastModifier */ - lastModifier?: (string|null); - - /** Job client */ - client?: (string|null); - - /** Job clientVersion */ - clientVersion?: (string|null); - - /** Job launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** Job binaryAuthorization */ - binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Job template */ - template?: (google.cloud.run.v2.IExecutionTemplate|null); - - /** Job observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Job terminalCondition */ - terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Job conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Job executionCount */ - executionCount?: (number|null); - - /** Job latestCreatedExecution */ - latestCreatedExecution?: (google.cloud.run.v2.IExecutionReference|null); - - /** Job reconciling */ - reconciling?: (boolean|null); - - /** Job satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Job startExecutionToken */ - startExecutionToken?: (string|null); - - /** Job runExecutionToken */ - runExecutionToken?: (string|null); - - /** Job etag */ - etag?: (string|null); - } - - /** Represents a Job. */ - class Job implements IJob { - - /** - * Constructs a new Job. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IJob); - - /** Job name. */ - public name: string; - - /** Job uid. */ - public uid: string; - - /** Job generation. */ - public generation: (number|Long|string); - - /** Job labels. */ - public labels: { [k: string]: string }; - - /** Job annotations. */ - public annotations: { [k: string]: string }; - - /** Job createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Job deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Job expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Job creator. */ - public creator: string; - - /** Job lastModifier. */ - public lastModifier: string; - - /** Job client. */ - public client: string; - - /** Job clientVersion. */ - public clientVersion: string; - - /** Job launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** Job binaryAuthorization. */ - public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Job template. */ - public template?: (google.cloud.run.v2.IExecutionTemplate|null); - - /** Job observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Job terminalCondition. */ - public terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Job conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Job executionCount. */ - public executionCount: number; - - /** Job latestCreatedExecution. */ - public latestCreatedExecution?: (google.cloud.run.v2.IExecutionReference|null); - - /** Job reconciling. */ - public reconciling: boolean; - - /** Job satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Job startExecutionToken. */ - public startExecutionToken?: (string|null); - - /** Job runExecutionToken. */ - public runExecutionToken?: (string|null); - - /** Job etag. */ - public etag: string; - - /** Job createExecution. */ - public createExecution?: ("startExecutionToken"|"runExecutionToken"); - - /** - * Creates a new Job instance using the specified properties. - * @param [properties] Properties to set - * @returns Job instance - */ - public static create(properties?: google.cloud.run.v2.IJob): google.cloud.run.v2.Job; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 an ExecutionReference. */ - interface IExecutionReference { - - /** ExecutionReference name */ - name?: (string|null); - - /** ExecutionReference createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference completionTime */ - completionTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference completionStatus */ - completionStatus?: (google.cloud.run.v2.ExecutionReference.CompletionStatus|keyof typeof google.cloud.run.v2.ExecutionReference.CompletionStatus|null); - } - - /** Represents an ExecutionReference. */ - class ExecutionReference implements IExecutionReference { - - /** - * Constructs a new ExecutionReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IExecutionReference); - - /** ExecutionReference name. */ - public name: string; - - /** ExecutionReference createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference completionTime. */ - public completionTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** ExecutionReference completionStatus. */ - public completionStatus: (google.cloud.run.v2.ExecutionReference.CompletionStatus|keyof typeof google.cloud.run.v2.ExecutionReference.CompletionStatus); - - /** - * Creates a new ExecutionReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecutionReference instance - */ - public static create(properties?: google.cloud.run.v2.IExecutionReference): google.cloud.run.v2.ExecutionReference; - - /** - * Encodes the specified ExecutionReference message. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. - * @param message ExecutionReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IExecutionReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecutionReference message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. - * @param message ExecutionReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IExecutionReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecutionReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecutionReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ExecutionReference; - - /** - * Decodes an ExecutionReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecutionReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ExecutionReference; - - /** - * Verifies an ExecutionReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecutionReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecutionReference - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ExecutionReference; - - /** - * Creates a plain object from an ExecutionReference message. Also converts values to other types if specified. - * @param message ExecutionReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ExecutionReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecutionReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecutionReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExecutionReference { - - /** CompletionStatus enum. */ - enum CompletionStatus { - COMPLETION_STATUS_UNSPECIFIED = 0, - EXECUTION_SUCCEEDED = 1, - EXECUTION_FAILED = 2, - EXECUTION_RUNNING = 3, - EXECUTION_PENDING = 4, - EXECUTION_CANCELLED = 5 - } - } - - /** Represents a Revisions */ - class Revisions extends $protobuf.rpc.Service { - - /** - * Constructs a new Revisions 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 Revisions 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): Revisions; - - /** - * Calls GetRevision. - * @param request GetRevisionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Revision - */ - public getRevision(request: google.cloud.run.v2.IGetRevisionRequest, callback: google.cloud.run.v2.Revisions.GetRevisionCallback): void; - - /** - * Calls GetRevision. - * @param request GetRevisionRequest message or plain object - * @returns Promise - */ - public getRevision(request: google.cloud.run.v2.IGetRevisionRequest): Promise; - - /** - * Calls ListRevisions. - * @param request ListRevisionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListRevisionsResponse - */ - public listRevisions(request: google.cloud.run.v2.IListRevisionsRequest, callback: google.cloud.run.v2.Revisions.ListRevisionsCallback): void; - - /** - * Calls ListRevisions. - * @param request ListRevisionsRequest message or plain object - * @returns Promise - */ - public listRevisions(request: google.cloud.run.v2.IListRevisionsRequest): Promise; - - /** - * Calls DeleteRevision. - * @param request DeleteRevisionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteRevision(request: google.cloud.run.v2.IDeleteRevisionRequest, callback: google.cloud.run.v2.Revisions.DeleteRevisionCallback): void; - - /** - * Calls DeleteRevision. - * @param request DeleteRevisionRequest message or plain object - * @returns Promise - */ - public deleteRevision(request: google.cloud.run.v2.IDeleteRevisionRequest): Promise; - } - - namespace Revisions { - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|getRevision}. - * @param error Error, if any - * @param [response] Revision - */ - type GetRevisionCallback = (error: (Error|null), response?: google.cloud.run.v2.Revision) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|listRevisions}. - * @param error Error, if any - * @param [response] ListRevisionsResponse - */ - type ListRevisionsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListRevisionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|deleteRevision}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteRevisionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a GetRevisionRequest. */ - interface IGetRevisionRequest { - - /** GetRevisionRequest name */ - name?: (string|null); - } - - /** Represents a GetRevisionRequest. */ - class GetRevisionRequest implements IGetRevisionRequest { - - /** - * Constructs a new GetRevisionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGetRevisionRequest); - - /** GetRevisionRequest name. */ - public name: string; - - /** - * Creates a new GetRevisionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetRevisionRequest instance - */ - public static create(properties?: google.cloud.run.v2.IGetRevisionRequest): google.cloud.run.v2.GetRevisionRequest; - - /** - * Encodes the specified GetRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. - * @param message GetRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGetRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. - * @param message GetRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGetRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetRevisionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetRevisionRequest; - - /** - * Decodes a GetRevisionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetRevisionRequest; - - /** - * Verifies a GetRevisionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetRevisionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetRevisionRequest; - - /** - * Creates a plain object from a GetRevisionRequest message. Also converts values to other types if specified. - * @param message GetRevisionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GetRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetRevisionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetRevisionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListRevisionsRequest. */ - interface IListRevisionsRequest { - - /** ListRevisionsRequest parent */ - parent?: (string|null); - - /** ListRevisionsRequest pageSize */ - pageSize?: (number|null); - - /** ListRevisionsRequest pageToken */ - pageToken?: (string|null); - - /** ListRevisionsRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListRevisionsRequest. */ - class ListRevisionsRequest implements IListRevisionsRequest { - - /** - * Constructs a new ListRevisionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListRevisionsRequest); - - /** ListRevisionsRequest parent. */ - public parent: string; - - /** ListRevisionsRequest pageSize. */ - public pageSize: number; - - /** ListRevisionsRequest pageToken. */ - public pageToken: string; - - /** ListRevisionsRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListRevisionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListRevisionsRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListRevisionsRequest): google.cloud.run.v2.ListRevisionsRequest; - - /** - * Encodes the specified ListRevisionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. - * @param message ListRevisionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. - * @param message ListRevisionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListRevisionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListRevisionsRequest; - - /** - * Decodes a ListRevisionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListRevisionsRequest; - - /** - * Verifies a ListRevisionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListRevisionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListRevisionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListRevisionsRequest; - - /** - * Creates a plain object from a ListRevisionsRequest message. Also converts values to other types if specified. - * @param message ListRevisionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListRevisionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListRevisionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListRevisionsResponse. */ - interface IListRevisionsResponse { - - /** ListRevisionsResponse revisions */ - revisions?: (google.cloud.run.v2.IRevision[]|null); - - /** ListRevisionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListRevisionsResponse. */ - class ListRevisionsResponse implements IListRevisionsResponse { - - /** - * Constructs a new ListRevisionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListRevisionsResponse); - - /** ListRevisionsResponse revisions. */ - public revisions: google.cloud.run.v2.IRevision[]; - - /** ListRevisionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListRevisionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListRevisionsResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListRevisionsResponse): google.cloud.run.v2.ListRevisionsResponse; - - /** - * Encodes the specified ListRevisionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. - * @param message ListRevisionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. - * @param message ListRevisionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListRevisionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListRevisionsResponse; - - /** - * Decodes a ListRevisionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListRevisionsResponse; - - /** - * Verifies a ListRevisionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListRevisionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListRevisionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListRevisionsResponse; - - /** - * Creates a plain object from a ListRevisionsResponse message. Also converts values to other types if specified. - * @param message ListRevisionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListRevisionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListRevisionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteRevisionRequest. */ - interface IDeleteRevisionRequest { - - /** DeleteRevisionRequest name */ - name?: (string|null); - - /** DeleteRevisionRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteRevisionRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteRevisionRequest. */ - class DeleteRevisionRequest implements IDeleteRevisionRequest { - - /** - * Constructs a new DeleteRevisionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteRevisionRequest); - - /** DeleteRevisionRequest name. */ - public name: string; - - /** DeleteRevisionRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteRevisionRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteRevisionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteRevisionRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteRevisionRequest): google.cloud.run.v2.DeleteRevisionRequest; - - /** - * Encodes the specified DeleteRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. - * @param message DeleteRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IDeleteRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. - * @param message DeleteRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IDeleteRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteRevisionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteRevisionRequest; - - /** - * Decodes a DeleteRevisionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteRevisionRequest; - - /** - * Verifies a DeleteRevisionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteRevisionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteRevisionRequest; - - /** - * Creates a plain object from a DeleteRevisionRequest message. Also converts values to other types if specified. - * @param message DeleteRevisionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.DeleteRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteRevisionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteRevisionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Revision. */ - interface IRevision { - - /** Revision name */ - name?: (string|null); - - /** Revision uid */ - uid?: (string|null); - - /** Revision generation */ - generation?: (number|Long|string|null); - - /** Revision labels */ - labels?: ({ [k: string]: string }|null); - - /** Revision annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Revision createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Revision updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Revision deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Revision expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Revision launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** Revision service */ - service?: (string|null); - - /** Revision scaling */ - scaling?: (google.cloud.run.v2.IRevisionScaling|null); - - /** Revision vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Revision maxInstanceRequestConcurrency */ - maxInstanceRequestConcurrency?: (number|null); - - /** Revision timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** Revision serviceAccount */ - serviceAccount?: (string|null); - - /** Revision containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** Revision volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** Revision executionEnvironment */ - executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); - - /** Revision encryptionKey */ - encryptionKey?: (string|null); - - /** Revision serviceMesh */ - serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** Revision encryptionKeyRevocationAction */ - encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); - - /** Revision encryptionKeyShutdownDuration */ - encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** Revision reconciling */ - reconciling?: (boolean|null); - - /** Revision conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Revision observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Revision logUri */ - logUri?: (string|null); - - /** Revision satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Revision sessionAffinity */ - sessionAffinity?: (boolean|null); - - /** Revision scalingStatus */ - scalingStatus?: (google.cloud.run.v2.IRevisionScalingStatus|null); - - /** Revision nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Revision gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - - /** Revision creator */ - creator?: (string|null); - - /** Revision etag */ - etag?: (string|null); - } - - /** Represents a Revision. */ - class Revision implements IRevision { - - /** - * Constructs a new Revision. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IRevision); - - /** Revision name. */ - public name: string; - - /** Revision uid. */ - public uid: string; - - /** Revision generation. */ - public generation: (number|Long|string); - - /** Revision labels. */ - public labels: { [k: string]: string }; - - /** Revision annotations. */ - public annotations: { [k: string]: string }; - - /** Revision createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Revision updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Revision deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Revision expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Revision launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** Revision service. */ - public service: string; - - /** Revision scaling. */ - public scaling?: (google.cloud.run.v2.IRevisionScaling|null); - - /** Revision vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Revision maxInstanceRequestConcurrency. */ - public maxInstanceRequestConcurrency: number; - - /** Revision timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** Revision serviceAccount. */ - public serviceAccount: string; - - /** Revision containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** Revision volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** Revision executionEnvironment. */ - public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); - - /** Revision encryptionKey. */ - public encryptionKey: string; - - /** Revision serviceMesh. */ - public serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** Revision encryptionKeyRevocationAction. */ - public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); - - /** Revision encryptionKeyShutdownDuration. */ - public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** Revision reconciling. */ - public reconciling: boolean; - - /** Revision conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Revision observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Revision logUri. */ - public logUri: string; - - /** Revision satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Revision sessionAffinity. */ - public sessionAffinity: boolean; - - /** Revision scalingStatus. */ - public scalingStatus?: (google.cloud.run.v2.IRevisionScalingStatus|null); - - /** Revision nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Revision gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** Revision creator. */ - public creator: string; - - /** Revision etag. */ - public etag: string; - - /** - * Creates a new Revision instance using the specified properties. - * @param [properties] Properties to set - * @returns Revision instance - */ - public static create(properties?: google.cloud.run.v2.IRevision): google.cloud.run.v2.Revision; - - /** - * Encodes the specified Revision message. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. - * @param message Revision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. - * @param message Revision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Revision message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Revision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Revision; - - /** - * Decodes a Revision message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Revision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Revision; - - /** - * Verifies a Revision message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Revision message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Revision - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Revision; - - /** - * Creates a plain object from a Revision message. Also converts values to other types if specified. - * @param message Revision - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Revision, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Revision to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Revision - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RevisionScalingStatus. */ - interface IRevisionScalingStatus { - - /** RevisionScalingStatus desiredMinInstanceCount */ - desiredMinInstanceCount?: (number|null); - } - - /** Represents a RevisionScalingStatus. */ - class RevisionScalingStatus implements IRevisionScalingStatus { - - /** - * Constructs a new RevisionScalingStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IRevisionScalingStatus); - - /** RevisionScalingStatus desiredMinInstanceCount. */ - public desiredMinInstanceCount: number; - - /** - * Creates a new RevisionScalingStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns RevisionScalingStatus instance - */ - public static create(properties?: google.cloud.run.v2.IRevisionScalingStatus): google.cloud.run.v2.RevisionScalingStatus; - - /** - * Encodes the specified RevisionScalingStatus message. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. - * @param message RevisionScalingStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IRevisionScalingStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevisionScalingStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. - * @param message RevisionScalingStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IRevisionScalingStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevisionScalingStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevisionScalingStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RevisionScalingStatus; - - /** - * Decodes a RevisionScalingStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevisionScalingStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RevisionScalingStatus; - - /** - * Verifies a RevisionScalingStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RevisionScalingStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevisionScalingStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RevisionScalingStatus; - - /** - * Creates a plain object from a RevisionScalingStatus message. Also converts values to other types if specified. - * @param message RevisionScalingStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RevisionScalingStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevisionScalingStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevisionScalingStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RevisionTemplate. */ - interface IRevisionTemplate { - - /** RevisionTemplate revision */ - revision?: (string|null); - - /** RevisionTemplate labels */ - labels?: ({ [k: string]: string }|null); - - /** RevisionTemplate annotations */ - annotations?: ({ [k: string]: string }|null); - - /** RevisionTemplate scaling */ - scaling?: (google.cloud.run.v2.IRevisionScaling|null); - - /** RevisionTemplate vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** RevisionTemplate timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** RevisionTemplate serviceAccount */ - serviceAccount?: (string|null); - - /** RevisionTemplate containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** RevisionTemplate volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** RevisionTemplate executionEnvironment */ - executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); - - /** RevisionTemplate encryptionKey */ - encryptionKey?: (string|null); - - /** RevisionTemplate maxInstanceRequestConcurrency */ - maxInstanceRequestConcurrency?: (number|null); - - /** RevisionTemplate serviceMesh */ - serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** RevisionTemplate encryptionKeyRevocationAction */ - encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); - - /** RevisionTemplate encryptionKeyShutdownDuration */ - encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** RevisionTemplate sessionAffinity */ - sessionAffinity?: (boolean|null); - - /** RevisionTemplate healthCheckDisabled */ - healthCheckDisabled?: (boolean|null); - - /** RevisionTemplate nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** RevisionTemplate gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - } - - /** Represents a RevisionTemplate. */ - class RevisionTemplate implements IRevisionTemplate { - - /** - * Constructs a new RevisionTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IRevisionTemplate); - - /** RevisionTemplate revision. */ - public revision: string; - - /** RevisionTemplate labels. */ - public labels: { [k: string]: string }; - - /** RevisionTemplate annotations. */ - public annotations: { [k: string]: string }; - - /** RevisionTemplate scaling. */ - public scaling?: (google.cloud.run.v2.IRevisionScaling|null); - - /** RevisionTemplate vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** RevisionTemplate timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** RevisionTemplate serviceAccount. */ - public serviceAccount: string; - - /** RevisionTemplate containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** RevisionTemplate volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** RevisionTemplate executionEnvironment. */ - public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); - - /** RevisionTemplate encryptionKey. */ - public encryptionKey: string; - - /** RevisionTemplate maxInstanceRequestConcurrency. */ - public maxInstanceRequestConcurrency: number; - - /** RevisionTemplate serviceMesh. */ - public serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** RevisionTemplate encryptionKeyRevocationAction. */ - public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); - - /** RevisionTemplate encryptionKeyShutdownDuration. */ - public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** RevisionTemplate sessionAffinity. */ - public sessionAffinity: boolean; - - /** RevisionTemplate healthCheckDisabled. */ - public healthCheckDisabled: boolean; - - /** RevisionTemplate nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** RevisionTemplate gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** - * Creates a new RevisionTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns RevisionTemplate instance - */ - public static create(properties?: google.cloud.run.v2.IRevisionTemplate): google.cloud.run.v2.RevisionTemplate; - - /** - * Encodes the specified RevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. - * @param message RevisionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. - * @param message RevisionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevisionTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.RevisionTemplate; - - /** - * Decodes a RevisionTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.RevisionTemplate; - - /** - * Verifies a RevisionTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RevisionTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevisionTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.RevisionTemplate; - - /** - * Creates a plain object from a RevisionTemplate message. Also converts values to other types if specified. - * @param message RevisionTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.RevisionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevisionTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevisionTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a Services */ - class Services extends $protobuf.rpc.Service { - - /** - * Constructs a new Services 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 Services 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): Services; - - /** - * Calls CreateService. - * @param request CreateServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createService(request: google.cloud.run.v2.ICreateServiceRequest, callback: google.cloud.run.v2.Services.CreateServiceCallback): void; - - /** - * Calls CreateService. - * @param request CreateServiceRequest message or plain object - * @returns Promise - */ - public createService(request: google.cloud.run.v2.ICreateServiceRequest): Promise; - - /** - * Calls GetService. - * @param request GetServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Service - */ - public getService(request: google.cloud.run.v2.IGetServiceRequest, callback: google.cloud.run.v2.Services.GetServiceCallback): void; - - /** - * Calls GetService. - * @param request GetServiceRequest message or plain object - * @returns Promise - */ - public getService(request: google.cloud.run.v2.IGetServiceRequest): Promise; - - /** - * Calls ListServices. - * @param request ListServicesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListServicesResponse - */ - public listServices(request: google.cloud.run.v2.IListServicesRequest, callback: google.cloud.run.v2.Services.ListServicesCallback): void; - - /** - * Calls ListServices. - * @param request ListServicesRequest message or plain object - * @returns Promise - */ - public listServices(request: google.cloud.run.v2.IListServicesRequest): Promise; - - /** - * Calls UpdateService. - * @param request UpdateServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateService(request: google.cloud.run.v2.IUpdateServiceRequest, callback: google.cloud.run.v2.Services.UpdateServiceCallback): void; - - /** - * Calls UpdateService. - * @param request UpdateServiceRequest message or plain object - * @returns Promise - */ - public updateService(request: google.cloud.run.v2.IUpdateServiceRequest): Promise; - - /** - * Calls DeleteService. - * @param request DeleteServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteService(request: google.cloud.run.v2.IDeleteServiceRequest, callback: google.cloud.run.v2.Services.DeleteServiceCallback): void; - - /** - * Calls DeleteService. - * @param request DeleteServiceRequest message or plain object - * @returns Promise - */ - public deleteService(request: google.cloud.run.v2.IDeleteServiceRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.run.v2.Services.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.run.v2.Services.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.run.v2.Services.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace Services { - - /** - * Callback as used by {@link google.cloud.run.v2.Services|createService}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|getService}. - * @param error Error, if any - * @param [response] Service - */ - type GetServiceCallback = (error: (Error|null), response?: google.cloud.run.v2.Service) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|listServices}. - * @param error Error, if any - * @param [response] ListServicesResponse - */ - type ListServicesCallback = (error: (Error|null), response?: google.cloud.run.v2.ListServicesResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|updateService}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|deleteService}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a CreateServiceRequest. */ - interface ICreateServiceRequest { - - /** CreateServiceRequest parent */ - parent?: (string|null); - - /** CreateServiceRequest service */ - service?: (google.cloud.run.v2.IService|null); - - /** CreateServiceRequest serviceId */ - serviceId?: (string|null); - - /** CreateServiceRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateServiceRequest. */ - class CreateServiceRequest implements ICreateServiceRequest { - - /** - * Constructs a new CreateServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICreateServiceRequest); - - /** CreateServiceRequest parent. */ - public parent: string; - - /** CreateServiceRequest service. */ - public service?: (google.cloud.run.v2.IService|null); - - /** CreateServiceRequest serviceId. */ - public serviceId: string; - - /** CreateServiceRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateServiceRequest instance - */ - public static create(properties?: google.cloud.run.v2.ICreateServiceRequest): google.cloud.run.v2.CreateServiceRequest; - - /** - * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. - * @param message CreateServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. - * @param message CreateServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateServiceRequest; - - /** - * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateServiceRequest; - - /** - * Verifies a CreateServiceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateServiceRequest; - - /** - * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. - * @param message CreateServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.CreateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateServiceRequest. */ - interface IUpdateServiceRequest { - - /** UpdateServiceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateServiceRequest service */ - service?: (google.cloud.run.v2.IService|null); - - /** UpdateServiceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateServiceRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateServiceRequest. */ - class UpdateServiceRequest implements IUpdateServiceRequest { - - /** - * Constructs a new UpdateServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IUpdateServiceRequest); - - /** UpdateServiceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateServiceRequest service. */ - public service?: (google.cloud.run.v2.IService|null); - - /** UpdateServiceRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateServiceRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateServiceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IUpdateServiceRequest): google.cloud.run.v2.UpdateServiceRequest; - - /** - * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. - * @param message UpdateServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. - * @param message UpdateServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.UpdateServiceRequest; - - /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.UpdateServiceRequest; - - /** - * Verifies an UpdateServiceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.UpdateServiceRequest; - - /** - * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. - * @param message UpdateServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.UpdateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListServicesRequest. */ - interface IListServicesRequest { - - /** ListServicesRequest parent */ - parent?: (string|null); - - /** ListServicesRequest pageSize */ - pageSize?: (number|null); - - /** ListServicesRequest pageToken */ - pageToken?: (string|null); - - /** ListServicesRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListServicesRequest. */ - class ListServicesRequest implements IListServicesRequest { - - /** - * Constructs a new ListServicesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListServicesRequest); - - /** ListServicesRequest parent. */ - public parent: string; - - /** ListServicesRequest pageSize. */ - public pageSize: number; - - /** ListServicesRequest pageToken. */ - public pageToken: string; - - /** ListServicesRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListServicesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListServicesRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListServicesRequest): google.cloud.run.v2.ListServicesRequest; - - /** - * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. - * @param message ListServicesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. - * @param message ListServicesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListServicesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListServicesRequest; - - /** - * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListServicesRequest; - - /** - * Verifies a ListServicesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListServicesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListServicesRequest; - - /** - * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. - * @param message ListServicesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListServicesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListServicesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListServicesResponse. */ - interface IListServicesResponse { - - /** ListServicesResponse services */ - services?: (google.cloud.run.v2.IService[]|null); - - /** ListServicesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListServicesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListServicesResponse. */ - class ListServicesResponse implements IListServicesResponse { - - /** - * Constructs a new ListServicesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListServicesResponse); - - /** ListServicesResponse services. */ - public services: google.cloud.run.v2.IService[]; - - /** ListServicesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListServicesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListServicesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListServicesResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListServicesResponse): google.cloud.run.v2.ListServicesResponse; - - /** - * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. - * @param message ListServicesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. - * @param message ListServicesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListServicesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListServicesResponse; - - /** - * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListServicesResponse; - - /** - * Verifies a ListServicesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListServicesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListServicesResponse; - - /** - * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. - * @param message ListServicesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListServicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListServicesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListServicesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetServiceRequest. */ - interface IGetServiceRequest { - - /** GetServiceRequest name */ - name?: (string|null); - } - - /** Represents a GetServiceRequest. */ - class GetServiceRequest implements IGetServiceRequest { - - /** - * Constructs a new GetServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGetServiceRequest); - - /** GetServiceRequest name. */ - public name: string; - - /** - * Creates a new GetServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetServiceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IGetServiceRequest): google.cloud.run.v2.GetServiceRequest; - - /** - * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. - * @param message GetServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. - * @param message GetServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetServiceRequest; - - /** - * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetServiceRequest; - - /** - * Verifies a GetServiceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetServiceRequest; - - /** - * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. - * @param message GetServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GetServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteServiceRequest. */ - interface IDeleteServiceRequest { - - /** DeleteServiceRequest name */ - name?: (string|null); - - /** DeleteServiceRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteServiceRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteServiceRequest. */ - class DeleteServiceRequest implements IDeleteServiceRequest { - - /** - * Constructs a new DeleteServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteServiceRequest); - - /** DeleteServiceRequest name. */ - public name: string; - - /** DeleteServiceRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteServiceRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteServiceRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteServiceRequest): google.cloud.run.v2.DeleteServiceRequest; - - /** - * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. - * @param message DeleteServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. - * @param message DeleteServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteServiceRequest; - - /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteServiceRequest; - - /** - * Verifies a DeleteServiceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteServiceRequest; - - /** - * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. - * @param message DeleteServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.DeleteServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Service. */ - interface IService { - - /** Service name */ - name?: (string|null); - - /** Service description */ - description?: (string|null); - - /** Service uid */ - uid?: (string|null); - - /** Service generation */ - generation?: (number|Long|string|null); - - /** Service labels */ - labels?: ({ [k: string]: string }|null); - - /** Service annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Service createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Service updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Service deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Service expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Service creator */ - creator?: (string|null); - - /** Service lastModifier */ - lastModifier?: (string|null); - - /** Service client */ - client?: (string|null); - - /** Service clientVersion */ - clientVersion?: (string|null); - - /** Service ingress */ - ingress?: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic|null); - - /** Service launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** Service binaryAuthorization */ - binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Service template */ - template?: (google.cloud.run.v2.IRevisionTemplate|null); - - /** Service traffic */ - traffic?: (google.cloud.run.v2.ITrafficTarget[]|null); - - /** Service scaling */ - scaling?: (google.cloud.run.v2.IServiceScaling|null); - - /** Service invokerIamDisabled */ - invokerIamDisabled?: (boolean|null); - - /** Service defaultUriDisabled */ - defaultUriDisabled?: (boolean|null); - - /** Service urls */ - urls?: (string[]|null); - - /** Service iapEnabled */ - iapEnabled?: (boolean|null); - - /** Service multiRegionSettings */ - multiRegionSettings?: (google.cloud.run.v2.Service.IMultiRegionSettings|null); - - /** Service customAudiences */ - customAudiences?: (string[]|null); - - /** Service observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Service terminalCondition */ - terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Service conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Service latestReadyRevision */ - latestReadyRevision?: (string|null); - - /** Service latestCreatedRevision */ - latestCreatedRevision?: (string|null); - - /** Service trafficStatuses */ - trafficStatuses?: (google.cloud.run.v2.ITrafficTargetStatus[]|null); - - /** Service uri */ - uri?: (string|null); - - /** Service satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Service threatDetectionEnabled */ - threatDetectionEnabled?: (boolean|null); - - /** Service buildConfig */ - buildConfig?: (google.cloud.run.v2.IBuildConfig|null); - - /** Service reconciling */ - reconciling?: (boolean|null); - - /** Service etag */ - etag?: (string|null); - } - - /** Represents a Service. */ - class Service implements IService { - - /** - * Constructs a new Service. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IService); - - /** Service name. */ - public name: string; - - /** Service description. */ - public description: string; - - /** Service uid. */ - public uid: string; - - /** Service generation. */ - public generation: (number|Long|string); - - /** Service labels. */ - public labels: { [k: string]: string }; - - /** Service annotations. */ - public annotations: { [k: string]: string }; - - /** Service createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Service updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Service deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Service expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Service creator. */ - public creator: string; - - /** Service lastModifier. */ - public lastModifier: string; - - /** Service client. */ - public client: string; - - /** Service clientVersion. */ - public clientVersion: string; - - /** Service ingress. */ - public ingress: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic); - - /** Service launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** Service binaryAuthorization. */ - public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** Service template. */ - public template?: (google.cloud.run.v2.IRevisionTemplate|null); - - /** Service traffic. */ - public traffic: google.cloud.run.v2.ITrafficTarget[]; - - /** Service scaling. */ - public scaling?: (google.cloud.run.v2.IServiceScaling|null); - - /** Service invokerIamDisabled. */ - public invokerIamDisabled: boolean; - - /** Service defaultUriDisabled. */ - public defaultUriDisabled: boolean; - - /** Service urls. */ - public urls: string[]; - - /** Service iapEnabled. */ - public iapEnabled: boolean; - - /** Service multiRegionSettings. */ - public multiRegionSettings?: (google.cloud.run.v2.Service.IMultiRegionSettings|null); - - /** Service customAudiences. */ - public customAudiences: string[]; - - /** Service observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Service terminalCondition. */ - public terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** Service conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Service latestReadyRevision. */ - public latestReadyRevision: string; - - /** Service latestCreatedRevision. */ - public latestCreatedRevision: string; - - /** Service trafficStatuses. */ - public trafficStatuses: google.cloud.run.v2.ITrafficTargetStatus[]; - - /** Service uri. */ - public uri: string; - - /** Service satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Service threatDetectionEnabled. */ - public threatDetectionEnabled: boolean; - - /** Service buildConfig. */ - public buildConfig?: (google.cloud.run.v2.IBuildConfig|null); - - /** Service reconciling. */ - public reconciling: boolean; - - /** Service etag. */ - public etag: string; - - /** - * Creates a new Service instance using the specified properties. - * @param [properties] Properties to set - * @returns Service instance - */ - public static create(properties?: google.cloud.run.v2.IService): google.cloud.run.v2.Service; - - /** - * Encodes the specified Service message. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. - * @param message Service message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Service message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. - * @param message Service message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Service message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Service - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Service; - - /** - * Decodes a Service message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Service - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Service; - - /** - * Verifies a Service message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Service message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Service - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Service; - - /** - * Creates a plain object from a Service message. Also converts values to other types if specified. - * @param message Service - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Service, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Service to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Service - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Service { - - /** Properties of a MultiRegionSettings. */ - interface IMultiRegionSettings { - - /** MultiRegionSettings regions */ - regions?: (string[]|null); - - /** MultiRegionSettings multiRegionId */ - multiRegionId?: (string|null); - } - - /** Represents a MultiRegionSettings. */ - class MultiRegionSettings implements IMultiRegionSettings { - - /** - * Constructs a new MultiRegionSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.Service.IMultiRegionSettings); - - /** MultiRegionSettings regions. */ - public regions: string[]; - - /** MultiRegionSettings multiRegionId. */ - public multiRegionId: string; - - /** - * Creates a new MultiRegionSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MultiRegionSettings instance - */ - public static create(properties?: google.cloud.run.v2.Service.IMultiRegionSettings): google.cloud.run.v2.Service.MultiRegionSettings; - - /** - * Encodes the specified MultiRegionSettings message. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. - * @param message MultiRegionSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.Service.IMultiRegionSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MultiRegionSettings message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. - * @param message MultiRegionSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.Service.IMultiRegionSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MultiRegionSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MultiRegionSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Service.MultiRegionSettings; - - /** - * Decodes a MultiRegionSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MultiRegionSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Service.MultiRegionSettings; - - /** - * Verifies a MultiRegionSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MultiRegionSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MultiRegionSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Service.MultiRegionSettings; - - /** - * Creates a plain object from a MultiRegionSettings message. Also converts values to other types if specified. - * @param message MultiRegionSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.Service.MultiRegionSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MultiRegionSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MultiRegionSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TrafficTarget. */ - interface ITrafficTarget { - - /** TrafficTarget type */ - type?: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType|null); - - /** TrafficTarget revision */ - revision?: (string|null); - - /** TrafficTarget percent */ - percent?: (number|null); - - /** TrafficTarget tag */ - tag?: (string|null); - } - - /** Represents a TrafficTarget. */ - class TrafficTarget implements ITrafficTarget { - - /** - * Constructs a new TrafficTarget. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITrafficTarget); - - /** TrafficTarget type. */ - public type: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType); - - /** TrafficTarget revision. */ - public revision: string; - - /** TrafficTarget percent. */ - public percent: number; - - /** TrafficTarget tag. */ - public tag: string; - - /** - * Creates a new TrafficTarget instance using the specified properties. - * @param [properties] Properties to set - * @returns TrafficTarget instance - */ - public static create(properties?: google.cloud.run.v2.ITrafficTarget): google.cloud.run.v2.TrafficTarget; - - /** - * Encodes the specified TrafficTarget message. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. - * @param message TrafficTarget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ITrafficTarget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrafficTarget message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. - * @param message TrafficTarget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ITrafficTarget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrafficTarget message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrafficTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TrafficTarget; - - /** - * Decodes a TrafficTarget message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrafficTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TrafficTarget; - - /** - * Verifies a TrafficTarget message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrafficTarget message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrafficTarget - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TrafficTarget; - - /** - * Creates a plain object from a TrafficTarget message. Also converts values to other types if specified. - * @param message TrafficTarget - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.TrafficTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrafficTarget to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrafficTarget - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TrafficTargetStatus. */ - interface ITrafficTargetStatus { - - /** TrafficTargetStatus type */ - type?: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType|null); - - /** TrafficTargetStatus revision */ - revision?: (string|null); - - /** TrafficTargetStatus percent */ - percent?: (number|null); - - /** TrafficTargetStatus tag */ - tag?: (string|null); - - /** TrafficTargetStatus uri */ - uri?: (string|null); - } - - /** Represents a TrafficTargetStatus. */ - class TrafficTargetStatus implements ITrafficTargetStatus { - - /** - * Constructs a new TrafficTargetStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITrafficTargetStatus); - - /** TrafficTargetStatus type. */ - public type: (google.cloud.run.v2.TrafficTargetAllocationType|keyof typeof google.cloud.run.v2.TrafficTargetAllocationType); - - /** TrafficTargetStatus revision. */ - public revision: string; - - /** TrafficTargetStatus percent. */ - public percent: number; - - /** TrafficTargetStatus tag. */ - public tag: string; - - /** TrafficTargetStatus uri. */ - public uri: string; - - /** - * Creates a new TrafficTargetStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TrafficTargetStatus instance - */ - public static create(properties?: google.cloud.run.v2.ITrafficTargetStatus): google.cloud.run.v2.TrafficTargetStatus; - - /** - * Encodes the specified TrafficTargetStatus message. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. - * @param message TrafficTargetStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ITrafficTargetStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrafficTargetStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. - * @param message TrafficTargetStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ITrafficTargetStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrafficTargetStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrafficTargetStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TrafficTargetStatus; - - /** - * Decodes a TrafficTargetStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrafficTargetStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TrafficTargetStatus; - - /** - * Verifies a TrafficTargetStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrafficTargetStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrafficTargetStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TrafficTargetStatus; - - /** - * Creates a plain object from a TrafficTargetStatus message. Also converts values to other types if specified. - * @param message TrafficTargetStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.TrafficTargetStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrafficTargetStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrafficTargetStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** TrafficTargetAllocationType enum. */ - enum TrafficTargetAllocationType { - TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0, - TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1, - TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2 - } - - /** Represents a Tasks */ - class Tasks extends $protobuf.rpc.Service { - - /** - * Constructs a new Tasks 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 Tasks 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): Tasks; - - /** - * 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.run.v2.IGetTaskRequest, callback: google.cloud.run.v2.Tasks.GetTaskCallback): void; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @returns Promise - */ - public getTask(request: google.cloud.run.v2.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.run.v2.IListTasksRequest, callback: google.cloud.run.v2.Tasks.ListTasksCallback): void; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @returns Promise - */ - public listTasks(request: google.cloud.run.v2.IListTasksRequest): Promise; - } - - namespace Tasks { - - /** - * Callback as used by {@link google.cloud.run.v2.Tasks|getTask}. - * @param error Error, if any - * @param [response] Task - */ - type GetTaskCallback = (error: (Error|null), response?: google.cloud.run.v2.Task) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.Tasks|listTasks}. - * @param error Error, if any - * @param [response] ListTasksResponse - */ - type ListTasksCallback = (error: (Error|null), response?: google.cloud.run.v2.ListTasksResponse) => void; - } - - /** 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.run.v2.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.run.v2.IGetTaskRequest): google.cloud.run.v2.GetTaskRequest; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 ListTasksRequest. */ - interface IListTasksRequest { - - /** ListTasksRequest parent */ - parent?: (string|null); - - /** ListTasksRequest pageSize */ - pageSize?: (number|null); - - /** ListTasksRequest pageToken */ - pageToken?: (string|null); - - /** ListTasksRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListTasksRequest. */ - class ListTasksRequest implements IListTasksRequest { - - /** - * Constructs a new ListTasksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListTasksRequest); - - /** ListTasksRequest parent. */ - public parent: string; - - /** ListTasksRequest pageSize. */ - public pageSize: number; - - /** ListTasksRequest pageToken. */ - public pageToken: string; - - /** ListTasksRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListTasksRequest): google.cloud.run.v2.ListTasksRequest; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.ITask[]|null); - - /** ListTasksResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTasksResponse. */ - class ListTasksResponse implements IListTasksResponse { - - /** - * Constructs a new ListTasksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListTasksResponse); - - /** ListTasksResponse tasks. */ - public tasks: google.cloud.run.v2.ITask[]; - - /** ListTasksResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListTasksResponse): google.cloud.run.v2.ListTasksResponse; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 Task. */ - interface ITask { - - /** Task name */ - name?: (string|null); - - /** Task uid */ - uid?: (string|null); - - /** Task generation */ - generation?: (number|Long|string|null); - - /** Task labels */ - labels?: ({ [k: string]: string }|null); - - /** Task annotations */ - annotations?: ({ [k: string]: string }|null); - - /** Task createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Task scheduledTime */ - scheduledTime?: (google.protobuf.ITimestamp|null); - - /** Task startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Task completionTime */ - completionTime?: (google.protobuf.ITimestamp|null); - - /** Task updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Task deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Task expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Task job */ - job?: (string|null); - - /** Task execution */ - execution?: (string|null); - - /** Task containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** Task volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** Task maxRetries */ - maxRetries?: (number|null); - - /** Task timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** Task serviceAccount */ - serviceAccount?: (string|null); - - /** Task executionEnvironment */ - executionEnvironment?: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment|null); - - /** Task reconciling */ - reconciling?: (boolean|null); - - /** Task conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** Task observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** Task index */ - index?: (number|null); - - /** Task retried */ - retried?: (number|null); - - /** Task lastAttemptResult */ - lastAttemptResult?: (google.cloud.run.v2.ITaskAttemptResult|null); - - /** Task encryptionKey */ - encryptionKey?: (string|null); - - /** Task vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Task logUri */ - logUri?: (string|null); - - /** Task satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Task nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Task gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - - /** Task etag */ - etag?: (string|null); - } - - /** Represents a Task. */ - class Task implements ITask { - - /** - * Constructs a new Task. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITask); - - /** Task name. */ - public name: string; - - /** Task uid. */ - public uid: string; - - /** Task generation. */ - public generation: (number|Long|string); - - /** Task labels. */ - public labels: { [k: string]: string }; - - /** Task annotations. */ - public annotations: { [k: string]: string }; - - /** Task createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Task scheduledTime. */ - public scheduledTime?: (google.protobuf.ITimestamp|null); - - /** Task startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Task completionTime. */ - public completionTime?: (google.protobuf.ITimestamp|null); - - /** Task updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Task deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Task expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Task job. */ - public job: string; - - /** Task execution. */ - public execution: string; - - /** Task containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** Task volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** Task maxRetries. */ - public maxRetries: number; - - /** Task timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** Task serviceAccount. */ - public serviceAccount: string; - - /** Task executionEnvironment. */ - public executionEnvironment: (google.cloud.run.v2.ExecutionEnvironment|keyof typeof google.cloud.run.v2.ExecutionEnvironment); - - /** Task reconciling. */ - public reconciling: boolean; - - /** Task conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** Task observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** Task index. */ - public index: number; - - /** Task retried. */ - public retried: number; - - /** Task lastAttemptResult. */ - public lastAttemptResult?: (google.cloud.run.v2.ITaskAttemptResult|null); - - /** Task encryptionKey. */ - public encryptionKey: string; - - /** Task vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** Task logUri. */ - public logUri: string; - - /** Task satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Task nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** Task gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** Task etag. */ - public etag: string; - - /** - * Creates a new Task instance using the specified properties. - * @param [properties] Properties to set - * @returns Task instance - */ - public static create(properties?: google.cloud.run.v2.ITask): google.cloud.run.v2.Task; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.run.v2.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.run.v2.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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.run.v2.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 a TaskAttemptResult. */ - interface ITaskAttemptResult { - - /** TaskAttemptResult status */ - status?: (google.rpc.IStatus|null); - - /** TaskAttemptResult exitCode */ - exitCode?: (number|null); - - /** TaskAttemptResult termSignal */ - termSignal?: (number|null); - } - - /** Represents a TaskAttemptResult. */ - class TaskAttemptResult implements ITaskAttemptResult { - - /** - * Constructs a new TaskAttemptResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ITaskAttemptResult); - - /** TaskAttemptResult status. */ - public status?: (google.rpc.IStatus|null); - - /** TaskAttemptResult exitCode. */ - public exitCode: number; - - /** TaskAttemptResult termSignal. */ - public termSignal: number; - - /** - * Creates a new TaskAttemptResult instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskAttemptResult instance - */ - public static create(properties?: google.cloud.run.v2.ITaskAttemptResult): google.cloud.run.v2.TaskAttemptResult; - - /** - * Encodes the specified TaskAttemptResult message. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. - * @param message TaskAttemptResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ITaskAttemptResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskAttemptResult message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. - * @param message TaskAttemptResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ITaskAttemptResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskAttemptResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskAttemptResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.TaskAttemptResult; - - /** - * Decodes a TaskAttemptResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskAttemptResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.TaskAttemptResult; - - /** - * Verifies a TaskAttemptResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskAttemptResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskAttemptResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.TaskAttemptResult; - - /** - * Creates a plain object from a TaskAttemptResult message. Also converts values to other types if specified. - * @param message TaskAttemptResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.TaskAttemptResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskAttemptResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskAttemptResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a WorkerPools */ - class WorkerPools extends $protobuf.rpc.Service { - - /** - * Constructs a new WorkerPools 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 WorkerPools 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): WorkerPools; - - /** - * Calls CreateWorkerPool. - * @param request CreateWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createWorkerPool(request: google.cloud.run.v2.ICreateWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.CreateWorkerPoolCallback): void; - - /** - * Calls CreateWorkerPool. - * @param request CreateWorkerPoolRequest message or plain object - * @returns Promise - */ - public createWorkerPool(request: google.cloud.run.v2.ICreateWorkerPoolRequest): Promise; - - /** - * Calls GetWorkerPool. - * @param request GetWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WorkerPool - */ - public getWorkerPool(request: google.cloud.run.v2.IGetWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.GetWorkerPoolCallback): void; - - /** - * Calls GetWorkerPool. - * @param request GetWorkerPoolRequest message or plain object - * @returns Promise - */ - public getWorkerPool(request: google.cloud.run.v2.IGetWorkerPoolRequest): Promise; - - /** - * Calls ListWorkerPools. - * @param request ListWorkerPoolsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListWorkerPoolsResponse - */ - public listWorkerPools(request: google.cloud.run.v2.IListWorkerPoolsRequest, callback: google.cloud.run.v2.WorkerPools.ListWorkerPoolsCallback): void; - - /** - * Calls ListWorkerPools. - * @param request ListWorkerPoolsRequest message or plain object - * @returns Promise - */ - public listWorkerPools(request: google.cloud.run.v2.IListWorkerPoolsRequest): Promise; - - /** - * Calls UpdateWorkerPool. - * @param request UpdateWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateWorkerPool(request: google.cloud.run.v2.IUpdateWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.UpdateWorkerPoolCallback): void; - - /** - * Calls UpdateWorkerPool. - * @param request UpdateWorkerPoolRequest message or plain object - * @returns Promise - */ - public updateWorkerPool(request: google.cloud.run.v2.IUpdateWorkerPoolRequest): Promise; - - /** - * Calls DeleteWorkerPool. - * @param request DeleteWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteWorkerPool(request: google.cloud.run.v2.IDeleteWorkerPoolRequest, callback: google.cloud.run.v2.WorkerPools.DeleteWorkerPoolCallback): void; - - /** - * Calls DeleteWorkerPool. - * @param request DeleteWorkerPoolRequest message or plain object - * @returns Promise - */ - public deleteWorkerPool(request: google.cloud.run.v2.IDeleteWorkerPoolRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.run.v2.WorkerPools.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.run.v2.WorkerPools.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.run.v2.WorkerPools.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace WorkerPools { - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|createWorkerPool}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|getWorkerPool}. - * @param error Error, if any - * @param [response] WorkerPool - */ - type GetWorkerPoolCallback = (error: (Error|null), response?: google.cloud.run.v2.WorkerPool) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|listWorkerPools}. - * @param error Error, if any - * @param [response] ListWorkerPoolsResponse - */ - type ListWorkerPoolsCallback = (error: (Error|null), response?: google.cloud.run.v2.ListWorkerPoolsResponse) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|updateWorkerPool}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|deleteWorkerPool}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a CreateWorkerPoolRequest. */ - interface ICreateWorkerPoolRequest { - - /** CreateWorkerPoolRequest parent */ - parent?: (string|null); - - /** CreateWorkerPoolRequest workerPool */ - workerPool?: (google.cloud.run.v2.IWorkerPool|null); - - /** CreateWorkerPoolRequest workerPoolId */ - workerPoolId?: (string|null); - - /** CreateWorkerPoolRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateWorkerPoolRequest. */ - class CreateWorkerPoolRequest implements ICreateWorkerPoolRequest { - - /** - * Constructs a new CreateWorkerPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.ICreateWorkerPoolRequest); - - /** CreateWorkerPoolRequest parent. */ - public parent: string; - - /** CreateWorkerPoolRequest workerPool. */ - public workerPool?: (google.cloud.run.v2.IWorkerPool|null); - - /** CreateWorkerPoolRequest workerPoolId. */ - public workerPoolId: string; - - /** CreateWorkerPoolRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateWorkerPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateWorkerPoolRequest instance - */ - public static create(properties?: google.cloud.run.v2.ICreateWorkerPoolRequest): google.cloud.run.v2.CreateWorkerPoolRequest; - - /** - * Encodes the specified CreateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. - * @param message CreateWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.ICreateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. - * @param message CreateWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.ICreateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateWorkerPoolRequest; - - /** - * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateWorkerPoolRequest; - - /** - * Verifies a CreateWorkerPoolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateWorkerPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateWorkerPoolRequest; - - /** - * Creates a plain object from a CreateWorkerPoolRequest message. Also converts values to other types if specified. - * @param message CreateWorkerPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.CreateWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateWorkerPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateWorkerPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateWorkerPoolRequest. */ - interface IUpdateWorkerPoolRequest { - - /** UpdateWorkerPoolRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateWorkerPoolRequest workerPool */ - workerPool?: (google.cloud.run.v2.IWorkerPool|null); - - /** UpdateWorkerPoolRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateWorkerPoolRequest allowMissing */ - allowMissing?: (boolean|null); - - /** UpdateWorkerPoolRequest forceNewRevision */ - forceNewRevision?: (boolean|null); - } - - /** Represents an UpdateWorkerPoolRequest. */ - class UpdateWorkerPoolRequest implements IUpdateWorkerPoolRequest { - - /** - * Constructs a new UpdateWorkerPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IUpdateWorkerPoolRequest); - - /** UpdateWorkerPoolRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateWorkerPoolRequest workerPool. */ - public workerPool?: (google.cloud.run.v2.IWorkerPool|null); - - /** UpdateWorkerPoolRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateWorkerPoolRequest allowMissing. */ - public allowMissing: boolean; - - /** UpdateWorkerPoolRequest forceNewRevision. */ - public forceNewRevision: boolean; - - /** - * Creates a new UpdateWorkerPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateWorkerPoolRequest instance - */ - public static create(properties?: google.cloud.run.v2.IUpdateWorkerPoolRequest): google.cloud.run.v2.UpdateWorkerPoolRequest; - - /** - * Encodes the specified UpdateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. - * @param message UpdateWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IUpdateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. - * @param message UpdateWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IUpdateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.UpdateWorkerPoolRequest; - - /** - * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.UpdateWorkerPoolRequest; - - /** - * Verifies an UpdateWorkerPoolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateWorkerPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.UpdateWorkerPoolRequest; - - /** - * Creates a plain object from an UpdateWorkerPoolRequest message. Also converts values to other types if specified. - * @param message UpdateWorkerPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.UpdateWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateWorkerPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateWorkerPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListWorkerPoolsRequest. */ - interface IListWorkerPoolsRequest { - - /** ListWorkerPoolsRequest parent */ - parent?: (string|null); - - /** ListWorkerPoolsRequest pageSize */ - pageSize?: (number|null); - - /** ListWorkerPoolsRequest pageToken */ - pageToken?: (string|null); - - /** ListWorkerPoolsRequest showDeleted */ - showDeleted?: (boolean|null); - } - - /** Represents a ListWorkerPoolsRequest. */ - class ListWorkerPoolsRequest implements IListWorkerPoolsRequest { - - /** - * Constructs a new ListWorkerPoolsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListWorkerPoolsRequest); - - /** ListWorkerPoolsRequest parent. */ - public parent: string; - - /** ListWorkerPoolsRequest pageSize. */ - public pageSize: number; - - /** ListWorkerPoolsRequest pageToken. */ - public pageToken: string; - - /** ListWorkerPoolsRequest showDeleted. */ - public showDeleted: boolean; - - /** - * Creates a new ListWorkerPoolsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListWorkerPoolsRequest instance - */ - public static create(properties?: google.cloud.run.v2.IListWorkerPoolsRequest): google.cloud.run.v2.ListWorkerPoolsRequest; - - /** - * Encodes the specified ListWorkerPoolsRequest message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. - * @param message ListWorkerPoolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListWorkerPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListWorkerPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. - * @param message ListWorkerPoolsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListWorkerPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListWorkerPoolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListWorkerPoolsRequest; - - /** - * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListWorkerPoolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListWorkerPoolsRequest; - - /** - * Verifies a ListWorkerPoolsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListWorkerPoolsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListWorkerPoolsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListWorkerPoolsRequest; - - /** - * Creates a plain object from a ListWorkerPoolsRequest message. Also converts values to other types if specified. - * @param message ListWorkerPoolsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListWorkerPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListWorkerPoolsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListWorkerPoolsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListWorkerPoolsResponse. */ - interface IListWorkerPoolsResponse { - - /** ListWorkerPoolsResponse workerPools */ - workerPools?: (google.cloud.run.v2.IWorkerPool[]|null); - - /** ListWorkerPoolsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListWorkerPoolsResponse. */ - class ListWorkerPoolsResponse implements IListWorkerPoolsResponse { - - /** - * Constructs a new ListWorkerPoolsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IListWorkerPoolsResponse); - - /** ListWorkerPoolsResponse workerPools. */ - public workerPools: google.cloud.run.v2.IWorkerPool[]; - - /** ListWorkerPoolsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListWorkerPoolsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListWorkerPoolsResponse instance - */ - public static create(properties?: google.cloud.run.v2.IListWorkerPoolsResponse): google.cloud.run.v2.ListWorkerPoolsResponse; - - /** - * Encodes the specified ListWorkerPoolsResponse message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. - * @param message ListWorkerPoolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IListWorkerPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListWorkerPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. - * @param message ListWorkerPoolsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IListWorkerPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListWorkerPoolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListWorkerPoolsResponse; - - /** - * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListWorkerPoolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListWorkerPoolsResponse; - - /** - * Verifies a ListWorkerPoolsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListWorkerPoolsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListWorkerPoolsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListWorkerPoolsResponse; - - /** - * Creates a plain object from a ListWorkerPoolsResponse message. Also converts values to other types if specified. - * @param message ListWorkerPoolsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.ListWorkerPoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListWorkerPoolsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListWorkerPoolsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetWorkerPoolRequest. */ - interface IGetWorkerPoolRequest { - - /** GetWorkerPoolRequest name */ - name?: (string|null); - } - - /** Represents a GetWorkerPoolRequest. */ - class GetWorkerPoolRequest implements IGetWorkerPoolRequest { - - /** - * Constructs a new GetWorkerPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IGetWorkerPoolRequest); - - /** GetWorkerPoolRequest name. */ - public name: string; - - /** - * Creates a new GetWorkerPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetWorkerPoolRequest instance - */ - public static create(properties?: google.cloud.run.v2.IGetWorkerPoolRequest): google.cloud.run.v2.GetWorkerPoolRequest; - - /** - * Encodes the specified GetWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. - * @param message GetWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IGetWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. - * @param message GetWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IGetWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetWorkerPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetWorkerPoolRequest; - - /** - * Decodes a GetWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetWorkerPoolRequest; - - /** - * Verifies a GetWorkerPoolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetWorkerPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetWorkerPoolRequest; - - /** - * Creates a plain object from a GetWorkerPoolRequest message. Also converts values to other types if specified. - * @param message GetWorkerPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.GetWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetWorkerPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetWorkerPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteWorkerPoolRequest. */ - interface IDeleteWorkerPoolRequest { - - /** DeleteWorkerPoolRequest name */ - name?: (string|null); - - /** DeleteWorkerPoolRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteWorkerPoolRequest etag */ - etag?: (string|null); - } - - /** Represents a DeleteWorkerPoolRequest. */ - class DeleteWorkerPoolRequest implements IDeleteWorkerPoolRequest { - - /** - * Constructs a new DeleteWorkerPoolRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IDeleteWorkerPoolRequest); - - /** DeleteWorkerPoolRequest name. */ - public name: string; - - /** DeleteWorkerPoolRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteWorkerPoolRequest etag. */ - public etag: string; - - /** - * Creates a new DeleteWorkerPoolRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteWorkerPoolRequest instance - */ - public static create(properties?: google.cloud.run.v2.IDeleteWorkerPoolRequest): google.cloud.run.v2.DeleteWorkerPoolRequest; - - /** - * Encodes the specified DeleteWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. - * @param message DeleteWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IDeleteWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. - * @param message DeleteWorkerPoolRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IDeleteWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteWorkerPoolRequest; - - /** - * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteWorkerPoolRequest; - - /** - * Verifies a DeleteWorkerPoolRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteWorkerPoolRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteWorkerPoolRequest; - - /** - * Creates a plain object from a DeleteWorkerPoolRequest message. Also converts values to other types if specified. - * @param message DeleteWorkerPoolRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.DeleteWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteWorkerPoolRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteWorkerPoolRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WorkerPool. */ - interface IWorkerPool { - - /** WorkerPool name */ - name?: (string|null); - - /** WorkerPool description */ - description?: (string|null); - - /** WorkerPool uid */ - uid?: (string|null); - - /** WorkerPool generation */ - generation?: (number|Long|string|null); - - /** WorkerPool labels */ - labels?: ({ [k: string]: string }|null); - - /** WorkerPool annotations */ - annotations?: ({ [k: string]: string }|null); - - /** WorkerPool createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool creator */ - creator?: (string|null); - - /** WorkerPool lastModifier */ - lastModifier?: (string|null); - - /** WorkerPool client */ - client?: (string|null); - - /** WorkerPool clientVersion */ - clientVersion?: (string|null); - - /** WorkerPool launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** WorkerPool binaryAuthorization */ - binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** WorkerPool template */ - template?: (google.cloud.run.v2.IWorkerPoolRevisionTemplate|null); - - /** WorkerPool instanceSplits */ - instanceSplits?: (google.cloud.run.v2.IInstanceSplit[]|null); - - /** WorkerPool scaling */ - scaling?: (google.cloud.run.v2.IWorkerPoolScaling|null); - - /** WorkerPool observedGeneration */ - observedGeneration?: (number|Long|string|null); - - /** WorkerPool terminalCondition */ - terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** WorkerPool conditions */ - conditions?: (google.cloud.run.v2.ICondition[]|null); - - /** WorkerPool latestReadyRevision */ - latestReadyRevision?: (string|null); - - /** WorkerPool latestCreatedRevision */ - latestCreatedRevision?: (string|null); - - /** WorkerPool instanceSplitStatuses */ - instanceSplitStatuses?: (google.cloud.run.v2.IInstanceSplitStatus[]|null); - - /** WorkerPool threatDetectionEnabled */ - threatDetectionEnabled?: (boolean|null); - - /** WorkerPool customAudiences */ - customAudiences?: (string[]|null); - - /** WorkerPool satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** WorkerPool reconciling */ - reconciling?: (boolean|null); - - /** WorkerPool etag */ - etag?: (string|null); - } - - /** Represents a WorkerPool. */ - class WorkerPool implements IWorkerPool { - - /** - * Constructs a new WorkerPool. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IWorkerPool); - - /** WorkerPool name. */ - public name: string; - - /** WorkerPool description. */ - public description: string; - - /** WorkerPool uid. */ - public uid: string; - - /** WorkerPool generation. */ - public generation: (number|Long|string); - - /** WorkerPool labels. */ - public labels: { [k: string]: string }; - - /** WorkerPool annotations. */ - public annotations: { [k: string]: string }; - - /** WorkerPool createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** WorkerPool creator. */ - public creator: string; - - /** WorkerPool lastModifier. */ - public lastModifier: string; - - /** WorkerPool client. */ - public client: string; - - /** WorkerPool clientVersion. */ - public clientVersion: string; - - /** WorkerPool launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** WorkerPool binaryAuthorization. */ - public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); - - /** WorkerPool template. */ - public template?: (google.cloud.run.v2.IWorkerPoolRevisionTemplate|null); - - /** WorkerPool instanceSplits. */ - public instanceSplits: google.cloud.run.v2.IInstanceSplit[]; - - /** WorkerPool scaling. */ - public scaling?: (google.cloud.run.v2.IWorkerPoolScaling|null); - - /** WorkerPool observedGeneration. */ - public observedGeneration: (number|Long|string); - - /** WorkerPool terminalCondition. */ - public terminalCondition?: (google.cloud.run.v2.ICondition|null); - - /** WorkerPool conditions. */ - public conditions: google.cloud.run.v2.ICondition[]; - - /** WorkerPool latestReadyRevision. */ - public latestReadyRevision: string; - - /** WorkerPool latestCreatedRevision. */ - public latestCreatedRevision: string; - - /** WorkerPool instanceSplitStatuses. */ - public instanceSplitStatuses: google.cloud.run.v2.IInstanceSplitStatus[]; - - /** WorkerPool threatDetectionEnabled. */ - public threatDetectionEnabled: boolean; - - /** WorkerPool customAudiences. */ - public customAudiences: string[]; - - /** WorkerPool satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** WorkerPool reconciling. */ - public reconciling: boolean; - - /** WorkerPool etag. */ - public etag: string; - - /** - * Creates a new WorkerPool instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkerPool instance - */ - public static create(properties?: google.cloud.run.v2.IWorkerPool): google.cloud.run.v2.WorkerPool; - - /** - * Encodes the specified WorkerPool message. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. - * @param message WorkerPool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IWorkerPool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkerPool message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. - * @param message WorkerPool message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IWorkerPool, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkerPool message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkerPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.WorkerPool; - - /** - * Decodes a WorkerPool message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkerPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.WorkerPool; - - /** - * Verifies a WorkerPool message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkerPool message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkerPool - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.WorkerPool; - - /** - * Creates a plain object from a WorkerPool message. Also converts values to other types if specified. - * @param message WorkerPool - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.WorkerPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkerPool to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkerPool - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WorkerPoolRevisionTemplate. */ - interface IWorkerPoolRevisionTemplate { - - /** WorkerPoolRevisionTemplate revision */ - revision?: (string|null); - - /** WorkerPoolRevisionTemplate labels */ - labels?: ({ [k: string]: string }|null); - - /** WorkerPoolRevisionTemplate annotations */ - annotations?: ({ [k: string]: string }|null); - - /** WorkerPoolRevisionTemplate vpcAccess */ - vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** WorkerPoolRevisionTemplate serviceAccount */ - serviceAccount?: (string|null); - - /** WorkerPoolRevisionTemplate containers */ - containers?: (google.cloud.run.v2.IContainer[]|null); - - /** WorkerPoolRevisionTemplate volumes */ - volumes?: (google.cloud.run.v2.IVolume[]|null); - - /** WorkerPoolRevisionTemplate encryptionKey */ - encryptionKey?: (string|null); - - /** WorkerPoolRevisionTemplate serviceMesh */ - serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** WorkerPoolRevisionTemplate encryptionKeyRevocationAction */ - encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); - - /** WorkerPoolRevisionTemplate encryptionKeyShutdownDuration */ - encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** WorkerPoolRevisionTemplate nodeSelector */ - nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled */ - gpuZonalRedundancyDisabled?: (boolean|null); - } - - /** Represents a WorkerPoolRevisionTemplate. */ - class WorkerPoolRevisionTemplate implements IWorkerPoolRevisionTemplate { - - /** - * Constructs a new WorkerPoolRevisionTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.run.v2.IWorkerPoolRevisionTemplate); - - /** WorkerPoolRevisionTemplate revision. */ - public revision: string; - - /** WorkerPoolRevisionTemplate labels. */ - public labels: { [k: string]: string }; - - /** WorkerPoolRevisionTemplate annotations. */ - public annotations: { [k: string]: string }; - - /** WorkerPoolRevisionTemplate vpcAccess. */ - public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); - - /** WorkerPoolRevisionTemplate serviceAccount. */ - public serviceAccount: string; - - /** WorkerPoolRevisionTemplate containers. */ - public containers: google.cloud.run.v2.IContainer[]; - - /** WorkerPoolRevisionTemplate volumes. */ - public volumes: google.cloud.run.v2.IVolume[]; - - /** WorkerPoolRevisionTemplate encryptionKey. */ - public encryptionKey: string; - - /** WorkerPoolRevisionTemplate serviceMesh. */ - public serviceMesh?: (google.cloud.run.v2.IServiceMesh|null); - - /** WorkerPoolRevisionTemplate encryptionKeyRevocationAction. */ - public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); - - /** WorkerPoolRevisionTemplate encryptionKeyShutdownDuration. */ - public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); - - /** WorkerPoolRevisionTemplate nodeSelector. */ - public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); - - /** WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled. */ - public gpuZonalRedundancyDisabled?: (boolean|null); - - /** - * Creates a new WorkerPoolRevisionTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkerPoolRevisionTemplate instance - */ - public static create(properties?: google.cloud.run.v2.IWorkerPoolRevisionTemplate): google.cloud.run.v2.WorkerPoolRevisionTemplate; - - /** - * Encodes the specified WorkerPoolRevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. - * @param message WorkerPoolRevisionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.run.v2.IWorkerPoolRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkerPoolRevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. - * @param message WorkerPoolRevisionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.run.v2.IWorkerPoolRevisionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkerPoolRevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.WorkerPoolRevisionTemplate; - - /** - * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkerPoolRevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.WorkerPoolRevisionTemplate; - - /** - * Verifies a WorkerPoolRevisionTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkerPoolRevisionTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkerPoolRevisionTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.WorkerPoolRevisionTemplate; - - /** - * Creates a plain object from a WorkerPoolRevisionTemplate message. Also converts values to other types if specified. - * @param message WorkerPoolRevisionTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.run.v2.WorkerPoolRevisionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkerPoolRevisionTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkerPoolRevisionTemplate - * @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 ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RoutingRule. */ - interface IRoutingRule { - - /** RoutingRule routingParameters */ - routingParameters?: (google.api.IRoutingParameter[]|null); - } - - /** Represents a RoutingRule. */ - class RoutingRule implements IRoutingRule { - - /** - * Constructs a new RoutingRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRoutingRule); - - /** RoutingRule routingParameters. */ - public routingParameters: google.api.IRoutingParameter[]; - - /** - * Creates a new RoutingRule instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingRule instance - */ - public static create(properties?: google.api.IRoutingRule): google.api.RoutingRule; - - /** - * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @param message RoutingRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @param message RoutingRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RoutingRule; - - /** - * Decodes a RoutingRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RoutingRule; - - /** - * Verifies a RoutingRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingRule - */ - public static fromObject(object: { [k: string]: any }): google.api.RoutingRule; - - /** - * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. - * @param message RoutingRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RoutingRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RoutingParameter. */ - interface IRoutingParameter { - - /** RoutingParameter field */ - field?: (string|null); - - /** RoutingParameter pathTemplate */ - pathTemplate?: (string|null); - } - - /** Represents a RoutingParameter. */ - class RoutingParameter implements IRoutingParameter { - - /** - * Constructs a new RoutingParameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRoutingParameter); - - /** RoutingParameter field. */ - public field: string; - - /** RoutingParameter pathTemplate. */ - public pathTemplate: string; - - /** - * Creates a new RoutingParameter instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingParameter instance - */ - public static create(properties?: google.api.IRoutingParameter): google.api.RoutingParameter; - - /** - * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @param message RoutingParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @param message RoutingParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RoutingParameter; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RoutingParameter; - - /** - * Verifies a RoutingParameter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingParameter - */ - public static fromObject(object: { [k: string]: any }): google.api.RoutingParameter; - - /** - * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. - * @param message RoutingParameter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RoutingParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingParameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingParameter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.api.routing */ - ".google.api.routing"?: (google.api.IRoutingRule|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a 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 longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace iam. */ - namespace iam { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a IAMPolicy */ - class IAMPolicy extends $protobuf.rpc.Service { - - /** - * Constructs a new IAMPolicy service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): IAMPolicy; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace IAMPolicy { - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a SetIamPolicyRequest. */ - interface ISetIamPolicyRequest { - - /** SetIamPolicyRequest resource */ - resource?: (string|null); - - /** SetIamPolicyRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a SetIamPolicyRequest. */ - class SetIamPolicyRequest implements ISetIamPolicyRequest { - - /** - * Constructs a new SetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - - /** SetIamPolicyRequest resource. */ - public resource: string; - - /** SetIamPolicyRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; - - /** - * Verifies a SetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @param message SetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetIamPolicyRequest. */ - interface IGetIamPolicyRequest { - - /** GetIamPolicyRequest resource */ - resource?: (string|null); - - /** GetIamPolicyRequest options */ - options?: (google.iam.v1.IGetPolicyOptions|null); - } - - /** Represents a GetIamPolicyRequest. */ - class GetIamPolicyRequest implements IGetIamPolicyRequest { - - /** - * Constructs a new GetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetIamPolicyRequest); - - /** GetIamPolicyRequest resource. */ - public resource: string; - - /** GetIamPolicyRequest options. */ - public options?: (google.iam.v1.IGetPolicyOptions|null); - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; - - /** - * Verifies a GetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @param message GetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsRequest. */ - interface ITestIamPermissionsRequest { - - /** TestIamPermissionsRequest resource */ - resource?: (string|null); - - /** TestIamPermissionsRequest permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsRequest. */ - class TestIamPermissionsRequest implements ITestIamPermissionsRequest { - - /** - * Constructs a new TestIamPermissionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); - - /** TestIamPermissionsRequest resource. */ - public resource: string; - - /** TestIamPermissionsRequest permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsRequest instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; - - /** - * Verifies a TestIamPermissionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @param message TestIamPermissionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsResponse. */ - interface ITestIamPermissionsResponse { - - /** TestIamPermissionsResponse permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsResponse. */ - class TestIamPermissionsResponse implements ITestIamPermissionsResponse { - - /** - * Constructs a new TestIamPermissionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); - - /** TestIamPermissionsResponse permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsResponse instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; - - /** - * Verifies a TestIamPermissionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @param message TestIamPermissionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetPolicyOptions. */ - interface IGetPolicyOptions { - - /** GetPolicyOptions requestedPolicyVersion */ - requestedPolicyVersion?: (number|null); - } - - /** Represents a GetPolicyOptions. */ - class GetPolicyOptions implements IGetPolicyOptions { - - /** - * Constructs a new GetPolicyOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetPolicyOptions); - - /** GetPolicyOptions requestedPolicyVersion. */ - public requestedPolicyVersion: number; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns GetPolicyOptions instance - */ - public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; - - /** - * Verifies a GetPolicyOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetPolicyOptions - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @param message GetPolicyOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetPolicyOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetPolicyOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Policy. */ - interface IPolicy { - - /** Policy version */ - version?: (number|null); - - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); - - /** Policy auditConfigs */ - auditConfigs?: (google.iam.v1.IAuditConfig[]|null); - - /** Policy etag */ - etag?: (Uint8Array|Buffer|string|null); - } - - /** Represents a Policy. */ - class Policy implements IPolicy { - - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicy); - - /** Policy version. */ - public version: number; - - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; - - /** Policy auditConfigs. */ - public auditConfigs: google.iam.v1.IAuditConfig[]; - - /** Policy etag. */ - public etag: (Uint8Array|Buffer|string); - - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; - - /** - * Verifies a Policy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Policy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Binding. */ - interface IBinding { - - /** Binding role */ - role?: (string|null); - - /** Binding members */ - members?: (string[]|null); - - /** Binding condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a Binding. */ - class Binding implements IBinding { - - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBinding); - - /** Binding role. */ - public role: string; - - /** Binding members. */ - public members: string[]; - - /** Binding condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new Binding instance using the specified properties. - * @param [properties] Properties to set - * @returns Binding instance - */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; - - /** - * Verifies a Binding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Binding - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Binding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Binding - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditConfig. */ - interface IAuditConfig { - - /** AuditConfig service */ - service?: (string|null); - - /** AuditConfig auditLogConfigs */ - auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); - } - - /** Represents an AuditConfig. */ - class AuditConfig implements IAuditConfig { - - /** - * Constructs a new AuditConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfig); - - /** AuditConfig service. */ - public service: string; - - /** AuditConfig auditLogConfigs. */ - public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfig instance - */ - public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; - - /** - * Verifies an AuditConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @param message AuditConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditLogConfig. */ - interface IAuditLogConfig { - - /** AuditLogConfig logType */ - logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); - - /** AuditLogConfig exemptedMembers */ - exemptedMembers?: (string[]|null); - } - - /** Represents an AuditLogConfig. */ - class AuditLogConfig implements IAuditLogConfig { - - /** - * Constructs a new AuditLogConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditLogConfig); - - /** AuditLogConfig logType. */ - public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); - - /** AuditLogConfig exemptedMembers. */ - public exemptedMembers: string[]; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditLogConfig instance - */ - public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; - - /** - * Verifies an AuditLogConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditLogConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @param message AuditLogConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditLogConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditLogConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditLogConfig { - - /** LogType enum. */ - enum LogType { - LOG_TYPE_UNSPECIFIED = 0, - ADMIN_READ = 1, - DATA_WRITE = 2, - DATA_READ = 3 - } - } - - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { - - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); - - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); - } - - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { - - /** - * Constructs a new PolicyDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicyDelta); - - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; - - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDelta instance - */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; - - /** - * Verifies a PolicyDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolicyDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BindingDelta. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); - - /** BindingDelta role */ - role?: (string|null); - - /** BindingDelta member */ - member?: (string|null); - - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { - - /** - * Constructs a new BindingDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBindingDelta); - - /** BindingDelta action. */ - public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); - - /** BindingDelta role. */ - public role: string; - - /** BindingDelta member. */ - public member: string; - - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new BindingDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns BindingDelta instance - */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; - - /** - * Verifies a BindingDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BindingDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BindingDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BindingDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BindingDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { - - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); - - /** AuditConfigDelta service */ - service?: (string|null); - - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); - - /** AuditConfigDelta logType */ - logType?: (string|null); - } - - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { - - /** - * Constructs a new AuditConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); - - /** AuditConfigDelta action. */ - public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); - - /** AuditConfigDelta service. */ - public service: string; - - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; - - /** AuditConfigDelta logType. */ - public logType: string; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfigDelta instance - */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; - - /** - * Verifies an AuditConfigDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfigDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditConfigDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Expr. */ - interface IExpr { - - /** Expr expression */ - expression?: (string|null); - - /** Expr title */ - title?: (string|null); - - /** Expr description */ - description?: (string|null); - - /** Expr location */ - location?: (string|null); - } - - /** Represents an Expr. */ - class Expr implements IExpr { - - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); - - /** Expr expression. */ - public expression: string; - - /** Expr title. */ - public title: string; - - /** Expr description. */ - public description: string; - - /** Expr location. */ - public location: string; - - /** - * Creates a new Expr instance using the specified properties. - * @param [properties] Properties to set - * @returns Expr instance - */ - public static create(properties?: google.type.IExpr): google.type.Expr; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; - - /** - * Verifies an Expr message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Expr - */ - public static fromObject(object: { [k: string]: any }): google.type.Expr; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @param message Expr - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Expr to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Expr - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-cloud-run/protos/protos.js b/owl-bot-staging/google-cloud-run/protos/protos.js deleted file mode 100644 index c7edd21ba6b..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/protos.js +++ /dev/null @@ -1,61975 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_run_protos || ($protobuf.roots._google_cloud_run_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.run = (function() { - - /** - * Namespace run. - * @memberof google.cloud - * @namespace - */ - var run = {}; - - run.v2 = (function() { - - /** - * Namespace v2. - * @memberof google.cloud.run - * @namespace - */ - var v2 = {}; - - v2.Builds = (function() { - - /** - * Constructs a new Builds service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Builds - * @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 Builds(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Builds.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Builds; - - /** - * Creates new Builds service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Builds - * @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 {Builds} RPC service. Useful where requests and/or responses are streamed. - */ - Builds.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Builds|submitBuild}. - * @memberof google.cloud.run.v2.Builds - * @typedef SubmitBuildCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.SubmitBuildResponse} [response] SubmitBuildResponse - */ - - /** - * Calls SubmitBuild. - * @function submitBuild - * @memberof google.cloud.run.v2.Builds - * @instance - * @param {google.cloud.run.v2.ISubmitBuildRequest} request SubmitBuildRequest message or plain object - * @param {google.cloud.run.v2.Builds.SubmitBuildCallback} callback Node-style callback called with the error, if any, and SubmitBuildResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Builds.prototype.submitBuild = function submitBuild(request, callback) { - return this.rpcCall(submitBuild, $root.google.cloud.run.v2.SubmitBuildRequest, $root.google.cloud.run.v2.SubmitBuildResponse, request, callback); - }, "name", { value: "SubmitBuild" }); - - /** - * Calls SubmitBuild. - * @function submitBuild - * @memberof google.cloud.run.v2.Builds - * @instance - * @param {google.cloud.run.v2.ISubmitBuildRequest} request SubmitBuildRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Builds; - })(); - - v2.SubmitBuildRequest = (function() { - - /** - * Properties of a SubmitBuildRequest. - * @memberof google.cloud.run.v2 - * @interface ISubmitBuildRequest - * @property {string|null} [parent] SubmitBuildRequest parent - * @property {google.cloud.run.v2.IStorageSource|null} [storageSource] SubmitBuildRequest storageSource - * @property {string|null} [imageUri] SubmitBuildRequest imageUri - * @property {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null} [buildpackBuild] SubmitBuildRequest buildpackBuild - * @property {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null} [dockerBuild] SubmitBuildRequest dockerBuild - * @property {string|null} [serviceAccount] SubmitBuildRequest serviceAccount - * @property {string|null} [workerPool] SubmitBuildRequest workerPool - * @property {Array.|null} [tags] SubmitBuildRequest tags - * @property {string|null} [machineType] SubmitBuildRequest machineType - * @property {google.api.LaunchStage|null} [releaseTrack] SubmitBuildRequest releaseTrack - * @property {string|null} [client] SubmitBuildRequest client - */ - - /** - * Constructs a new SubmitBuildRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a SubmitBuildRequest. - * @implements ISubmitBuildRequest - * @constructor - * @param {google.cloud.run.v2.ISubmitBuildRequest=} [properties] Properties to set - */ - function SubmitBuildRequest(properties) { - 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]]; - } - - /** - * SubmitBuildRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.parent = ""; - - /** - * SubmitBuildRequest storageSource. - * @member {google.cloud.run.v2.IStorageSource|null|undefined} storageSource - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.storageSource = null; - - /** - * SubmitBuildRequest imageUri. - * @member {string} imageUri - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.imageUri = ""; - - /** - * SubmitBuildRequest buildpackBuild. - * @member {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild|null|undefined} buildpackBuild - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.buildpackBuild = null; - - /** - * SubmitBuildRequest dockerBuild. - * @member {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild|null|undefined} dockerBuild - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.dockerBuild = null; - - /** - * SubmitBuildRequest serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.serviceAccount = ""; - - /** - * SubmitBuildRequest workerPool. - * @member {string} workerPool - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.workerPool = ""; - - /** - * SubmitBuildRequest tags. - * @member {Array.} tags - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.tags = $util.emptyArray; - - /** - * SubmitBuildRequest machineType. - * @member {string} machineType - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.machineType = ""; - - /** - * SubmitBuildRequest releaseTrack. - * @member {google.api.LaunchStage} releaseTrack - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.releaseTrack = 0; - - /** - * SubmitBuildRequest client. - * @member {string} client - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - SubmitBuildRequest.prototype.client = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SubmitBuildRequest source. - * @member {"storageSource"|undefined} source - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - Object.defineProperty(SubmitBuildRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["storageSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * SubmitBuildRequest buildType. - * @member {"buildpackBuild"|"dockerBuild"|undefined} buildType - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - */ - Object.defineProperty(SubmitBuildRequest.prototype, "buildType", { - get: $util.oneOfGetter($oneOfFields = ["buildpackBuild", "dockerBuild"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SubmitBuildRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {google.cloud.run.v2.ISubmitBuildRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest instance - */ - SubmitBuildRequest.create = function create(properties) { - return new SubmitBuildRequest(properties); - }; - - /** - * Encodes the specified SubmitBuildRequest message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {google.cloud.run.v2.ISubmitBuildRequest} message SubmitBuildRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubmitBuildRequest.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.storageSource != null && Object.hasOwnProperty.call(message, "storageSource")) - $root.google.cloud.run.v2.StorageSource.encode(message.storageSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); - if (message.buildpackBuild != null && Object.hasOwnProperty.call(message, "buildpackBuild")) - $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.encode(message.buildpackBuild, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.dockerBuild != null && Object.hasOwnProperty.call(message, "dockerBuild")) - $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.encode(message.dockerBuild, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceAccount); - if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.workerPool); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.machineType); - if (message.releaseTrack != null && Object.hasOwnProperty.call(message, "releaseTrack")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.releaseTrack); - if (message.client != null && Object.hasOwnProperty.call(message, "client")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.client); - return writer; - }; - - /** - * Encodes the specified SubmitBuildRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {google.cloud.run.v2.ISubmitBuildRequest} message SubmitBuildRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubmitBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubmitBuildRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubmitBuildRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.storageSource = $root.google.cloud.run.v2.StorageSource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.imageUri = reader.string(); - break; - } - case 4: { - message.buildpackBuild = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.decode(reader, reader.uint32()); - break; - } - case 5: { - message.dockerBuild = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.decode(reader, reader.uint32()); - break; - } - case 6: { - message.serviceAccount = reader.string(); - break; - } - case 7: { - message.workerPool = reader.string(); - break; - } - case 8: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - case 9: { - message.machineType = reader.string(); - break; - } - case 10: { - message.releaseTrack = reader.int32(); - break; - } - case 11: { - message.client = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubmitBuildRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubmitBuildRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubmitBuildRequest message. - * @function verify - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubmitBuildRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.storageSource != null && message.hasOwnProperty("storageSource")) { - properties.source = 1; - { - var error = $root.google.cloud.run.v2.StorageSource.verify(message.storageSource); - if (error) - return "storageSource." + error; - } - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.buildpackBuild != null && message.hasOwnProperty("buildpackBuild")) { - properties.buildType = 1; - { - var error = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify(message.buildpackBuild); - if (error) - return "buildpackBuild." + error; - } - } - if (message.dockerBuild != null && message.hasOwnProperty("dockerBuild")) { - if (properties.buildType === 1) - return "buildType: multiple values"; - properties.buildType = 1; - { - var error = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify(message.dockerBuild); - if (error) - return "dockerBuild." + error; - } - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - if (!$util.isString(message.workerPool)) - return "workerPool: string expected"; - 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"; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.releaseTrack != null && message.hasOwnProperty("releaseTrack")) - switch (message.releaseTrack) { - default: - return "releaseTrack: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.client != null && message.hasOwnProperty("client")) - if (!$util.isString(message.client)) - return "client: string expected"; - return null; - }; - - /** - * Creates a SubmitBuildRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SubmitBuildRequest} SubmitBuildRequest - */ - SubmitBuildRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SubmitBuildRequest) - return object; - var message = new $root.google.cloud.run.v2.SubmitBuildRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.storageSource != null) { - if (typeof object.storageSource !== "object") - throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.storageSource: object expected"); - message.storageSource = $root.google.cloud.run.v2.StorageSource.fromObject(object.storageSource); - } - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.buildpackBuild != null) { - if (typeof object.buildpackBuild !== "object") - throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.buildpackBuild: object expected"); - message.buildpackBuild = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.fromObject(object.buildpackBuild); - } - if (object.dockerBuild != null) { - if (typeof object.dockerBuild !== "object") - throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.dockerBuild: object expected"); - message.dockerBuild = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.fromObject(object.dockerBuild); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.workerPool != null) - message.workerPool = String(object.workerPool); - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.machineType != null) - message.machineType = String(object.machineType); - switch (object.releaseTrack) { - default: - if (typeof object.releaseTrack === "number") { - message.releaseTrack = object.releaseTrack; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.releaseTrack = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.releaseTrack = 6; - break; - case "PRELAUNCH": - case 7: - message.releaseTrack = 7; - break; - case "EARLY_ACCESS": - case 1: - message.releaseTrack = 1; - break; - case "ALPHA": - case 2: - message.releaseTrack = 2; - break; - case "BETA": - case 3: - message.releaseTrack = 3; - break; - case "GA": - case 4: - message.releaseTrack = 4; - break; - case "DEPRECATED": - case 5: - message.releaseTrack = 5; - break; - } - if (object.client != null) - message.client = String(object.client); - return message; - }; - - /** - * Creates a plain object from a SubmitBuildRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest} message SubmitBuildRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubmitBuildRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tags = []; - if (options.defaults) { - object.parent = ""; - object.imageUri = ""; - object.serviceAccount = ""; - object.workerPool = ""; - object.machineType = ""; - object.releaseTrack = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.client = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.storageSource != null && message.hasOwnProperty("storageSource")) { - object.storageSource = $root.google.cloud.run.v2.StorageSource.toObject(message.storageSource, options); - if (options.oneofs) - object.source = "storageSource"; - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.buildpackBuild != null && message.hasOwnProperty("buildpackBuild")) { - object.buildpackBuild = $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.toObject(message.buildpackBuild, options); - if (options.oneofs) - object.buildType = "buildpackBuild"; - } - if (message.dockerBuild != null && message.hasOwnProperty("dockerBuild")) { - object.dockerBuild = $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild.toObject(message.dockerBuild, options); - if (options.oneofs) - object.buildType = "dockerBuild"; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - object.workerPool = message.workerPool; - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.releaseTrack != null && message.hasOwnProperty("releaseTrack")) - object.releaseTrack = options.enums === String ? $root.google.api.LaunchStage[message.releaseTrack] === undefined ? message.releaseTrack : $root.google.api.LaunchStage[message.releaseTrack] : message.releaseTrack; - if (message.client != null && message.hasOwnProperty("client")) - object.client = message.client; - return object; - }; - - /** - * Converts this SubmitBuildRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @instance - * @returns {Object.} JSON object - */ - SubmitBuildRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubmitBuildRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubmitBuildRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildRequest"; - }; - - SubmitBuildRequest.DockerBuild = (function() { - - /** - * Properties of a DockerBuild. - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @interface IDockerBuild - */ - - /** - * Constructs a new DockerBuild. - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @classdesc Represents a DockerBuild. - * @implements IDockerBuild - * @constructor - * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild=} [properties] Properties to set - */ - function DockerBuild(properties) { - if (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 DockerBuild instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild=} [properties] Properties to set - * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild instance - */ - DockerBuild.create = function create(properties) { - return new DockerBuild(properties); - }; - - /** - * Encodes the specified DockerBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild} message DockerBuild message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DockerBuild.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified DockerBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.DockerBuild.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IDockerBuild} message DockerBuild message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DockerBuild.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DockerBuild message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DockerBuild.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DockerBuild message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DockerBuild.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DockerBuild message. - * @function verify - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DockerBuild.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a DockerBuild message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} DockerBuild - */ - DockerBuild.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild) - return object; - return new $root.google.cloud.run.v2.SubmitBuildRequest.DockerBuild(); - }; - - /** - * Creates a plain object from a DockerBuild message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} message DockerBuild - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DockerBuild.toObject = function toObject() { - return {}; - }; - - /** - * Converts this DockerBuild to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @instance - * @returns {Object.} JSON object - */ - DockerBuild.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DockerBuild - * @function getTypeUrl - * @memberof google.cloud.run.v2.SubmitBuildRequest.DockerBuild - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DockerBuild.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildRequest.DockerBuild"; - }; - - return DockerBuild; - })(); - - SubmitBuildRequest.BuildpacksBuild = (function() { - - /** - * Properties of a BuildpacksBuild. - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @interface IBuildpacksBuild - * @property {string|null} [runtime] BuildpacksBuild runtime - * @property {string|null} [functionTarget] BuildpacksBuild functionTarget - * @property {string|null} [cacheImageUri] BuildpacksBuild cacheImageUri - * @property {string|null} [baseImage] BuildpacksBuild baseImage - * @property {Object.|null} [environmentVariables] BuildpacksBuild environmentVariables - * @property {boolean|null} [enableAutomaticUpdates] BuildpacksBuild enableAutomaticUpdates - * @property {string|null} [projectDescriptor] BuildpacksBuild projectDescriptor - */ - - /** - * Constructs a new BuildpacksBuild. - * @memberof google.cloud.run.v2.SubmitBuildRequest - * @classdesc Represents a BuildpacksBuild. - * @implements IBuildpacksBuild - * @constructor - * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild=} [properties] Properties to set - */ - function BuildpacksBuild(properties) { - this.environmentVariables = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BuildpacksBuild runtime. - * @member {string} runtime - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.runtime = ""; - - /** - * BuildpacksBuild functionTarget. - * @member {string} functionTarget - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.functionTarget = ""; - - /** - * BuildpacksBuild cacheImageUri. - * @member {string} cacheImageUri - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.cacheImageUri = ""; - - /** - * BuildpacksBuild baseImage. - * @member {string} baseImage - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.baseImage = ""; - - /** - * BuildpacksBuild environmentVariables. - * @member {Object.} environmentVariables - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.environmentVariables = $util.emptyObject; - - /** - * BuildpacksBuild enableAutomaticUpdates. - * @member {boolean} enableAutomaticUpdates - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.enableAutomaticUpdates = false; - - /** - * BuildpacksBuild projectDescriptor. - * @member {string} projectDescriptor - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - */ - BuildpacksBuild.prototype.projectDescriptor = ""; - - /** - * Creates a new BuildpacksBuild instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild=} [properties] Properties to set - * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild instance - */ - BuildpacksBuild.create = function create(properties) { - return new BuildpacksBuild(properties); - }; - - /** - * Encodes the specified BuildpacksBuild message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild} message BuildpacksBuild message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildpacksBuild.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.runtime != null && Object.hasOwnProperty.call(message, "runtime")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.runtime); - if (message.functionTarget != null && Object.hasOwnProperty.call(message, "functionTarget")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.functionTarget); - if (message.cacheImageUri != null && Object.hasOwnProperty.call(message, "cacheImageUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.cacheImageUri); - if (message.baseImage != null && Object.hasOwnProperty.call(message, "baseImage")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.baseImage); - if (message.environmentVariables != null && Object.hasOwnProperty.call(message, "environmentVariables")) - for (var keys = Object.keys(message.environmentVariables), 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.environmentVariables[keys[i]]).ldelim(); - if (message.enableAutomaticUpdates != null && Object.hasOwnProperty.call(message, "enableAutomaticUpdates")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableAutomaticUpdates); - if (message.projectDescriptor != null && Object.hasOwnProperty.call(message, "projectDescriptor")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.projectDescriptor); - return writer; - }; - - /** - * Encodes the specified BuildpacksBuild message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.IBuildpacksBuild} message BuildpacksBuild message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildpacksBuild.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BuildpacksBuild message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildpacksBuild.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.runtime = reader.string(); - break; - } - case 2: { - message.functionTarget = reader.string(); - break; - } - case 3: { - message.cacheImageUri = reader.string(); - break; - } - case 4: { - message.baseImage = reader.string(); - break; - } - case 5: { - if (message.environmentVariables === $util.emptyObject) - message.environmentVariables = {}; - 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.environmentVariables[key] = value; - break; - } - case 6: { - message.enableAutomaticUpdates = reader.bool(); - break; - } - case 7: { - message.projectDescriptor = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BuildpacksBuild message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildpacksBuild.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BuildpacksBuild message. - * @function verify - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BuildpacksBuild.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.runtime != null && message.hasOwnProperty("runtime")) - if (!$util.isString(message.runtime)) - return "runtime: string expected"; - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - if (!$util.isString(message.functionTarget)) - return "functionTarget: string expected"; - if (message.cacheImageUri != null && message.hasOwnProperty("cacheImageUri")) - if (!$util.isString(message.cacheImageUri)) - return "cacheImageUri: string expected"; - if (message.baseImage != null && message.hasOwnProperty("baseImage")) - if (!$util.isString(message.baseImage)) - return "baseImage: string expected"; - if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) { - if (!$util.isObject(message.environmentVariables)) - return "environmentVariables: object expected"; - var key = Object.keys(message.environmentVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.environmentVariables[key[i]])) - return "environmentVariables: string{k:string} expected"; - } - if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) - if (typeof message.enableAutomaticUpdates !== "boolean") - return "enableAutomaticUpdates: boolean expected"; - if (message.projectDescriptor != null && message.hasOwnProperty("projectDescriptor")) - if (!$util.isString(message.projectDescriptor)) - return "projectDescriptor: string expected"; - return null; - }; - - /** - * Creates a BuildpacksBuild message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} BuildpacksBuild - */ - BuildpacksBuild.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild) - return object; - var message = new $root.google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild(); - if (object.runtime != null) - message.runtime = String(object.runtime); - if (object.functionTarget != null) - message.functionTarget = String(object.functionTarget); - if (object.cacheImageUri != null) - message.cacheImageUri = String(object.cacheImageUri); - if (object.baseImage != null) - message.baseImage = String(object.baseImage); - if (object.environmentVariables) { - if (typeof object.environmentVariables !== "object") - throw TypeError(".google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild.environmentVariables: object expected"); - message.environmentVariables = {}; - for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i) - message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]); - } - if (object.enableAutomaticUpdates != null) - message.enableAutomaticUpdates = Boolean(object.enableAutomaticUpdates); - if (object.projectDescriptor != null) - message.projectDescriptor = String(object.projectDescriptor); - return message; - }; - - /** - * Creates a plain object from a BuildpacksBuild message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} message BuildpacksBuild - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BuildpacksBuild.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.environmentVariables = {}; - if (options.defaults) { - object.runtime = ""; - object.functionTarget = ""; - object.cacheImageUri = ""; - object.baseImage = ""; - object.enableAutomaticUpdates = false; - object.projectDescriptor = ""; - } - if (message.runtime != null && message.hasOwnProperty("runtime")) - object.runtime = message.runtime; - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - object.functionTarget = message.functionTarget; - if (message.cacheImageUri != null && message.hasOwnProperty("cacheImageUri")) - object.cacheImageUri = message.cacheImageUri; - if (message.baseImage != null && message.hasOwnProperty("baseImage")) - object.baseImage = message.baseImage; - var keys2; - if (message.environmentVariables && (keys2 = Object.keys(message.environmentVariables)).length) { - object.environmentVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.environmentVariables[keys2[j]] = message.environmentVariables[keys2[j]]; - } - if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) - object.enableAutomaticUpdates = message.enableAutomaticUpdates; - if (message.projectDescriptor != null && message.hasOwnProperty("projectDescriptor")) - object.projectDescriptor = message.projectDescriptor; - return object; - }; - - /** - * Converts this BuildpacksBuild to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @instance - * @returns {Object.} JSON object - */ - BuildpacksBuild.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BuildpacksBuild - * @function getTypeUrl - * @memberof google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BuildpacksBuild.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild"; - }; - - return BuildpacksBuild; - })(); - - return SubmitBuildRequest; - })(); - - v2.SubmitBuildResponse = (function() { - - /** - * Properties of a SubmitBuildResponse. - * @memberof google.cloud.run.v2 - * @interface ISubmitBuildResponse - * @property {google.longrunning.IOperation|null} [buildOperation] SubmitBuildResponse buildOperation - * @property {string|null} [baseImageUri] SubmitBuildResponse baseImageUri - * @property {string|null} [baseImageWarning] SubmitBuildResponse baseImageWarning - */ - - /** - * Constructs a new SubmitBuildResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a SubmitBuildResponse. - * @implements ISubmitBuildResponse - * @constructor - * @param {google.cloud.run.v2.ISubmitBuildResponse=} [properties] Properties to set - */ - function SubmitBuildResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SubmitBuildResponse buildOperation. - * @member {google.longrunning.IOperation|null|undefined} buildOperation - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @instance - */ - SubmitBuildResponse.prototype.buildOperation = null; - - /** - * SubmitBuildResponse baseImageUri. - * @member {string} baseImageUri - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @instance - */ - SubmitBuildResponse.prototype.baseImageUri = ""; - - /** - * SubmitBuildResponse baseImageWarning. - * @member {string} baseImageWarning - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @instance - */ - SubmitBuildResponse.prototype.baseImageWarning = ""; - - /** - * Creates a new SubmitBuildResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {google.cloud.run.v2.ISubmitBuildResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse instance - */ - SubmitBuildResponse.create = function create(properties) { - return new SubmitBuildResponse(properties); - }; - - /** - * Encodes the specified SubmitBuildResponse message. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {google.cloud.run.v2.ISubmitBuildResponse} message SubmitBuildResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubmitBuildResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.buildOperation != null && Object.hasOwnProperty.call(message, "buildOperation")) - $root.google.longrunning.Operation.encode(message.buildOperation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.baseImageUri != null && Object.hasOwnProperty.call(message, "baseImageUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseImageUri); - if (message.baseImageWarning != null && Object.hasOwnProperty.call(message, "baseImageWarning")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.baseImageWarning); - return writer; - }; - - /** - * Encodes the specified SubmitBuildResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.SubmitBuildResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {google.cloud.run.v2.ISubmitBuildResponse} message SubmitBuildResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubmitBuildResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubmitBuildResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubmitBuildResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SubmitBuildResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.buildOperation = $root.google.longrunning.Operation.decode(reader, reader.uint32()); - break; - } - case 2: { - message.baseImageUri = reader.string(); - break; - } - case 3: { - message.baseImageWarning = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubmitBuildResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubmitBuildResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubmitBuildResponse message. - * @function verify - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubmitBuildResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.buildOperation != null && message.hasOwnProperty("buildOperation")) { - var error = $root.google.longrunning.Operation.verify(message.buildOperation); - if (error) - return "buildOperation." + error; - } - if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) - if (!$util.isString(message.baseImageUri)) - return "baseImageUri: string expected"; - if (message.baseImageWarning != null && message.hasOwnProperty("baseImageWarning")) - if (!$util.isString(message.baseImageWarning)) - return "baseImageWarning: string expected"; - return null; - }; - - /** - * Creates a SubmitBuildResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SubmitBuildResponse} SubmitBuildResponse - */ - SubmitBuildResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SubmitBuildResponse) - return object; - var message = new $root.google.cloud.run.v2.SubmitBuildResponse(); - if (object.buildOperation != null) { - if (typeof object.buildOperation !== "object") - throw TypeError(".google.cloud.run.v2.SubmitBuildResponse.buildOperation: object expected"); - message.buildOperation = $root.google.longrunning.Operation.fromObject(object.buildOperation); - } - if (object.baseImageUri != null) - message.baseImageUri = String(object.baseImageUri); - if (object.baseImageWarning != null) - message.baseImageWarning = String(object.baseImageWarning); - return message; - }; - - /** - * Creates a plain object from a SubmitBuildResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {google.cloud.run.v2.SubmitBuildResponse} message SubmitBuildResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubmitBuildResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.buildOperation = null; - object.baseImageUri = ""; - object.baseImageWarning = ""; - } - if (message.buildOperation != null && message.hasOwnProperty("buildOperation")) - object.buildOperation = $root.google.longrunning.Operation.toObject(message.buildOperation, options); - if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) - object.baseImageUri = message.baseImageUri; - if (message.baseImageWarning != null && message.hasOwnProperty("baseImageWarning")) - object.baseImageWarning = message.baseImageWarning; - return object; - }; - - /** - * Converts this SubmitBuildResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @instance - * @returns {Object.} JSON object - */ - SubmitBuildResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubmitBuildResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.SubmitBuildResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubmitBuildResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SubmitBuildResponse"; - }; - - return SubmitBuildResponse; - })(); - - v2.StorageSource = (function() { - - /** - * Properties of a StorageSource. - * @memberof google.cloud.run.v2 - * @interface IStorageSource - * @property {string|null} [bucket] StorageSource bucket - * @property {string|null} [object] StorageSource object - * @property {number|Long|null} [generation] StorageSource generation - */ - - /** - * Constructs a new StorageSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents a StorageSource. - * @implements IStorageSource - * @constructor - * @param {google.cloud.run.v2.IStorageSource=} [properties] Properties to set - */ - function StorageSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StorageSource bucket. - * @member {string} bucket - * @memberof google.cloud.run.v2.StorageSource - * @instance - */ - StorageSource.prototype.bucket = ""; - - /** - * StorageSource object. - * @member {string} object - * @memberof google.cloud.run.v2.StorageSource - * @instance - */ - StorageSource.prototype.object = ""; - - /** - * StorageSource generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.StorageSource - * @instance - */ - StorageSource.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new StorageSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {google.cloud.run.v2.IStorageSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.StorageSource} StorageSource instance - */ - StorageSource.create = function create(properties) { - return new StorageSource(properties); - }; - - /** - * Encodes the specified StorageSource message. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {google.cloud.run.v2.IStorageSource} message StorageSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StorageSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); - if (message.object != null && Object.hasOwnProperty.call(message, "object")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - return writer; - }; - - /** - * Encodes the specified StorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.StorageSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {google.cloud.run.v2.IStorageSource} message StorageSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StorageSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StorageSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.StorageSource} StorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StorageSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StorageSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bucket = reader.string(); - break; - } - case 2: { - message.object = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StorageSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.StorageSource} StorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StorageSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StorageSource message. - * @function verify - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StorageSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bucket != null && message.hasOwnProperty("bucket")) - if (!$util.isString(message.bucket)) - return "bucket: string expected"; - if (message.object != null && message.hasOwnProperty("object")) - if (!$util.isString(message.object)) - return "object: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - return null; - }; - - /** - * Creates a StorageSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.StorageSource} StorageSource - */ - StorageSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.StorageSource) - return object; - var message = new $root.google.cloud.run.v2.StorageSource(); - if (object.bucket != null) - message.bucket = String(object.bucket); - if (object.object != null) - message.object = String(object.object); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a StorageSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {google.cloud.run.v2.StorageSource} message StorageSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StorageSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.bucket = ""; - object.object = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - } - if (message.bucket != null && message.hasOwnProperty("bucket")) - object.bucket = message.bucket; - if (message.object != null && message.hasOwnProperty("object")) - object.object = message.object; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - return object; - }; - - /** - * Converts this StorageSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.StorageSource - * @instance - * @returns {Object.} JSON object - */ - StorageSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StorageSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.StorageSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StorageSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.StorageSource"; - }; - - return StorageSource; - })(); - - v2.Condition = (function() { - - /** - * Properties of a Condition. - * @memberof google.cloud.run.v2 - * @interface ICondition - * @property {string|null} [type] Condition type - * @property {google.cloud.run.v2.Condition.State|null} [state] Condition state - * @property {string|null} [message] Condition message - * @property {google.protobuf.ITimestamp|null} [lastTransitionTime] Condition lastTransitionTime - * @property {google.cloud.run.v2.Condition.Severity|null} [severity] Condition severity - * @property {google.cloud.run.v2.Condition.CommonReason|null} [reason] Condition reason - * @property {google.cloud.run.v2.Condition.RevisionReason|null} [revisionReason] Condition revisionReason - * @property {google.cloud.run.v2.Condition.ExecutionReason|null} [executionReason] Condition executionReason - */ - - /** - * Constructs a new Condition. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Condition. - * @implements ICondition - * @constructor - * @param {google.cloud.run.v2.ICondition=} [properties] Properties to set - */ - function Condition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Condition type. - * @member {string} type - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.type = ""; - - /** - * Condition state. - * @member {google.cloud.run.v2.Condition.State} state - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.state = 0; - - /** - * Condition message. - * @member {string} message - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.message = ""; - - /** - * Condition lastTransitionTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastTransitionTime - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.lastTransitionTime = null; - - /** - * Condition severity. - * @member {google.cloud.run.v2.Condition.Severity} severity - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.severity = 0; - - /** - * Condition reason. - * @member {google.cloud.run.v2.Condition.CommonReason|null|undefined} reason - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.reason = null; - - /** - * Condition revisionReason. - * @member {google.cloud.run.v2.Condition.RevisionReason|null|undefined} revisionReason - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.revisionReason = null; - - /** - * Condition executionReason. - * @member {google.cloud.run.v2.Condition.ExecutionReason|null|undefined} executionReason - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Condition.prototype.executionReason = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Condition reasons. - * @member {"reason"|"revisionReason"|"executionReason"|undefined} reasons - * @memberof google.cloud.run.v2.Condition - * @instance - */ - Object.defineProperty(Condition.prototype, "reasons", { - get: $util.oneOfGetter($oneOfFields = ["reason", "revisionReason", "executionReason"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Condition instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Condition - * @static - * @param {google.cloud.run.v2.ICondition=} [properties] Properties to set - * @returns {google.cloud.run.v2.Condition} Condition instance - */ - Condition.create = function create(properties) { - return new Condition(properties); - }; - - /** - * Encodes the specified Condition message. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Condition - * @static - * @param {google.cloud.run.v2.ICondition} message Condition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Condition.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.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); - if (message.lastTransitionTime != null && Object.hasOwnProperty.call(message, "lastTransitionTime")) - $root.google.protobuf.Timestamp.encode(message.lastTransitionTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.severity); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.reason); - if (message.revisionReason != null && Object.hasOwnProperty.call(message, "revisionReason")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.revisionReason); - if (message.executionReason != null && Object.hasOwnProperty.call(message, "executionReason")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.executionReason); - return writer; - }; - - /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.run.v2.Condition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Condition - * @static - * @param {google.cloud.run.v2.ICondition} message Condition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Condition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Condition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Condition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Condition} Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Condition.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Condition(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.message = reader.string(); - break; - } - case 4: { - message.lastTransitionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.severity = reader.int32(); - break; - } - case 6: { - message.reason = reader.int32(); - break; - } - case 9: { - message.revisionReason = reader.int32(); - break; - } - case 11: { - message.executionReason = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Condition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Condition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Condition} Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Condition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Condition message. - * @function verify - * @memberof google.cloud.run.v2.Condition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Condition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.lastTransitionTime != null && message.hasOwnProperty("lastTransitionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastTransitionTime); - if (error) - return "lastTransitionTime." + error; - } - if (message.severity != null && message.hasOwnProperty("severity")) - switch (message.severity) { - default: - return "severity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.reason != null && message.hasOwnProperty("reason")) { - properties.reasons = 1; - switch (message.reason) { - default: - return "reason: enum value expected"; - case 0: - case 1: - case 3: - case 4: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - break; - } - } - if (message.revisionReason != null && message.hasOwnProperty("revisionReason")) { - if (properties.reasons === 1) - return "reasons: multiple values"; - properties.reasons = 1; - switch (message.revisionReason) { - default: - return "revisionReason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - break; - } - } - if (message.executionReason != null && message.hasOwnProperty("executionReason")) { - if (properties.reasons === 1) - return "reasons: multiple values"; - properties.reasons = 1; - switch (message.executionReason) { - default: - return "executionReason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - } - return null; - }; - - /** - * Creates a Condition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Condition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Condition} Condition - */ - Condition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Condition) - return object; - var message = new $root.google.cloud.run.v2.Condition(); - if (object.type != null) - message.type = String(object.type); - 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 "CONDITION_PENDING": - case 1: - message.state = 1; - break; - case "CONDITION_RECONCILING": - case 2: - message.state = 2; - break; - case "CONDITION_FAILED": - case 3: - message.state = 3; - break; - case "CONDITION_SUCCEEDED": - case 4: - message.state = 4; - break; - } - if (object.message != null) - message.message = String(object.message); - if (object.lastTransitionTime != null) { - if (typeof object.lastTransitionTime !== "object") - throw TypeError(".google.cloud.run.v2.Condition.lastTransitionTime: object expected"); - message.lastTransitionTime = $root.google.protobuf.Timestamp.fromObject(object.lastTransitionTime); - } - switch (object.severity) { - default: - if (typeof object.severity === "number") { - message.severity = object.severity; - break; - } - break; - case "SEVERITY_UNSPECIFIED": - case 0: - message.severity = 0; - break; - case "ERROR": - case 1: - message.severity = 1; - break; - case "WARNING": - case 2: - message.severity = 2; - break; - case "INFO": - case 3: - message.severity = 3; - break; - } - switch (object.reason) { - default: - if (typeof object.reason === "number") { - message.reason = object.reason; - break; - } - break; - case "COMMON_REASON_UNDEFINED": - case 0: - message.reason = 0; - break; - case "UNKNOWN": - case 1: - message.reason = 1; - break; - case "REVISION_FAILED": - case 3: - message.reason = 3; - break; - case "PROGRESS_DEADLINE_EXCEEDED": - case 4: - message.reason = 4; - break; - case "CONTAINER_MISSING": - case 6: - message.reason = 6; - break; - case "CONTAINER_PERMISSION_DENIED": - case 7: - message.reason = 7; - break; - case "CONTAINER_IMAGE_UNAUTHORIZED": - case 8: - message.reason = 8; - break; - case "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED": - case 9: - message.reason = 9; - break; - case "ENCRYPTION_KEY_PERMISSION_DENIED": - case 10: - message.reason = 10; - break; - case "ENCRYPTION_KEY_CHECK_FAILED": - case 11: - message.reason = 11; - break; - case "SECRETS_ACCESS_CHECK_FAILED": - case 12: - message.reason = 12; - break; - case "WAITING_FOR_OPERATION": - case 13: - message.reason = 13; - break; - case "IMMEDIATE_RETRY": - case 14: - message.reason = 14; - break; - case "POSTPONED_RETRY": - case 15: - message.reason = 15; - break; - case "INTERNAL": - case 16: - message.reason = 16; - break; - case "VPC_NETWORK_NOT_FOUND": - case 17: - message.reason = 17; - break; - } - switch (object.revisionReason) { - default: - if (typeof object.revisionReason === "number") { - message.revisionReason = object.revisionReason; - break; - } - break; - case "REVISION_REASON_UNDEFINED": - case 0: - message.revisionReason = 0; - break; - case "PENDING": - case 1: - message.revisionReason = 1; - break; - case "RESERVE": - case 2: - message.revisionReason = 2; - break; - case "RETIRED": - case 3: - message.revisionReason = 3; - break; - case "RETIRING": - case 4: - message.revisionReason = 4; - break; - case "RECREATING": - case 5: - message.revisionReason = 5; - break; - case "HEALTH_CHECK_CONTAINER_ERROR": - case 6: - message.revisionReason = 6; - break; - case "CUSTOMIZED_PATH_RESPONSE_PENDING": - case 7: - message.revisionReason = 7; - break; - case "MIN_INSTANCES_NOT_PROVISIONED": - case 8: - message.revisionReason = 8; - break; - case "ACTIVE_REVISION_LIMIT_REACHED": - case 9: - message.revisionReason = 9; - break; - case "NO_DEPLOYMENT": - case 10: - message.revisionReason = 10; - break; - case "HEALTH_CHECK_SKIPPED": - case 11: - message.revisionReason = 11; - break; - case "MIN_INSTANCES_WARMING": - case 12: - message.revisionReason = 12; - break; - } - switch (object.executionReason) { - default: - if (typeof object.executionReason === "number") { - message.executionReason = object.executionReason; - break; - } - break; - case "EXECUTION_REASON_UNDEFINED": - case 0: - message.executionReason = 0; - break; - case "JOB_STATUS_SERVICE_POLLING_ERROR": - case 1: - message.executionReason = 1; - break; - case "NON_ZERO_EXIT_CODE": - case 2: - message.executionReason = 2; - break; - case "CANCELLED": - case 3: - message.executionReason = 3; - break; - case "CANCELLING": - case 4: - message.executionReason = 4; - break; - case "DELETED": - case 5: - message.executionReason = 5; - break; - case "DELAYED_START_PENDING": - case 6: - message.executionReason = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Condition - * @static - * @param {google.cloud.run.v2.Condition} message Condition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Condition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.message = ""; - object.lastTransitionTime = null; - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.run.v2.Condition.State[message.state] === undefined ? message.state : $root.google.cloud.run.v2.Condition.State[message.state] : message.state; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.lastTransitionTime != null && message.hasOwnProperty("lastTransitionTime")) - object.lastTransitionTime = $root.google.protobuf.Timestamp.toObject(message.lastTransitionTime, options); - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.run.v2.Condition.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.run.v2.Condition.Severity[message.severity] : message.severity; - if (message.reason != null && message.hasOwnProperty("reason")) { - object.reason = options.enums === String ? $root.google.cloud.run.v2.Condition.CommonReason[message.reason] === undefined ? message.reason : $root.google.cloud.run.v2.Condition.CommonReason[message.reason] : message.reason; - if (options.oneofs) - object.reasons = "reason"; - } - if (message.revisionReason != null && message.hasOwnProperty("revisionReason")) { - object.revisionReason = options.enums === String ? $root.google.cloud.run.v2.Condition.RevisionReason[message.revisionReason] === undefined ? message.revisionReason : $root.google.cloud.run.v2.Condition.RevisionReason[message.revisionReason] : message.revisionReason; - if (options.oneofs) - object.reasons = "revisionReason"; - } - if (message.executionReason != null && message.hasOwnProperty("executionReason")) { - object.executionReason = options.enums === String ? $root.google.cloud.run.v2.Condition.ExecutionReason[message.executionReason] === undefined ? message.executionReason : $root.google.cloud.run.v2.Condition.ExecutionReason[message.executionReason] : message.executionReason; - if (options.oneofs) - object.reasons = "executionReason"; - } - return object; - }; - - /** - * Converts this Condition to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Condition - * @instance - * @returns {Object.} JSON object - */ - Condition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Condition - * @function getTypeUrl - * @memberof google.cloud.run.v2.Condition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Condition"; - }; - - /** - * State enum. - * @name google.cloud.run.v2.Condition.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CONDITION_PENDING=1 CONDITION_PENDING value - * @property {number} CONDITION_RECONCILING=2 CONDITION_RECONCILING value - * @property {number} CONDITION_FAILED=3 CONDITION_FAILED value - * @property {number} CONDITION_SUCCEEDED=4 CONDITION_SUCCEEDED value - */ - Condition.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CONDITION_PENDING"] = 1; - values[valuesById[2] = "CONDITION_RECONCILING"] = 2; - values[valuesById[3] = "CONDITION_FAILED"] = 3; - values[valuesById[4] = "CONDITION_SUCCEEDED"] = 4; - return values; - })(); - - /** - * Severity enum. - * @name google.cloud.run.v2.Condition.Severity - * @enum {number} - * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value - * @property {number} ERROR=1 ERROR value - * @property {number} WARNING=2 WARNING value - * @property {number} INFO=3 INFO value - */ - Condition.Severity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ERROR"] = 1; - values[valuesById[2] = "WARNING"] = 2; - values[valuesById[3] = "INFO"] = 3; - return values; - })(); - - /** - * CommonReason enum. - * @name google.cloud.run.v2.Condition.CommonReason - * @enum {number} - * @property {number} COMMON_REASON_UNDEFINED=0 COMMON_REASON_UNDEFINED value - * @property {number} UNKNOWN=1 UNKNOWN value - * @property {number} REVISION_FAILED=3 REVISION_FAILED value - * @property {number} PROGRESS_DEADLINE_EXCEEDED=4 PROGRESS_DEADLINE_EXCEEDED value - * @property {number} CONTAINER_MISSING=6 CONTAINER_MISSING value - * @property {number} CONTAINER_PERMISSION_DENIED=7 CONTAINER_PERMISSION_DENIED value - * @property {number} CONTAINER_IMAGE_UNAUTHORIZED=8 CONTAINER_IMAGE_UNAUTHORIZED value - * @property {number} CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED=9 CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED value - * @property {number} ENCRYPTION_KEY_PERMISSION_DENIED=10 ENCRYPTION_KEY_PERMISSION_DENIED value - * @property {number} ENCRYPTION_KEY_CHECK_FAILED=11 ENCRYPTION_KEY_CHECK_FAILED value - * @property {number} SECRETS_ACCESS_CHECK_FAILED=12 SECRETS_ACCESS_CHECK_FAILED value - * @property {number} WAITING_FOR_OPERATION=13 WAITING_FOR_OPERATION value - * @property {number} IMMEDIATE_RETRY=14 IMMEDIATE_RETRY value - * @property {number} POSTPONED_RETRY=15 POSTPONED_RETRY value - * @property {number} INTERNAL=16 INTERNAL value - * @property {number} VPC_NETWORK_NOT_FOUND=17 VPC_NETWORK_NOT_FOUND value - */ - Condition.CommonReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMMON_REASON_UNDEFINED"] = 0; - values[valuesById[1] = "UNKNOWN"] = 1; - values[valuesById[3] = "REVISION_FAILED"] = 3; - values[valuesById[4] = "PROGRESS_DEADLINE_EXCEEDED"] = 4; - values[valuesById[6] = "CONTAINER_MISSING"] = 6; - values[valuesById[7] = "CONTAINER_PERMISSION_DENIED"] = 7; - values[valuesById[8] = "CONTAINER_IMAGE_UNAUTHORIZED"] = 8; - values[valuesById[9] = "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED"] = 9; - values[valuesById[10] = "ENCRYPTION_KEY_PERMISSION_DENIED"] = 10; - values[valuesById[11] = "ENCRYPTION_KEY_CHECK_FAILED"] = 11; - values[valuesById[12] = "SECRETS_ACCESS_CHECK_FAILED"] = 12; - values[valuesById[13] = "WAITING_FOR_OPERATION"] = 13; - values[valuesById[14] = "IMMEDIATE_RETRY"] = 14; - values[valuesById[15] = "POSTPONED_RETRY"] = 15; - values[valuesById[16] = "INTERNAL"] = 16; - values[valuesById[17] = "VPC_NETWORK_NOT_FOUND"] = 17; - return values; - })(); - - /** - * RevisionReason enum. - * @name google.cloud.run.v2.Condition.RevisionReason - * @enum {number} - * @property {number} REVISION_REASON_UNDEFINED=0 REVISION_REASON_UNDEFINED value - * @property {number} PENDING=1 PENDING value - * @property {number} RESERVE=2 RESERVE value - * @property {number} RETIRED=3 RETIRED value - * @property {number} RETIRING=4 RETIRING value - * @property {number} RECREATING=5 RECREATING value - * @property {number} HEALTH_CHECK_CONTAINER_ERROR=6 HEALTH_CHECK_CONTAINER_ERROR value - * @property {number} CUSTOMIZED_PATH_RESPONSE_PENDING=7 CUSTOMIZED_PATH_RESPONSE_PENDING value - * @property {number} MIN_INSTANCES_NOT_PROVISIONED=8 MIN_INSTANCES_NOT_PROVISIONED value - * @property {number} ACTIVE_REVISION_LIMIT_REACHED=9 ACTIVE_REVISION_LIMIT_REACHED value - * @property {number} NO_DEPLOYMENT=10 NO_DEPLOYMENT value - * @property {number} HEALTH_CHECK_SKIPPED=11 HEALTH_CHECK_SKIPPED value - * @property {number} MIN_INSTANCES_WARMING=12 MIN_INSTANCES_WARMING value - */ - Condition.RevisionReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REVISION_REASON_UNDEFINED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "RESERVE"] = 2; - values[valuesById[3] = "RETIRED"] = 3; - values[valuesById[4] = "RETIRING"] = 4; - values[valuesById[5] = "RECREATING"] = 5; - values[valuesById[6] = "HEALTH_CHECK_CONTAINER_ERROR"] = 6; - values[valuesById[7] = "CUSTOMIZED_PATH_RESPONSE_PENDING"] = 7; - values[valuesById[8] = "MIN_INSTANCES_NOT_PROVISIONED"] = 8; - values[valuesById[9] = "ACTIVE_REVISION_LIMIT_REACHED"] = 9; - values[valuesById[10] = "NO_DEPLOYMENT"] = 10; - values[valuesById[11] = "HEALTH_CHECK_SKIPPED"] = 11; - values[valuesById[12] = "MIN_INSTANCES_WARMING"] = 12; - return values; - })(); - - /** - * ExecutionReason enum. - * @name google.cloud.run.v2.Condition.ExecutionReason - * @enum {number} - * @property {number} EXECUTION_REASON_UNDEFINED=0 EXECUTION_REASON_UNDEFINED value - * @property {number} JOB_STATUS_SERVICE_POLLING_ERROR=1 JOB_STATUS_SERVICE_POLLING_ERROR value - * @property {number} NON_ZERO_EXIT_CODE=2 NON_ZERO_EXIT_CODE value - * @property {number} CANCELLED=3 CANCELLED value - * @property {number} CANCELLING=4 CANCELLING value - * @property {number} DELETED=5 DELETED value - * @property {number} DELAYED_START_PENDING=6 DELAYED_START_PENDING value - */ - Condition.ExecutionReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXECUTION_REASON_UNDEFINED"] = 0; - values[valuesById[1] = "JOB_STATUS_SERVICE_POLLING_ERROR"] = 1; - values[valuesById[2] = "NON_ZERO_EXIT_CODE"] = 2; - values[valuesById[3] = "CANCELLED"] = 3; - values[valuesById[4] = "CANCELLING"] = 4; - values[valuesById[5] = "DELETED"] = 5; - values[valuesById[6] = "DELAYED_START_PENDING"] = 6; - return values; - })(); - - return Condition; - })(); - - v2.ContainerStatus = (function() { - - /** - * Properties of a ContainerStatus. - * @memberof google.cloud.run.v2 - * @interface IContainerStatus - * @property {string|null} [name] ContainerStatus name - * @property {string|null} [imageDigest] ContainerStatus imageDigest - */ - - /** - * Constructs a new ContainerStatus. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ContainerStatus. - * @implements IContainerStatus - * @constructor - * @param {google.cloud.run.v2.IContainerStatus=} [properties] Properties to set - */ - function ContainerStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContainerStatus name. - * @member {string} name - * @memberof google.cloud.run.v2.ContainerStatus - * @instance - */ - ContainerStatus.prototype.name = ""; - - /** - * ContainerStatus imageDigest. - * @member {string} imageDigest - * @memberof google.cloud.run.v2.ContainerStatus - * @instance - */ - ContainerStatus.prototype.imageDigest = ""; - - /** - * Creates a new ContainerStatus instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {google.cloud.run.v2.IContainerStatus=} [properties] Properties to set - * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus instance - */ - ContainerStatus.create = function create(properties) { - return new ContainerStatus(properties); - }; - - /** - * Encodes the specified ContainerStatus message. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {google.cloud.run.v2.IContainerStatus} message ContainerStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.imageDigest != null && Object.hasOwnProperty.call(message, "imageDigest")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageDigest); - return writer; - }; - - /** - * Encodes the specified ContainerStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {google.cloud.run.v2.IContainerStatus} message ContainerStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContainerStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ContainerStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.imageDigest = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContainerStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContainerStatus message. - * @function verify - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContainerStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.imageDigest != null && message.hasOwnProperty("imageDigest")) - if (!$util.isString(message.imageDigest)) - return "imageDigest: string expected"; - return null; - }; - - /** - * Creates a ContainerStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus - */ - ContainerStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ContainerStatus) - return object; - var message = new $root.google.cloud.run.v2.ContainerStatus(); - if (object.name != null) - message.name = String(object.name); - if (object.imageDigest != null) - message.imageDigest = String(object.imageDigest); - return message; - }; - - /** - * Creates a plain object from a ContainerStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {google.cloud.run.v2.ContainerStatus} message ContainerStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContainerStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.imageDigest = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.imageDigest != null && message.hasOwnProperty("imageDigest")) - object.imageDigest = message.imageDigest; - return object; - }; - - /** - * Converts this ContainerStatus to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ContainerStatus - * @instance - * @returns {Object.} JSON object - */ - ContainerStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContainerStatus - * @function getTypeUrl - * @memberof google.cloud.run.v2.ContainerStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContainerStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ContainerStatus"; - }; - - return ContainerStatus; - })(); - - v2.Executions = (function() { - - /** - * Constructs a new Executions service. - * @memberof google.cloud.run.v2 - * @classdesc Represents an Executions - * @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 Executions(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Executions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Executions; - - /** - * Creates new Executions service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Executions - * @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 {Executions} RPC service. Useful where requests and/or responses are streamed. - */ - Executions.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|getExecution}. - * @memberof google.cloud.run.v2.Executions - * @typedef GetExecutionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Execution} [response] Execution - */ - - /** - * Calls GetExecution. - * @function getExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IGetExecutionRequest} request GetExecutionRequest message or plain object - * @param {google.cloud.run.v2.Executions.GetExecutionCallback} callback Node-style callback called with the error, if any, and Execution - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Executions.prototype.getExecution = function getExecution(request, callback) { - return this.rpcCall(getExecution, $root.google.cloud.run.v2.GetExecutionRequest, $root.google.cloud.run.v2.Execution, request, callback); - }, "name", { value: "GetExecution" }); - - /** - * Calls GetExecution. - * @function getExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IGetExecutionRequest} request GetExecutionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|listExecutions}. - * @memberof google.cloud.run.v2.Executions - * @typedef ListExecutionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListExecutionsResponse} [response] ListExecutionsResponse - */ - - /** - * Calls ListExecutions. - * @function listExecutions - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IListExecutionsRequest} request ListExecutionsRequest message or plain object - * @param {google.cloud.run.v2.Executions.ListExecutionsCallback} callback Node-style callback called with the error, if any, and ListExecutionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Executions.prototype.listExecutions = function listExecutions(request, callback) { - return this.rpcCall(listExecutions, $root.google.cloud.run.v2.ListExecutionsRequest, $root.google.cloud.run.v2.ListExecutionsResponse, request, callback); - }, "name", { value: "ListExecutions" }); - - /** - * Calls ListExecutions. - * @function listExecutions - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IListExecutionsRequest} request ListExecutionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|deleteExecution}. - * @memberof google.cloud.run.v2.Executions - * @typedef DeleteExecutionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteExecution. - * @function deleteExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IDeleteExecutionRequest} request DeleteExecutionRequest message or plain object - * @param {google.cloud.run.v2.Executions.DeleteExecutionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Executions.prototype.deleteExecution = function deleteExecution(request, callback) { - return this.rpcCall(deleteExecution, $root.google.cloud.run.v2.DeleteExecutionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteExecution" }); - - /** - * Calls DeleteExecution. - * @function deleteExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.IDeleteExecutionRequest} request DeleteExecutionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Executions|cancelExecution}. - * @memberof google.cloud.run.v2.Executions - * @typedef CancelExecutionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CancelExecution. - * @function cancelExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.ICancelExecutionRequest} request CancelExecutionRequest message or plain object - * @param {google.cloud.run.v2.Executions.CancelExecutionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Executions.prototype.cancelExecution = function cancelExecution(request, callback) { - return this.rpcCall(cancelExecution, $root.google.cloud.run.v2.CancelExecutionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CancelExecution" }); - - /** - * Calls CancelExecution. - * @function cancelExecution - * @memberof google.cloud.run.v2.Executions - * @instance - * @param {google.cloud.run.v2.ICancelExecutionRequest} request CancelExecutionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Executions; - })(); - - v2.GetExecutionRequest = (function() { - - /** - * Properties of a GetExecutionRequest. - * @memberof google.cloud.run.v2 - * @interface IGetExecutionRequest - * @property {string|null} [name] GetExecutionRequest name - */ - - /** - * Constructs a new GetExecutionRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetExecutionRequest. - * @implements IGetExecutionRequest - * @constructor - * @param {google.cloud.run.v2.IGetExecutionRequest=} [properties] Properties to set - */ - function GetExecutionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetExecutionRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.GetExecutionRequest - * @instance - */ - GetExecutionRequest.prototype.name = ""; - - /** - * Creates a new GetExecutionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {google.cloud.run.v2.IGetExecutionRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest instance - */ - GetExecutionRequest.create = function create(properties) { - return new GetExecutionRequest(properties); - }; - - /** - * Encodes the specified GetExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {google.cloud.run.v2.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetExecutionRequest.encode = function encode(message, writer) { - 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 GetExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetExecutionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {google.cloud.run.v2.IGetExecutionRequest} message GetExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetExecutionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetExecutionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetExecutionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetExecutionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetExecutionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetExecutionRequest message. - * @function verify - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetExecutionRequest.verify = function verify(message) { - if (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 GetExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetExecutionRequest} GetExecutionRequest - */ - GetExecutionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetExecutionRequest) - return object; - var message = new $root.google.cloud.run.v2.GetExecutionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetExecutionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {google.cloud.run.v2.GetExecutionRequest} message GetExecutionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetExecutionRequest.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 GetExecutionRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GetExecutionRequest - * @instance - * @returns {Object.} JSON object - */ - GetExecutionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetExecutionRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.GetExecutionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetExecutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GetExecutionRequest"; - }; - - return GetExecutionRequest; - })(); - - v2.ListExecutionsRequest = (function() { - - /** - * Properties of a ListExecutionsRequest. - * @memberof google.cloud.run.v2 - * @interface IListExecutionsRequest - * @property {string|null} [parent] ListExecutionsRequest parent - * @property {number|null} [pageSize] ListExecutionsRequest pageSize - * @property {string|null} [pageToken] ListExecutionsRequest pageToken - * @property {boolean|null} [showDeleted] ListExecutionsRequest showDeleted - */ - - /** - * Constructs a new ListExecutionsRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListExecutionsRequest. - * @implements IListExecutionsRequest - * @constructor - * @param {google.cloud.run.v2.IListExecutionsRequest=} [properties] Properties to set - */ - function ListExecutionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListExecutionsRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @instance - */ - ListExecutionsRequest.prototype.parent = ""; - - /** - * ListExecutionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @instance - */ - ListExecutionsRequest.prototype.pageSize = 0; - - /** - * ListExecutionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @instance - */ - ListExecutionsRequest.prototype.pageToken = ""; - - /** - * ListExecutionsRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @instance - */ - ListExecutionsRequest.prototype.showDeleted = false; - - /** - * Creates a new ListExecutionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {google.cloud.run.v2.IListExecutionsRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest instance - */ - ListExecutionsRequest.create = function create(properties) { - return new ListExecutionsRequest(properties); - }; - - /** - * Encodes the specified ListExecutionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {google.cloud.run.v2.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExecutionsRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListExecutionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {google.cloud.run.v2.IListExecutionsRequest} message ListExecutionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExecutionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListExecutionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExecutionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListExecutionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListExecutionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExecutionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListExecutionsRequest message. - * @function verify - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListExecutionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListExecutionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListExecutionsRequest} ListExecutionsRequest - */ - ListExecutionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListExecutionsRequest) - return object; - var message = new $root.google.cloud.run.v2.ListExecutionsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListExecutionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {google.cloud.run.v2.ListExecutionsRequest} message ListExecutionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListExecutionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListExecutionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListExecutionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListExecutionsRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListExecutionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListExecutionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListExecutionsRequest"; - }; - - return ListExecutionsRequest; - })(); - - v2.ListExecutionsResponse = (function() { - - /** - * Properties of a ListExecutionsResponse. - * @memberof google.cloud.run.v2 - * @interface IListExecutionsResponse - * @property {Array.|null} [executions] ListExecutionsResponse executions - * @property {string|null} [nextPageToken] ListExecutionsResponse nextPageToken - */ - - /** - * Constructs a new ListExecutionsResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListExecutionsResponse. - * @implements IListExecutionsResponse - * @constructor - * @param {google.cloud.run.v2.IListExecutionsResponse=} [properties] Properties to set - */ - function ListExecutionsResponse(properties) { - this.executions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListExecutionsResponse executions. - * @member {Array.} executions - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @instance - */ - ListExecutionsResponse.prototype.executions = $util.emptyArray; - - /** - * ListExecutionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @instance - */ - ListExecutionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListExecutionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {google.cloud.run.v2.IListExecutionsResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse instance - */ - ListExecutionsResponse.create = function create(properties) { - return new ListExecutionsResponse(properties); - }; - - /** - * Encodes the specified ListExecutionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {google.cloud.run.v2.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExecutionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.executions != null && message.executions.length) - for (var i = 0; i < message.executions.length; ++i) - $root.google.cloud.run.v2.Execution.encode(message.executions[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 ListExecutionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListExecutionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {google.cloud.run.v2.IListExecutionsResponse} message ListExecutionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListExecutionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListExecutionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExecutionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListExecutionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.executions && message.executions.length)) - message.executions = []; - message.executions.push($root.google.cloud.run.v2.Execution.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListExecutionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListExecutionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListExecutionsResponse message. - * @function verify - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListExecutionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.executions != null && message.hasOwnProperty("executions")) { - if (!Array.isArray(message.executions)) - return "executions: array expected"; - for (var i = 0; i < message.executions.length; ++i) { - var error = $root.google.cloud.run.v2.Execution.verify(message.executions[i]); - if (error) - return "executions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListExecutionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListExecutionsResponse} ListExecutionsResponse - */ - ListExecutionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListExecutionsResponse) - return object; - var message = new $root.google.cloud.run.v2.ListExecutionsResponse(); - if (object.executions) { - if (!Array.isArray(object.executions)) - throw TypeError(".google.cloud.run.v2.ListExecutionsResponse.executions: array expected"); - message.executions = []; - for (var i = 0; i < object.executions.length; ++i) { - if (typeof object.executions[i] !== "object") - throw TypeError(".google.cloud.run.v2.ListExecutionsResponse.executions: object expected"); - message.executions[i] = $root.google.cloud.run.v2.Execution.fromObject(object.executions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListExecutionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {google.cloud.run.v2.ListExecutionsResponse} message ListExecutionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListExecutionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.executions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.executions && message.executions.length) { - object.executions = []; - for (var j = 0; j < message.executions.length; ++j) - object.executions[j] = $root.google.cloud.run.v2.Execution.toObject(message.executions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListExecutionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListExecutionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListExecutionsResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListExecutionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListExecutionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListExecutionsResponse"; - }; - - return ListExecutionsResponse; - })(); - - v2.DeleteExecutionRequest = (function() { - - /** - * Properties of a DeleteExecutionRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteExecutionRequest - * @property {string|null} [name] DeleteExecutionRequest name - * @property {boolean|null} [validateOnly] DeleteExecutionRequest validateOnly - * @property {string|null} [etag] DeleteExecutionRequest etag - */ - - /** - * Constructs a new DeleteExecutionRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteExecutionRequest. - * @implements IDeleteExecutionRequest - * @constructor - * @param {google.cloud.run.v2.IDeleteExecutionRequest=} [properties] Properties to set - */ - function DeleteExecutionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteExecutionRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @instance - */ - DeleteExecutionRequest.prototype.name = ""; - - /** - * DeleteExecutionRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @instance - */ - DeleteExecutionRequest.prototype.validateOnly = false; - - /** - * DeleteExecutionRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @instance - */ - DeleteExecutionRequest.prototype.etag = ""; - - /** - * Creates a new DeleteExecutionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {google.cloud.run.v2.IDeleteExecutionRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest instance - */ - DeleteExecutionRequest.create = function create(properties) { - return new DeleteExecutionRequest(properties); - }; - - /** - * Encodes the specified DeleteExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {google.cloud.run.v2.IDeleteExecutionRequest} message DeleteExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteExecutionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteExecutionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {google.cloud.run.v2.IDeleteExecutionRequest} message DeleteExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteExecutionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteExecutionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteExecutionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteExecutionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteExecutionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteExecutionRequest message. - * @function verify - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteExecutionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteExecutionRequest} DeleteExecutionRequest - */ - DeleteExecutionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteExecutionRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteExecutionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteExecutionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {google.cloud.run.v2.DeleteExecutionRequest} message DeleteExecutionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteExecutionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteExecutionRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteExecutionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteExecutionRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.DeleteExecutionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteExecutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.DeleteExecutionRequest"; - }; - - return DeleteExecutionRequest; - })(); - - v2.CancelExecutionRequest = (function() { - - /** - * Properties of a CancelExecutionRequest. - * @memberof google.cloud.run.v2 - * @interface ICancelExecutionRequest - * @property {string|null} [name] CancelExecutionRequest name - * @property {boolean|null} [validateOnly] CancelExecutionRequest validateOnly - * @property {string|null} [etag] CancelExecutionRequest etag - */ - - /** - * Constructs a new CancelExecutionRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CancelExecutionRequest. - * @implements ICancelExecutionRequest - * @constructor - * @param {google.cloud.run.v2.ICancelExecutionRequest=} [properties] Properties to set - */ - function CancelExecutionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelExecutionRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @instance - */ - CancelExecutionRequest.prototype.name = ""; - - /** - * CancelExecutionRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @instance - */ - CancelExecutionRequest.prototype.validateOnly = false; - - /** - * CancelExecutionRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @instance - */ - CancelExecutionRequest.prototype.etag = ""; - - /** - * Creates a new CancelExecutionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {google.cloud.run.v2.ICancelExecutionRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest instance - */ - CancelExecutionRequest.create = function create(properties) { - return new CancelExecutionRequest(properties); - }; - - /** - * Encodes the specified CancelExecutionRequest message. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {google.cloud.run.v2.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelExecutionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified CancelExecutionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CancelExecutionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {google.cloud.run.v2.ICancelExecutionRequest} message CancelExecutionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelExecutionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelExecutionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelExecutionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CancelExecutionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelExecutionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelExecutionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelExecutionRequest message. - * @function verify - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelExecutionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a CancelExecutionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CancelExecutionRequest} CancelExecutionRequest - */ - CancelExecutionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CancelExecutionRequest) - return object; - var message = new $root.google.cloud.run.v2.CancelExecutionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a CancelExecutionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {google.cloud.run.v2.CancelExecutionRequest} message CancelExecutionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelExecutionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this CancelExecutionRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @instance - * @returns {Object.} JSON object - */ - CancelExecutionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelExecutionRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.CancelExecutionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelExecutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.CancelExecutionRequest"; - }; - - return CancelExecutionRequest; - })(); - - v2.Execution = (function() { - - /** - * Properties of an Execution. - * @memberof google.cloud.run.v2 - * @interface IExecution - * @property {string|null} [name] Execution name - * @property {string|null} [uid] Execution uid - * @property {string|null} [creator] Execution creator - * @property {number|Long|null} [generation] Execution generation - * @property {Object.|null} [labels] Execution labels - * @property {Object.|null} [annotations] Execution annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Execution createTime - * @property {google.protobuf.ITimestamp|null} [startTime] Execution startTime - * @property {google.protobuf.ITimestamp|null} [completionTime] Execution completionTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Execution updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Execution deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Execution expireTime - * @property {google.api.LaunchStage|null} [launchStage] Execution launchStage - * @property {string|null} [job] Execution job - * @property {number|null} [parallelism] Execution parallelism - * @property {number|null} [taskCount] Execution taskCount - * @property {google.cloud.run.v2.ITaskTemplate|null} [template] Execution template - * @property {boolean|null} [reconciling] Execution reconciling - * @property {Array.|null} [conditions] Execution conditions - * @property {number|Long|null} [observedGeneration] Execution observedGeneration - * @property {number|null} [runningCount] Execution runningCount - * @property {number|null} [succeededCount] Execution succeededCount - * @property {number|null} [failedCount] Execution failedCount - * @property {number|null} [cancelledCount] Execution cancelledCount - * @property {number|null} [retriedCount] Execution retriedCount - * @property {string|null} [logUri] Execution logUri - * @property {boolean|null} [satisfiesPzs] Execution satisfiesPzs - * @property {string|null} [etag] Execution etag - */ - - /** - * Constructs a new Execution. - * @memberof google.cloud.run.v2 - * @classdesc Represents an Execution. - * @implements IExecution - * @constructor - * @param {google.cloud.run.v2.IExecution=} [properties] Properties to set - */ - function Execution(properties) { - this.labels = {}; - this.annotations = {}; - this.conditions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Execution name. - * @member {string} name - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.name = ""; - - /** - * Execution uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.uid = ""; - - /** - * Execution creator. - * @member {string} creator - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.creator = ""; - - /** - * Execution generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Execution labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.labels = $util.emptyObject; - - /** - * Execution annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.annotations = $util.emptyObject; - - /** - * Execution createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.createTime = null; - - /** - * Execution startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.startTime = null; - - /** - * Execution completionTime. - * @member {google.protobuf.ITimestamp|null|undefined} completionTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.completionTime = null; - - /** - * Execution updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.updateTime = null; - - /** - * Execution deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.deleteTime = null; - - /** - * Execution expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.expireTime = null; - - /** - * Execution launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.launchStage = 0; - - /** - * Execution job. - * @member {string} job - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.job = ""; - - /** - * Execution parallelism. - * @member {number} parallelism - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.parallelism = 0; - - /** - * Execution taskCount. - * @member {number} taskCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.taskCount = 0; - - /** - * Execution template. - * @member {google.cloud.run.v2.ITaskTemplate|null|undefined} template - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.template = null; - - /** - * Execution reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.reconciling = false; - - /** - * Execution conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.conditions = $util.emptyArray; - - /** - * Execution observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Execution runningCount. - * @member {number} runningCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.runningCount = 0; - - /** - * Execution succeededCount. - * @member {number} succeededCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.succeededCount = 0; - - /** - * Execution failedCount. - * @member {number} failedCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.failedCount = 0; - - /** - * Execution cancelledCount. - * @member {number} cancelledCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.cancelledCount = 0; - - /** - * Execution retriedCount. - * @member {number} retriedCount - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.retriedCount = 0; - - /** - * Execution logUri. - * @member {string} logUri - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.logUri = ""; - - /** - * Execution satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.satisfiesPzs = false; - - /** - * Execution etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Execution - * @instance - */ - Execution.prototype.etag = ""; - - /** - * Creates a new Execution instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Execution - * @static - * @param {google.cloud.run.v2.IExecution=} [properties] Properties to set - * @returns {google.cloud.run.v2.Execution} Execution instance - */ - Execution.create = function create(properties) { - return new Execution(properties); - }; - - /** - * Encodes the specified Execution message. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Execution - * @static - * @param {google.cloud.run.v2.IExecution} message Execution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Execution.encode = function encode(message, writer) { - if (!writer) - 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.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) - $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.launchStage); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.job); - if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.parallelism); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.taskCount); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.run.v2.TaskTemplate.encode(message.template, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reconciling); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 18, wireType 0 =*/144).int64(message.observedGeneration); - if (message.runningCount != null && Object.hasOwnProperty.call(message, "runningCount")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.runningCount); - if (message.succeededCount != null && Object.hasOwnProperty.call(message, "succeededCount")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.succeededCount); - if (message.failedCount != null && Object.hasOwnProperty.call(message, "failedCount")) - writer.uint32(/* id 21, wireType 0 =*/168).int32(message.failedCount); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.cancelledCount != null && Object.hasOwnProperty.call(message, "cancelledCount")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.cancelledCount); - if (message.retriedCount != null && Object.hasOwnProperty.call(message, "retriedCount")) - writer.uint32(/* id 25, wireType 0 =*/200).int32(message.retriedCount); - if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) - writer.uint32(/* id 26, wireType 2 =*/210).string(message.logUri); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.satisfiesPzs); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 32, wireType 2 =*/258).string(message.creator); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Execution message, length delimited. Does not implicitly {@link google.cloud.run.v2.Execution.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Execution - * @static - * @param {google.cloud.run.v2.IExecution} message Execution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Execution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Execution message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Execution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Execution} Execution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Execution.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Execution(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 32: { - message.creator = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 5: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 22: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.launchStage = reader.int32(); - break; - } - case 12: { - message.job = reader.string(); - break; - } - case 13: { - message.parallelism = reader.int32(); - break; - } - case 14: { - message.taskCount = reader.int32(); - break; - } - case 15: { - message.template = $root.google.cloud.run.v2.TaskTemplate.decode(reader, reader.uint32()); - break; - } - case 16: { - message.reconciling = reader.bool(); - break; - } - case 17: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 18: { - message.observedGeneration = reader.int64(); - break; - } - case 19: { - message.runningCount = reader.int32(); - break; - } - case 20: { - message.succeededCount = reader.int32(); - break; - } - case 21: { - message.failedCount = reader.int32(); - break; - } - case 24: { - message.cancelledCount = reader.int32(); - break; - } - case 25: { - message.retriedCount = reader.int32(); - break; - } - case 26: { - message.logUri = reader.string(); - break; - } - case 27: { - message.satisfiesPzs = reader.bool(); - break; - } - case 99: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Execution message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Execution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Execution} Execution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Execution.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Execution message. - * @function verify - * @memberof google.cloud.run.v2.Execution - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Execution.verify = function verify(message) { - if (typeof message !== "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.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.completionTime != null && message.hasOwnProperty("completionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.completionTime); - if (error) - return "completionTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - 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.job != null && message.hasOwnProperty("job")) - if (!$util.isString(message.job)) - return "job: string expected"; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (!$util.isInteger(message.parallelism)) - return "parallelism: integer expected"; - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount)) - return "taskCount: integer expected"; - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.run.v2.TaskTemplate.verify(message.template); - if (error) - return "template." + error; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.runningCount != null && message.hasOwnProperty("runningCount")) - if (!$util.isInteger(message.runningCount)) - return "runningCount: integer expected"; - if (message.succeededCount != null && message.hasOwnProperty("succeededCount")) - if (!$util.isInteger(message.succeededCount)) - return "succeededCount: integer expected"; - if (message.failedCount != null && message.hasOwnProperty("failedCount")) - if (!$util.isInteger(message.failedCount)) - return "failedCount: integer expected"; - if (message.cancelledCount != null && message.hasOwnProperty("cancelledCount")) - if (!$util.isInteger(message.cancelledCount)) - return "cancelledCount: integer expected"; - if (message.retriedCount != null && message.hasOwnProperty("retriedCount")) - if (!$util.isInteger(message.retriedCount)) - return "retriedCount: integer expected"; - if (message.logUri != null && message.hasOwnProperty("logUri")) - if (!$util.isString(message.logUri)) - return "logUri: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an Execution message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Execution - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Execution} Execution - */ - Execution.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Execution) - return object; - var message = new $root.google.cloud.run.v2.Execution(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.creator != null) - message.creator = String(object.creator); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.Execution.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Execution.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.completionTime != null) { - if (typeof object.completionTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.completionTime: object expected"); - message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Execution.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - 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.job != null) - message.job = String(object.job); - if (object.parallelism != null) - message.parallelism = object.parallelism | 0; - if (object.taskCount != null) - message.taskCount = object.taskCount | 0; - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.run.v2.Execution.template: object expected"); - message.template = $root.google.cloud.run.v2.TaskTemplate.fromObject(object.template); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Execution.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Execution.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.runningCount != null) - message.runningCount = object.runningCount | 0; - if (object.succeededCount != null) - message.succeededCount = object.succeededCount | 0; - if (object.failedCount != null) - message.failedCount = object.failedCount | 0; - if (object.cancelledCount != null) - message.cancelledCount = object.cancelledCount | 0; - if (object.retriedCount != null) - message.retriedCount = object.retriedCount | 0; - if (object.logUri != null) - message.logUri = String(object.logUri); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an Execution message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Execution - * @static - * @param {google.cloud.run.v2.Execution} message Execution - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Execution.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.conditions = []; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.completionTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.job = ""; - object.parallelism = 0; - object.taskCount = 0; - object.template = null; - object.reconciling = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.runningCount = 0; - object.succeededCount = 0; - object.failedCount = 0; - object.startTime = null; - object.cancelledCount = 0; - object.retriedCount = 0; - object.logUri = ""; - object.satisfiesPzs = false; - object.creator = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.completionTime != null && message.hasOwnProperty("completionTime")) - object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - 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.job != null && message.hasOwnProperty("job")) - object.job = message.job; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - object.parallelism = message.parallelism; - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - object.taskCount = message.taskCount; - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.run.v2.TaskTemplate.toObject(message.template, options); - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.runningCount != null && message.hasOwnProperty("runningCount")) - object.runningCount = message.runningCount; - if (message.succeededCount != null && message.hasOwnProperty("succeededCount")) - object.succeededCount = message.succeededCount; - if (message.failedCount != null && message.hasOwnProperty("failedCount")) - object.failedCount = message.failedCount; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelledCount != null && message.hasOwnProperty("cancelledCount")) - object.cancelledCount = message.cancelledCount; - if (message.retriedCount != null && message.hasOwnProperty("retriedCount")) - object.retriedCount = message.retriedCount; - if (message.logUri != null && message.hasOwnProperty("logUri")) - object.logUri = message.logUri; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Execution to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Execution - * @instance - * @returns {Object.} JSON object - */ - Execution.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Execution - * @function getTypeUrl - * @memberof google.cloud.run.v2.Execution - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Execution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Execution"; - }; - - return Execution; - })(); - - v2.TaskTemplate = (function() { - - /** - * Properties of a TaskTemplate. - * @memberof google.cloud.run.v2 - * @interface ITaskTemplate - * @property {Array.|null} [containers] TaskTemplate containers - * @property {Array.|null} [volumes] TaskTemplate volumes - * @property {number|null} [maxRetries] TaskTemplate maxRetries - * @property {google.protobuf.IDuration|null} [timeout] TaskTemplate timeout - * @property {string|null} [serviceAccount] TaskTemplate serviceAccount - * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] TaskTemplate executionEnvironment - * @property {string|null} [encryptionKey] TaskTemplate encryptionKey - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] TaskTemplate vpcAccess - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] TaskTemplate nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] TaskTemplate gpuZonalRedundancyDisabled - */ - - /** - * Constructs a new TaskTemplate. - * @memberof google.cloud.run.v2 - * @classdesc Represents a TaskTemplate. - * @implements ITaskTemplate - * @constructor - * @param {google.cloud.run.v2.ITaskTemplate=} [properties] Properties to set - */ - function TaskTemplate(properties) { - this.containers = []; - 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]]; - } - - /** - * TaskTemplate containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.containers = $util.emptyArray; - - /** - * TaskTemplate volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.volumes = $util.emptyArray; - - /** - * TaskTemplate maxRetries. - * @member {number|null|undefined} maxRetries - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.maxRetries = null; - - /** - * TaskTemplate timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.timeout = null; - - /** - * TaskTemplate serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.serviceAccount = ""; - - /** - * TaskTemplate executionEnvironment. - * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.executionEnvironment = 0; - - /** - * TaskTemplate encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.encryptionKey = ""; - - /** - * TaskTemplate vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.vpcAccess = null; - - /** - * TaskTemplate nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.nodeSelector = null; - - /** - * TaskTemplate gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - TaskTemplate.prototype.gpuZonalRedundancyDisabled = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TaskTemplate retries. - * @member {"maxRetries"|undefined} retries - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - */ - Object.defineProperty(TaskTemplate.prototype, "retries", { - get: $util.oneOfGetter($oneOfFields = ["maxRetries"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(TaskTemplate.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TaskTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {google.cloud.run.v2.ITaskTemplate=} [properties] Properties to set - * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate instance - */ - TaskTemplate.create = function create(properties) { - return new TaskTemplate(properties); - }; - - /** - * Encodes the specified TaskTemplate message. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {google.cloud.run.v2.ITaskTemplate} message TaskTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.maxRetries != null && Object.hasOwnProperty.call(message, "maxRetries")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxRetries); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); - if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.executionEnvironment); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.encryptionKey); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.gpuZonalRedundancyDisabled); - return writer; - }; - - /** - * Encodes the specified TaskTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {google.cloud.run.v2.ITaskTemplate} message TaskTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TaskTemplate(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 3: { - message.maxRetries = reader.int32(); - break; - } - case 4: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.serviceAccount = reader.string(); - break; - } - case 6: { - message.executionEnvironment = reader.int32(); - break; - } - case 7: { - message.encryptionKey = reader.string(); - break; - } - case 8: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 11: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 12: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskTemplate message. - * @function verify - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) { - properties.retries = 1; - if (!$util.isInteger(message.maxRetries)) - return "maxRetries: integer expected"; - } - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - switch (message.executionEnvironment) { - default: - return "executionEnvironment: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - return null; - }; - - /** - * Creates a TaskTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.TaskTemplate} TaskTemplate - */ - TaskTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.TaskTemplate) - return object; - var message = new $root.google.cloud.run.v2.TaskTemplate(); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.TaskTemplate.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.TaskTemplate.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.TaskTemplate.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.TaskTemplate.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - if (object.maxRetries != null) - message.maxRetries = object.maxRetries | 0; - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.run.v2.TaskTemplate.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - switch (object.executionEnvironment) { - default: - if (typeof object.executionEnvironment === "number") { - message.executionEnvironment = object.executionEnvironment; - break; - } - break; - case "EXECUTION_ENVIRONMENT_UNSPECIFIED": - case 0: - message.executionEnvironment = 0; - break; - case "EXECUTION_ENVIRONMENT_GEN1": - case 1: - message.executionEnvironment = 1; - break; - case "EXECUTION_ENVIRONMENT_GEN2": - case 2: - message.executionEnvironment = 2; - break; - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.TaskTemplate.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.TaskTemplate.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - return message; - }; - - /** - * Creates a plain object from a TaskTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {google.cloud.run.v2.TaskTemplate} message TaskTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - } - if (options.defaults) { - object.timeout = null; - object.serviceAccount = ""; - object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; - object.encryptionKey = ""; - object.vpcAccess = null; - object.nodeSelector = null; - } - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) { - object.maxRetries = message.maxRetries; - if (options.oneofs) - object.retries = "maxRetries"; - } - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - return object; - }; - - /** - * Converts this TaskTemplate to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.TaskTemplate - * @instance - * @returns {Object.} JSON object - */ - TaskTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskTemplate - * @function getTypeUrl - * @memberof google.cloud.run.v2.TaskTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.TaskTemplate"; - }; - - return TaskTemplate; - })(); - - v2.Container = (function() { - - /** - * Properties of a Container. - * @memberof google.cloud.run.v2 - * @interface IContainer - * @property {string|null} [name] Container name - * @property {string|null} [image] Container image - * @property {google.cloud.run.v2.ISourceCode|null} [sourceCode] Container sourceCode - * @property {Array.|null} [command] Container command - * @property {Array.|null} [args] Container args - * @property {Array.|null} [env] Container env - * @property {google.cloud.run.v2.IResourceRequirements|null} [resources] Container resources - * @property {Array.|null} [ports] Container ports - * @property {Array.|null} [volumeMounts] Container volumeMounts - * @property {string|null} [workingDir] Container workingDir - * @property {google.cloud.run.v2.IProbe|null} [livenessProbe] Container livenessProbe - * @property {google.cloud.run.v2.IProbe|null} [startupProbe] Container startupProbe - * @property {google.cloud.run.v2.IProbe|null} [readinessProbe] Container readinessProbe - * @property {Array.|null} [dependsOn] Container dependsOn - * @property {string|null} [baseImageUri] Container baseImageUri - * @property {google.cloud.run.v2.IBuildInfo|null} [buildInfo] Container buildInfo - */ - - /** - * Constructs a new Container. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Container. - * @implements IContainer - * @constructor - * @param {google.cloud.run.v2.IContainer=} [properties] Properties to set - */ - function Container(properties) { - this.command = []; - this.args = []; - this.env = []; - this.ports = []; - this.volumeMounts = []; - this.dependsOn = []; - if (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 name. - * @member {string} name - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.name = ""; - - /** - * Container image. - * @member {string} image - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.image = ""; - - /** - * Container sourceCode. - * @member {google.cloud.run.v2.ISourceCode|null|undefined} sourceCode - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.sourceCode = null; - - /** - * Container command. - * @member {Array.} command - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.command = $util.emptyArray; - - /** - * Container args. - * @member {Array.} args - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.args = $util.emptyArray; - - /** - * Container env. - * @member {Array.} env - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.env = $util.emptyArray; - - /** - * Container resources. - * @member {google.cloud.run.v2.IResourceRequirements|null|undefined} resources - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.resources = null; - - /** - * Container ports. - * @member {Array.} ports - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.ports = $util.emptyArray; - - /** - * Container volumeMounts. - * @member {Array.} volumeMounts - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.volumeMounts = $util.emptyArray; - - /** - * Container workingDir. - * @member {string} workingDir - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.workingDir = ""; - - /** - * Container livenessProbe. - * @member {google.cloud.run.v2.IProbe|null|undefined} livenessProbe - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.livenessProbe = null; - - /** - * Container startupProbe. - * @member {google.cloud.run.v2.IProbe|null|undefined} startupProbe - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.startupProbe = null; - - /** - * Container readinessProbe. - * @member {google.cloud.run.v2.IProbe|null|undefined} readinessProbe - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.readinessProbe = null; - - /** - * Container dependsOn. - * @member {Array.} dependsOn - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.dependsOn = $util.emptyArray; - - /** - * Container baseImageUri. - * @member {string} baseImageUri - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.baseImageUri = ""; - - /** - * Container buildInfo. - * @member {google.cloud.run.v2.IBuildInfo|null|undefined} buildInfo - * @memberof google.cloud.run.v2.Container - * @instance - */ - Container.prototype.buildInfo = null; - - /** - * Creates a new Container instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Container - * @static - * @param {google.cloud.run.v2.IContainer=} [properties] Properties to set - * @returns {google.cloud.run.v2.Container} Container instance - */ - Container.create = function create(properties) { - return new Container(properties); - }; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.run.v2.Container.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Container - * @static - * @param {google.cloud.run.v2.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.image); - if (message.command != null && message.command.length) - for (var i = 0; i < message.command.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.command[i]); - if (message.args != null && message.args.length) - for (var i = 0; i < message.args.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.args[i]); - if (message.env != null && message.env.length) - for (var i = 0; i < message.env.length; ++i) - $root.google.cloud.run.v2.EnvVar.encode(message.env[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.resources != null && Object.hasOwnProperty.call(message, "resources")) - $root.google.cloud.run.v2.ResourceRequirements.encode(message.resources, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.ports != null && message.ports.length) - for (var i = 0; i < message.ports.length; ++i) - $root.google.cloud.run.v2.ContainerPort.encode(message.ports[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.volumeMounts != null && message.volumeMounts.length) - for (var i = 0; i < message.volumeMounts.length; ++i) - $root.google.cloud.run.v2.VolumeMount.encode(message.volumeMounts[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.workingDir != null && Object.hasOwnProperty.call(message, "workingDir")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.workingDir); - if (message.livenessProbe != null && Object.hasOwnProperty.call(message, "livenessProbe")) - $root.google.cloud.run.v2.Probe.encode(message.livenessProbe, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.startupProbe != null && Object.hasOwnProperty.call(message, "startupProbe")) - $root.google.cloud.run.v2.Probe.encode(message.startupProbe, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.dependsOn != null && message.dependsOn.length) - for (var i = 0; i < message.dependsOn.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.dependsOn[i]); - if (message.baseImageUri != null && Object.hasOwnProperty.call(message, "baseImageUri")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.baseImageUri); - if (message.readinessProbe != null && Object.hasOwnProperty.call(message, "readinessProbe")) - $root.google.cloud.run.v2.Probe.encode(message.readinessProbe, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.buildInfo != null && Object.hasOwnProperty.call(message, "buildInfo")) - $root.google.cloud.run.v2.BuildInfo.encode(message.buildInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.sourceCode != null && Object.hasOwnProperty.call(message, "sourceCode")) - $root.google.cloud.run.v2.SourceCode.encode(message.sourceCode, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.run.v2.Container.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Container - * @static - * @param {google.cloud.run.v2.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.run.v2.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Container(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.image = reader.string(); - break; - } - case 17: { - message.sourceCode = $root.google.cloud.run.v2.SourceCode.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.command && message.command.length)) - message.command = []; - message.command.push(reader.string()); - break; - } - case 4: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 5: { - if (!(message.env && message.env.length)) - message.env = []; - message.env.push($root.google.cloud.run.v2.EnvVar.decode(reader, reader.uint32())); - break; - } - case 6: { - message.resources = $root.google.cloud.run.v2.ResourceRequirements.decode(reader, reader.uint32()); - break; - } - case 7: { - if (!(message.ports && message.ports.length)) - message.ports = []; - message.ports.push($root.google.cloud.run.v2.ContainerPort.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.volumeMounts && message.volumeMounts.length)) - message.volumeMounts = []; - message.volumeMounts.push($root.google.cloud.run.v2.VolumeMount.decode(reader, reader.uint32())); - break; - } - case 9: { - message.workingDir = reader.string(); - break; - } - case 10: { - message.livenessProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); - break; - } - case 11: { - message.startupProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); - break; - } - case 14: { - message.readinessProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); - break; - } - case 12: { - if (!(message.dependsOn && message.dependsOn.length)) - message.dependsOn = []; - message.dependsOn.push(reader.string()); - break; - } - case 13: { - message.baseImageUri = reader.string(); - break; - } - case 15: { - message.buildInfo = $root.google.cloud.run.v2.BuildInfo.decode(reader, reader.uint32()); - 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.run.v2.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.image != null && message.hasOwnProperty("image")) - if (!$util.isString(message.image)) - return "image: string expected"; - if (message.sourceCode != null && message.hasOwnProperty("sourceCode")) { - var error = $root.google.cloud.run.v2.SourceCode.verify(message.sourceCode); - if (error) - return "sourceCode." + error; - } - if (message.command != null && message.hasOwnProperty("command")) { - if (!Array.isArray(message.command)) - return "command: array expected"; - for (var i = 0; i < message.command.length; ++i) - if (!$util.isString(message.command[i])) - return "command: string[] expected"; - } - if (message.args != null && message.hasOwnProperty("args")) { - if (!Array.isArray(message.args)) - return "args: array expected"; - for (var i = 0; i < message.args.length; ++i) - if (!$util.isString(message.args[i])) - return "args: string[] expected"; - } - if (message.env != null && message.hasOwnProperty("env")) { - if (!Array.isArray(message.env)) - return "env: array expected"; - for (var i = 0; i < message.env.length; ++i) { - var error = $root.google.cloud.run.v2.EnvVar.verify(message.env[i]); - if (error) - return "env." + error; - } - } - if (message.resources != null && message.hasOwnProperty("resources")) { - var error = $root.google.cloud.run.v2.ResourceRequirements.verify(message.resources); - if (error) - return "resources." + error; - } - if (message.ports != null && message.hasOwnProperty("ports")) { - if (!Array.isArray(message.ports)) - return "ports: array expected"; - for (var i = 0; i < message.ports.length; ++i) { - var error = $root.google.cloud.run.v2.ContainerPort.verify(message.ports[i]); - if (error) - return "ports." + error; - } - } - if (message.volumeMounts != null && message.hasOwnProperty("volumeMounts")) { - if (!Array.isArray(message.volumeMounts)) - return "volumeMounts: array expected"; - for (var i = 0; i < message.volumeMounts.length; ++i) { - var error = $root.google.cloud.run.v2.VolumeMount.verify(message.volumeMounts[i]); - if (error) - return "volumeMounts." + error; - } - } - if (message.workingDir != null && message.hasOwnProperty("workingDir")) - if (!$util.isString(message.workingDir)) - return "workingDir: string expected"; - if (message.livenessProbe != null && message.hasOwnProperty("livenessProbe")) { - var error = $root.google.cloud.run.v2.Probe.verify(message.livenessProbe); - if (error) - return "livenessProbe." + error; - } - if (message.startupProbe != null && message.hasOwnProperty("startupProbe")) { - var error = $root.google.cloud.run.v2.Probe.verify(message.startupProbe); - if (error) - return "startupProbe." + error; - } - if (message.readinessProbe != null && message.hasOwnProperty("readinessProbe")) { - var error = $root.google.cloud.run.v2.Probe.verify(message.readinessProbe); - if (error) - return "readinessProbe." + error; - } - if (message.dependsOn != null && message.hasOwnProperty("dependsOn")) { - if (!Array.isArray(message.dependsOn)) - return "dependsOn: array expected"; - for (var i = 0; i < message.dependsOn.length; ++i) - if (!$util.isString(message.dependsOn[i])) - return "dependsOn: string[] expected"; - } - if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) - if (!$util.isString(message.baseImageUri)) - return "baseImageUri: string expected"; - if (message.buildInfo != null && message.hasOwnProperty("buildInfo")) { - var error = $root.google.cloud.run.v2.BuildInfo.verify(message.buildInfo); - if (error) - return "buildInfo." + error; - } - return null; - }; - - /** - * Creates a Container message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Container - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Container} Container - */ - Container.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Container) - return object; - var message = new $root.google.cloud.run.v2.Container(); - if (object.name != null) - message.name = String(object.name); - if (object.image != null) - message.image = String(object.image); - if (object.sourceCode != null) { - if (typeof object.sourceCode !== "object") - throw TypeError(".google.cloud.run.v2.Container.sourceCode: object expected"); - message.sourceCode = $root.google.cloud.run.v2.SourceCode.fromObject(object.sourceCode); - } - if (object.command) { - if (!Array.isArray(object.command)) - throw TypeError(".google.cloud.run.v2.Container.command: array expected"); - message.command = []; - for (var i = 0; i < object.command.length; ++i) - message.command[i] = String(object.command[i]); - } - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.run.v2.Container.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.env) { - if (!Array.isArray(object.env)) - throw TypeError(".google.cloud.run.v2.Container.env: array expected"); - message.env = []; - for (var i = 0; i < object.env.length; ++i) { - if (typeof object.env[i] !== "object") - throw TypeError(".google.cloud.run.v2.Container.env: object expected"); - message.env[i] = $root.google.cloud.run.v2.EnvVar.fromObject(object.env[i]); - } - } - if (object.resources != null) { - if (typeof object.resources !== "object") - throw TypeError(".google.cloud.run.v2.Container.resources: object expected"); - message.resources = $root.google.cloud.run.v2.ResourceRequirements.fromObject(object.resources); - } - if (object.ports) { - if (!Array.isArray(object.ports)) - throw TypeError(".google.cloud.run.v2.Container.ports: array expected"); - message.ports = []; - for (var i = 0; i < object.ports.length; ++i) { - if (typeof object.ports[i] !== "object") - throw TypeError(".google.cloud.run.v2.Container.ports: object expected"); - message.ports[i] = $root.google.cloud.run.v2.ContainerPort.fromObject(object.ports[i]); - } - } - if (object.volumeMounts) { - if (!Array.isArray(object.volumeMounts)) - throw TypeError(".google.cloud.run.v2.Container.volumeMounts: array expected"); - message.volumeMounts = []; - for (var i = 0; i < object.volumeMounts.length; ++i) { - if (typeof object.volumeMounts[i] !== "object") - throw TypeError(".google.cloud.run.v2.Container.volumeMounts: object expected"); - message.volumeMounts[i] = $root.google.cloud.run.v2.VolumeMount.fromObject(object.volumeMounts[i]); - } - } - if (object.workingDir != null) - message.workingDir = String(object.workingDir); - if (object.livenessProbe != null) { - if (typeof object.livenessProbe !== "object") - throw TypeError(".google.cloud.run.v2.Container.livenessProbe: object expected"); - message.livenessProbe = $root.google.cloud.run.v2.Probe.fromObject(object.livenessProbe); - } - if (object.startupProbe != null) { - if (typeof object.startupProbe !== "object") - throw TypeError(".google.cloud.run.v2.Container.startupProbe: object expected"); - message.startupProbe = $root.google.cloud.run.v2.Probe.fromObject(object.startupProbe); - } - if (object.readinessProbe != null) { - if (typeof object.readinessProbe !== "object") - throw TypeError(".google.cloud.run.v2.Container.readinessProbe: object expected"); - message.readinessProbe = $root.google.cloud.run.v2.Probe.fromObject(object.readinessProbe); - } - if (object.dependsOn) { - if (!Array.isArray(object.dependsOn)) - throw TypeError(".google.cloud.run.v2.Container.dependsOn: array expected"); - message.dependsOn = []; - for (var i = 0; i < object.dependsOn.length; ++i) - message.dependsOn[i] = String(object.dependsOn[i]); - } - if (object.baseImageUri != null) - message.baseImageUri = String(object.baseImageUri); - if (object.buildInfo != null) { - if (typeof object.buildInfo !== "object") - throw TypeError(".google.cloud.run.v2.Container.buildInfo: object expected"); - message.buildInfo = $root.google.cloud.run.v2.BuildInfo.fromObject(object.buildInfo); - } - return message; - }; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Container - * @static - * @param {google.cloud.run.v2.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.command = []; - object.args = []; - object.env = []; - object.ports = []; - object.volumeMounts = []; - object.dependsOn = []; - } - if (options.defaults) { - object.name = ""; - object.image = ""; - object.resources = null; - object.workingDir = ""; - object.livenessProbe = null; - object.startupProbe = null; - object.baseImageUri = ""; - object.readinessProbe = null; - object.buildInfo = null; - object.sourceCode = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.image != null && message.hasOwnProperty("image")) - object.image = message.image; - if (message.command && message.command.length) { - object.command = []; - for (var j = 0; j < message.command.length; ++j) - object.command[j] = message.command[j]; - } - if (message.args && message.args.length) { - object.args = []; - for (var j = 0; j < message.args.length; ++j) - object.args[j] = message.args[j]; - } - if (message.env && message.env.length) { - object.env = []; - for (var j = 0; j < message.env.length; ++j) - object.env[j] = $root.google.cloud.run.v2.EnvVar.toObject(message.env[j], options); - } - if (message.resources != null && message.hasOwnProperty("resources")) - object.resources = $root.google.cloud.run.v2.ResourceRequirements.toObject(message.resources, options); - if (message.ports && message.ports.length) { - object.ports = []; - for (var j = 0; j < message.ports.length; ++j) - object.ports[j] = $root.google.cloud.run.v2.ContainerPort.toObject(message.ports[j], options); - } - if (message.volumeMounts && message.volumeMounts.length) { - object.volumeMounts = []; - for (var j = 0; j < message.volumeMounts.length; ++j) - object.volumeMounts[j] = $root.google.cloud.run.v2.VolumeMount.toObject(message.volumeMounts[j], options); - } - if (message.workingDir != null && message.hasOwnProperty("workingDir")) - object.workingDir = message.workingDir; - if (message.livenessProbe != null && message.hasOwnProperty("livenessProbe")) - object.livenessProbe = $root.google.cloud.run.v2.Probe.toObject(message.livenessProbe, options); - if (message.startupProbe != null && message.hasOwnProperty("startupProbe")) - object.startupProbe = $root.google.cloud.run.v2.Probe.toObject(message.startupProbe, options); - if (message.dependsOn && message.dependsOn.length) { - object.dependsOn = []; - for (var j = 0; j < message.dependsOn.length; ++j) - object.dependsOn[j] = message.dependsOn[j]; - } - if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) - object.baseImageUri = message.baseImageUri; - if (message.readinessProbe != null && message.hasOwnProperty("readinessProbe")) - object.readinessProbe = $root.google.cloud.run.v2.Probe.toObject(message.readinessProbe, options); - if (message.buildInfo != null && message.hasOwnProperty("buildInfo")) - object.buildInfo = $root.google.cloud.run.v2.BuildInfo.toObject(message.buildInfo, options); - if (message.sourceCode != null && message.hasOwnProperty("sourceCode")) - object.sourceCode = $root.google.cloud.run.v2.SourceCode.toObject(message.sourceCode, options); - return object; - }; - - /** - * Converts this Container to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Container"; - }; - - return Container; - })(); - - v2.ResourceRequirements = (function() { - - /** - * Properties of a ResourceRequirements. - * @memberof google.cloud.run.v2 - * @interface IResourceRequirements - * @property {Object.|null} [limits] ResourceRequirements limits - * @property {boolean|null} [cpuIdle] ResourceRequirements cpuIdle - * @property {boolean|null} [startupCpuBoost] ResourceRequirements startupCpuBoost - */ - - /** - * Constructs a new ResourceRequirements. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ResourceRequirements. - * @implements IResourceRequirements - * @constructor - * @param {google.cloud.run.v2.IResourceRequirements=} [properties] Properties to set - */ - function ResourceRequirements(properties) { - this.limits = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceRequirements limits. - * @member {Object.} limits - * @memberof google.cloud.run.v2.ResourceRequirements - * @instance - */ - ResourceRequirements.prototype.limits = $util.emptyObject; - - /** - * ResourceRequirements cpuIdle. - * @member {boolean} cpuIdle - * @memberof google.cloud.run.v2.ResourceRequirements - * @instance - */ - ResourceRequirements.prototype.cpuIdle = false; - - /** - * ResourceRequirements startupCpuBoost. - * @member {boolean} startupCpuBoost - * @memberof google.cloud.run.v2.ResourceRequirements - * @instance - */ - ResourceRequirements.prototype.startupCpuBoost = false; - - /** - * Creates a new ResourceRequirements instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {google.cloud.run.v2.IResourceRequirements=} [properties] Properties to set - * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements instance - */ - ResourceRequirements.create = function create(properties) { - return new ResourceRequirements(properties); - }; - - /** - * Encodes the specified ResourceRequirements message. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {google.cloud.run.v2.IResourceRequirements} message ResourceRequirements message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceRequirements.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.limits != null && Object.hasOwnProperty.call(message, "limits")) - for (var keys = Object.keys(message.limits), 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.limits[keys[i]]).ldelim(); - if (message.cpuIdle != null && Object.hasOwnProperty.call(message, "cpuIdle")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.cpuIdle); - if (message.startupCpuBoost != null && Object.hasOwnProperty.call(message, "startupCpuBoost")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.startupCpuBoost); - return writer; - }; - - /** - * Encodes the specified ResourceRequirements message, length delimited. Does not implicitly {@link google.cloud.run.v2.ResourceRequirements.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {google.cloud.run.v2.IResourceRequirements} message ResourceRequirements message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceRequirements.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceRequirements message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceRequirements.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ResourceRequirements(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.limits === $util.emptyObject) - message.limits = {}; - 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.limits[key] = value; - break; - } - case 2: { - message.cpuIdle = reader.bool(); - break; - } - case 3: { - message.startupCpuBoost = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceRequirements message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceRequirements.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceRequirements message. - * @function verify - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceRequirements.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.limits != null && message.hasOwnProperty("limits")) { - if (!$util.isObject(message.limits)) - return "limits: object expected"; - var key = Object.keys(message.limits); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.limits[key[i]])) - return "limits: string{k:string} expected"; - } - if (message.cpuIdle != null && message.hasOwnProperty("cpuIdle")) - if (typeof message.cpuIdle !== "boolean") - return "cpuIdle: boolean expected"; - if (message.startupCpuBoost != null && message.hasOwnProperty("startupCpuBoost")) - if (typeof message.startupCpuBoost !== "boolean") - return "startupCpuBoost: boolean expected"; - return null; - }; - - /** - * Creates a ResourceRequirements message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ResourceRequirements} ResourceRequirements - */ - ResourceRequirements.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ResourceRequirements) - return object; - var message = new $root.google.cloud.run.v2.ResourceRequirements(); - if (object.limits) { - if (typeof object.limits !== "object") - throw TypeError(".google.cloud.run.v2.ResourceRequirements.limits: object expected"); - message.limits = {}; - for (var keys = Object.keys(object.limits), i = 0; i < keys.length; ++i) - message.limits[keys[i]] = String(object.limits[keys[i]]); - } - if (object.cpuIdle != null) - message.cpuIdle = Boolean(object.cpuIdle); - if (object.startupCpuBoost != null) - message.startupCpuBoost = Boolean(object.startupCpuBoost); - return message; - }; - - /** - * Creates a plain object from a ResourceRequirements message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {google.cloud.run.v2.ResourceRequirements} message ResourceRequirements - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceRequirements.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.limits = {}; - if (options.defaults) { - object.cpuIdle = false; - object.startupCpuBoost = false; - } - var keys2; - if (message.limits && (keys2 = Object.keys(message.limits)).length) { - object.limits = {}; - for (var j = 0; j < keys2.length; ++j) - object.limits[keys2[j]] = message.limits[keys2[j]]; - } - if (message.cpuIdle != null && message.hasOwnProperty("cpuIdle")) - object.cpuIdle = message.cpuIdle; - if (message.startupCpuBoost != null && message.hasOwnProperty("startupCpuBoost")) - object.startupCpuBoost = message.startupCpuBoost; - return object; - }; - - /** - * Converts this ResourceRequirements to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ResourceRequirements - * @instance - * @returns {Object.} JSON object - */ - ResourceRequirements.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceRequirements - * @function getTypeUrl - * @memberof google.cloud.run.v2.ResourceRequirements - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceRequirements.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ResourceRequirements"; - }; - - return ResourceRequirements; - })(); - - v2.EnvVar = (function() { - - /** - * Properties of an EnvVar. - * @memberof google.cloud.run.v2 - * @interface IEnvVar - * @property {string|null} [name] EnvVar name - * @property {string|null} [value] EnvVar value - * @property {google.cloud.run.v2.IEnvVarSource|null} [valueSource] EnvVar valueSource - */ - - /** - * Constructs a new EnvVar. - * @memberof google.cloud.run.v2 - * @classdesc Represents an EnvVar. - * @implements IEnvVar - * @constructor - * @param {google.cloud.run.v2.IEnvVar=} [properties] Properties to set - */ - function EnvVar(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnvVar name. - * @member {string} name - * @memberof google.cloud.run.v2.EnvVar - * @instance - */ - EnvVar.prototype.name = ""; - - /** - * EnvVar value. - * @member {string|null|undefined} value - * @memberof google.cloud.run.v2.EnvVar - * @instance - */ - EnvVar.prototype.value = null; - - /** - * EnvVar valueSource. - * @member {google.cloud.run.v2.IEnvVarSource|null|undefined} valueSource - * @memberof google.cloud.run.v2.EnvVar - * @instance - */ - EnvVar.prototype.valueSource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * EnvVar values. - * @member {"value"|"valueSource"|undefined} values - * @memberof google.cloud.run.v2.EnvVar - * @instance - */ - Object.defineProperty(EnvVar.prototype, "values", { - get: $util.oneOfGetter($oneOfFields = ["value", "valueSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new EnvVar instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {google.cloud.run.v2.IEnvVar=} [properties] Properties to set - * @returns {google.cloud.run.v2.EnvVar} EnvVar instance - */ - EnvVar.create = function create(properties) { - return new EnvVar(properties); - }; - - /** - * Encodes the specified EnvVar message. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {google.cloud.run.v2.IEnvVar} message EnvVar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnvVar.encode = function encode(message, writer) { - if (!writer) - 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 && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.valueSource != null && Object.hasOwnProperty.call(message, "valueSource")) - $root.google.cloud.run.v2.EnvVarSource.encode(message.valueSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnvVar message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVar.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {google.cloud.run.v2.IEnvVar} message EnvVar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnvVar.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnvVar message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.EnvVar} EnvVar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnvVar.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.EnvVar(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - case 3: { - message.valueSource = $root.google.cloud.run.v2.EnvVarSource.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnvVar message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.EnvVar} EnvVar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnvVar.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnvVar message. - * @function verify - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnvVar.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.value != null && message.hasOwnProperty("value")) { - properties.values = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - if (message.valueSource != null && message.hasOwnProperty("valueSource")) { - if (properties.values === 1) - return "values: multiple values"; - properties.values = 1; - { - var error = $root.google.cloud.run.v2.EnvVarSource.verify(message.valueSource); - if (error) - return "valueSource." + error; - } - } - return null; - }; - - /** - * Creates an EnvVar message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.EnvVar} EnvVar - */ - EnvVar.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.EnvVar) - return object; - var message = new $root.google.cloud.run.v2.EnvVar(); - if (object.name != null) - message.name = String(object.name); - if (object.value != null) - message.value = String(object.value); - if (object.valueSource != null) { - if (typeof object.valueSource !== "object") - throw TypeError(".google.cloud.run.v2.EnvVar.valueSource: object expected"); - message.valueSource = $root.google.cloud.run.v2.EnvVarSource.fromObject(object.valueSource); - } - return message; - }; - - /** - * Creates a plain object from an EnvVar message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {google.cloud.run.v2.EnvVar} message EnvVar - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnvVar.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object.values = "value"; - } - if (message.valueSource != null && message.hasOwnProperty("valueSource")) { - object.valueSource = $root.google.cloud.run.v2.EnvVarSource.toObject(message.valueSource, options); - if (options.oneofs) - object.values = "valueSource"; - } - return object; - }; - - /** - * Converts this EnvVar to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.EnvVar - * @instance - * @returns {Object.} JSON object - */ - EnvVar.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnvVar - * @function getTypeUrl - * @memberof google.cloud.run.v2.EnvVar - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnvVar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.EnvVar"; - }; - - return EnvVar; - })(); - - v2.EnvVarSource = (function() { - - /** - * Properties of an EnvVarSource. - * @memberof google.cloud.run.v2 - * @interface IEnvVarSource - * @property {google.cloud.run.v2.ISecretKeySelector|null} [secretKeyRef] EnvVarSource secretKeyRef - */ - - /** - * Constructs a new EnvVarSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents an EnvVarSource. - * @implements IEnvVarSource - * @constructor - * @param {google.cloud.run.v2.IEnvVarSource=} [properties] Properties to set - */ - function EnvVarSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnvVarSource secretKeyRef. - * @member {google.cloud.run.v2.ISecretKeySelector|null|undefined} secretKeyRef - * @memberof google.cloud.run.v2.EnvVarSource - * @instance - */ - EnvVarSource.prototype.secretKeyRef = null; - - /** - * Creates a new EnvVarSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {google.cloud.run.v2.IEnvVarSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource instance - */ - EnvVarSource.create = function create(properties) { - return new EnvVarSource(properties); - }; - - /** - * Encodes the specified EnvVarSource message. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {google.cloud.run.v2.IEnvVarSource} message EnvVarSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnvVarSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secretKeyRef != null && Object.hasOwnProperty.call(message, "secretKeyRef")) - $root.google.cloud.run.v2.SecretKeySelector.encode(message.secretKeyRef, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnvVarSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EnvVarSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {google.cloud.run.v2.IEnvVarSource} message EnvVarSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnvVarSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnvVarSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnvVarSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.EnvVarSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.secretKeyRef = $root.google.cloud.run.v2.SecretKeySelector.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnvVarSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnvVarSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnvVarSource message. - * @function verify - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnvVarSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secretKeyRef != null && message.hasOwnProperty("secretKeyRef")) { - var error = $root.google.cloud.run.v2.SecretKeySelector.verify(message.secretKeyRef); - if (error) - return "secretKeyRef." + error; - } - return null; - }; - - /** - * Creates an EnvVarSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.EnvVarSource} EnvVarSource - */ - EnvVarSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.EnvVarSource) - return object; - var message = new $root.google.cloud.run.v2.EnvVarSource(); - if (object.secretKeyRef != null) { - if (typeof object.secretKeyRef !== "object") - throw TypeError(".google.cloud.run.v2.EnvVarSource.secretKeyRef: object expected"); - message.secretKeyRef = $root.google.cloud.run.v2.SecretKeySelector.fromObject(object.secretKeyRef); - } - return message; - }; - - /** - * Creates a plain object from an EnvVarSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {google.cloud.run.v2.EnvVarSource} message EnvVarSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnvVarSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.secretKeyRef = null; - if (message.secretKeyRef != null && message.hasOwnProperty("secretKeyRef")) - object.secretKeyRef = $root.google.cloud.run.v2.SecretKeySelector.toObject(message.secretKeyRef, options); - return object; - }; - - /** - * Converts this EnvVarSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.EnvVarSource - * @instance - * @returns {Object.} JSON object - */ - EnvVarSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnvVarSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.EnvVarSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnvVarSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.EnvVarSource"; - }; - - return EnvVarSource; - })(); - - v2.SecretKeySelector = (function() { - - /** - * Properties of a SecretKeySelector. - * @memberof google.cloud.run.v2 - * @interface ISecretKeySelector - * @property {string|null} [secret] SecretKeySelector secret - * @property {string|null} [version] SecretKeySelector version - */ - - /** - * Constructs a new SecretKeySelector. - * @memberof google.cloud.run.v2 - * @classdesc Represents a SecretKeySelector. - * @implements ISecretKeySelector - * @constructor - * @param {google.cloud.run.v2.ISecretKeySelector=} [properties] Properties to set - */ - function SecretKeySelector(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecretKeySelector secret. - * @member {string} secret - * @memberof google.cloud.run.v2.SecretKeySelector - * @instance - */ - SecretKeySelector.prototype.secret = ""; - - /** - * SecretKeySelector version. - * @member {string} version - * @memberof google.cloud.run.v2.SecretKeySelector - * @instance - */ - SecretKeySelector.prototype.version = ""; - - /** - * Creates a new SecretKeySelector instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {google.cloud.run.v2.ISecretKeySelector=} [properties] Properties to set - * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector instance - */ - SecretKeySelector.create = function create(properties) { - return new SecretKeySelector(properties); - }; - - /** - * Encodes the specified SecretKeySelector message. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {google.cloud.run.v2.ISecretKeySelector} message SecretKeySelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecretKeySelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secret); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - return writer; - }; - - /** - * Encodes the specified SecretKeySelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretKeySelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {google.cloud.run.v2.ISecretKeySelector} message SecretKeySelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecretKeySelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecretKeySelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecretKeySelector.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SecretKeySelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.secret = reader.string(); - break; - } - case 2: { - message.version = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecretKeySelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecretKeySelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecretKeySelector message. - * @function verify - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecretKeySelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secret != null && message.hasOwnProperty("secret")) - if (!$util.isString(message.secret)) - return "secret: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; - }; - - /** - * Creates a SecretKeySelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SecretKeySelector} SecretKeySelector - */ - SecretKeySelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SecretKeySelector) - return object; - var message = new $root.google.cloud.run.v2.SecretKeySelector(); - if (object.secret != null) - message.secret = String(object.secret); - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a SecretKeySelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {google.cloud.run.v2.SecretKeySelector} message SecretKeySelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecretKeySelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.secret = ""; - object.version = ""; - } - if (message.secret != null && message.hasOwnProperty("secret")) - object.secret = message.secret; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this SecretKeySelector to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SecretKeySelector - * @instance - * @returns {Object.} JSON object - */ - SecretKeySelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecretKeySelector - * @function getTypeUrl - * @memberof google.cloud.run.v2.SecretKeySelector - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecretKeySelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SecretKeySelector"; - }; - - return SecretKeySelector; - })(); - - v2.ContainerPort = (function() { - - /** - * Properties of a ContainerPort. - * @memberof google.cloud.run.v2 - * @interface IContainerPort - * @property {string|null} [name] ContainerPort name - * @property {number|null} [containerPort] ContainerPort containerPort - */ - - /** - * Constructs a new ContainerPort. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ContainerPort. - * @implements IContainerPort - * @constructor - * @param {google.cloud.run.v2.IContainerPort=} [properties] Properties to set - */ - function ContainerPort(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContainerPort name. - * @member {string} name - * @memberof google.cloud.run.v2.ContainerPort - * @instance - */ - ContainerPort.prototype.name = ""; - - /** - * ContainerPort containerPort. - * @member {number} containerPort - * @memberof google.cloud.run.v2.ContainerPort - * @instance - */ - ContainerPort.prototype.containerPort = 0; - - /** - * Creates a new ContainerPort instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {google.cloud.run.v2.IContainerPort=} [properties] Properties to set - * @returns {google.cloud.run.v2.ContainerPort} ContainerPort instance - */ - ContainerPort.create = function create(properties) { - return new ContainerPort(properties); - }; - - /** - * Encodes the specified ContainerPort message. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {google.cloud.run.v2.IContainerPort} message ContainerPort message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerPort.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.containerPort != null && Object.hasOwnProperty.call(message, "containerPort")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.containerPort); - return writer; - }; - - /** - * Encodes the specified ContainerPort message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerPort.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {google.cloud.run.v2.IContainerPort} message ContainerPort message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerPort.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContainerPort message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ContainerPort} ContainerPort - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerPort.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ContainerPort(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.containerPort = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContainerPort message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ContainerPort} ContainerPort - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerPort.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContainerPort message. - * @function verify - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContainerPort.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.containerPort != null && message.hasOwnProperty("containerPort")) - if (!$util.isInteger(message.containerPort)) - return "containerPort: integer expected"; - return null; - }; - - /** - * Creates a ContainerPort message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ContainerPort} ContainerPort - */ - ContainerPort.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ContainerPort) - return object; - var message = new $root.google.cloud.run.v2.ContainerPort(); - if (object.name != null) - message.name = String(object.name); - if (object.containerPort != null) - message.containerPort = object.containerPort | 0; - return message; - }; - - /** - * Creates a plain object from a ContainerPort message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {google.cloud.run.v2.ContainerPort} message ContainerPort - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContainerPort.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.containerPort = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.containerPort != null && message.hasOwnProperty("containerPort")) - object.containerPort = message.containerPort; - return object; - }; - - /** - * Converts this ContainerPort to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ContainerPort - * @instance - * @returns {Object.} JSON object - */ - ContainerPort.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContainerPort - * @function getTypeUrl - * @memberof google.cloud.run.v2.ContainerPort - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContainerPort.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ContainerPort"; - }; - - return ContainerPort; - })(); - - v2.VolumeMount = (function() { - - /** - * Properties of a VolumeMount. - * @memberof google.cloud.run.v2 - * @interface IVolumeMount - * @property {string|null} [name] VolumeMount name - * @property {string|null} [mountPath] VolumeMount mountPath - * @property {string|null} [subPath] VolumeMount subPath - */ - - /** - * Constructs a new VolumeMount. - * @memberof google.cloud.run.v2 - * @classdesc Represents a VolumeMount. - * @implements IVolumeMount - * @constructor - * @param {google.cloud.run.v2.IVolumeMount=} [properties] Properties to set - */ - function VolumeMount(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VolumeMount name. - * @member {string} name - * @memberof google.cloud.run.v2.VolumeMount - * @instance - */ - VolumeMount.prototype.name = ""; - - /** - * VolumeMount mountPath. - * @member {string} mountPath - * @memberof google.cloud.run.v2.VolumeMount - * @instance - */ - VolumeMount.prototype.mountPath = ""; - - /** - * VolumeMount subPath. - * @member {string} subPath - * @memberof google.cloud.run.v2.VolumeMount - * @instance - */ - VolumeMount.prototype.subPath = ""; - - /** - * Creates a new VolumeMount instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {google.cloud.run.v2.IVolumeMount=} [properties] Properties to set - * @returns {google.cloud.run.v2.VolumeMount} VolumeMount instance - */ - VolumeMount.create = function create(properties) { - return new VolumeMount(properties); - }; - - /** - * Encodes the specified VolumeMount message. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {google.cloud.run.v2.IVolumeMount} message VolumeMount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VolumeMount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.mountPath); - if (message.subPath != null && Object.hasOwnProperty.call(message, "subPath")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.subPath); - return writer; - }; - - /** - * Encodes the specified VolumeMount message, length delimited. Does not implicitly {@link google.cloud.run.v2.VolumeMount.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {google.cloud.run.v2.IVolumeMount} message VolumeMount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VolumeMount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VolumeMount message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.VolumeMount} VolumeMount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VolumeMount.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VolumeMount(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.mountPath = reader.string(); - break; - } - case 4: { - message.subPath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VolumeMount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.VolumeMount} VolumeMount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VolumeMount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VolumeMount message. - * @function verify - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VolumeMount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - if (!$util.isString(message.mountPath)) - return "mountPath: string expected"; - if (message.subPath != null && message.hasOwnProperty("subPath")) - if (!$util.isString(message.subPath)) - return "subPath: string expected"; - return null; - }; - - /** - * Creates a VolumeMount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.VolumeMount} VolumeMount - */ - VolumeMount.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.VolumeMount) - return object; - var message = new $root.google.cloud.run.v2.VolumeMount(); - if (object.name != null) - message.name = String(object.name); - if (object.mountPath != null) - message.mountPath = String(object.mountPath); - if (object.subPath != null) - message.subPath = String(object.subPath); - return message; - }; - - /** - * Creates a plain object from a VolumeMount message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {google.cloud.run.v2.VolumeMount} message VolumeMount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VolumeMount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.mountPath = ""; - object.subPath = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - object.mountPath = message.mountPath; - if (message.subPath != null && message.hasOwnProperty("subPath")) - object.subPath = message.subPath; - return object; - }; - - /** - * Converts this VolumeMount to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.VolumeMount - * @instance - * @returns {Object.} JSON object - */ - VolumeMount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VolumeMount - * @function getTypeUrl - * @memberof google.cloud.run.v2.VolumeMount - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VolumeMount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.VolumeMount"; - }; - - return VolumeMount; - })(); - - v2.Volume = (function() { - - /** - * Properties of a Volume. - * @memberof google.cloud.run.v2 - * @interface IVolume - * @property {string|null} [name] Volume name - * @property {google.cloud.run.v2.ISecretVolumeSource|null} [secret] Volume secret - * @property {google.cloud.run.v2.ICloudSqlInstance|null} [cloudSqlInstance] Volume cloudSqlInstance - * @property {google.cloud.run.v2.IEmptyDirVolumeSource|null} [emptyDir] Volume emptyDir - * @property {google.cloud.run.v2.INFSVolumeSource|null} [nfs] Volume nfs - * @property {google.cloud.run.v2.IGCSVolumeSource|null} [gcs] Volume gcs - */ - - /** - * Constructs a new Volume. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Volume. - * @implements IVolume - * @constructor - * @param {google.cloud.run.v2.IVolume=} [properties] Properties to set - */ - function Volume(properties) { - if (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 name. - * @member {string} name - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.name = ""; - - /** - * Volume secret. - * @member {google.cloud.run.v2.ISecretVolumeSource|null|undefined} secret - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.secret = null; - - /** - * Volume cloudSqlInstance. - * @member {google.cloud.run.v2.ICloudSqlInstance|null|undefined} cloudSqlInstance - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.cloudSqlInstance = null; - - /** - * Volume emptyDir. - * @member {google.cloud.run.v2.IEmptyDirVolumeSource|null|undefined} emptyDir - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.emptyDir = null; - - /** - * Volume nfs. - * @member {google.cloud.run.v2.INFSVolumeSource|null|undefined} nfs - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.nfs = null; - - /** - * Volume gcs. - * @member {google.cloud.run.v2.IGCSVolumeSource|null|undefined} gcs - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Volume.prototype.gcs = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Volume volumeType. - * @member {"secret"|"cloudSqlInstance"|"emptyDir"|"nfs"|"gcs"|undefined} volumeType - * @memberof google.cloud.run.v2.Volume - * @instance - */ - Object.defineProperty(Volume.prototype, "volumeType", { - get: $util.oneOfGetter($oneOfFields = ["secret", "cloudSqlInstance", "emptyDir", "nfs", "gcs"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Volume instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Volume - * @static - * @param {google.cloud.run.v2.IVolume=} [properties] Properties to set - * @returns {google.cloud.run.v2.Volume} Volume instance - */ - Volume.create = function create(properties) { - return new Volume(properties); - }; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.run.v2.Volume.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Volume - * @static - * @param {google.cloud.run.v2.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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) - $root.google.cloud.run.v2.SecretVolumeSource.encode(message.secret, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cloudSqlInstance != null && Object.hasOwnProperty.call(message, "cloudSqlInstance")) - $root.google.cloud.run.v2.CloudSqlInstance.encode(message.cloudSqlInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.emptyDir != null && Object.hasOwnProperty.call(message, "emptyDir")) - $root.google.cloud.run.v2.EmptyDirVolumeSource.encode(message.emptyDir, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) - $root.google.cloud.run.v2.NFSVolumeSource.encode(message.nfs, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) - $root.google.cloud.run.v2.GCSVolumeSource.encode(message.gcs, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.run.v2.Volume.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Volume - * @static - * @param {google.cloud.run.v2.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.run.v2.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Volume(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.secret = $root.google.cloud.run.v2.SecretVolumeSource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.decode(reader, reader.uint32()); - break; - } - case 5: { - message.nfs = $root.google.cloud.run.v2.NFSVolumeSource.decode(reader, reader.uint32()); - break; - } - case 6: { - message.gcs = $root.google.cloud.run.v2.GCSVolumeSource.decode(reader, reader.uint32()); - 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.run.v2.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.secret != null && message.hasOwnProperty("secret")) { - properties.volumeType = 1; - { - var error = $root.google.cloud.run.v2.SecretVolumeSource.verify(message.secret); - if (error) - return "secret." + error; - } - } - if (message.cloudSqlInstance != null && message.hasOwnProperty("cloudSqlInstance")) { - if (properties.volumeType === 1) - return "volumeType: multiple values"; - properties.volumeType = 1; - { - var error = $root.google.cloud.run.v2.CloudSqlInstance.verify(message.cloudSqlInstance); - if (error) - return "cloudSqlInstance." + error; - } - } - if (message.emptyDir != null && message.hasOwnProperty("emptyDir")) { - if (properties.volumeType === 1) - return "volumeType: multiple values"; - properties.volumeType = 1; - { - var error = $root.google.cloud.run.v2.EmptyDirVolumeSource.verify(message.emptyDir); - if (error) - return "emptyDir." + error; - } - } - if (message.nfs != null && message.hasOwnProperty("nfs")) { - if (properties.volumeType === 1) - return "volumeType: multiple values"; - properties.volumeType = 1; - { - var error = $root.google.cloud.run.v2.NFSVolumeSource.verify(message.nfs); - if (error) - return "nfs." + error; - } - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - if (properties.volumeType === 1) - return "volumeType: multiple values"; - properties.volumeType = 1; - { - var error = $root.google.cloud.run.v2.GCSVolumeSource.verify(message.gcs); - if (error) - return "gcs." + error; - } - } - return null; - }; - - /** - * Creates a Volume message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Volume - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Volume} Volume - */ - Volume.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Volume) - return object; - var message = new $root.google.cloud.run.v2.Volume(); - if (object.name != null) - message.name = String(object.name); - if (object.secret != null) { - if (typeof object.secret !== "object") - throw TypeError(".google.cloud.run.v2.Volume.secret: object expected"); - message.secret = $root.google.cloud.run.v2.SecretVolumeSource.fromObject(object.secret); - } - if (object.cloudSqlInstance != null) { - if (typeof object.cloudSqlInstance !== "object") - throw TypeError(".google.cloud.run.v2.Volume.cloudSqlInstance: object expected"); - message.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.fromObject(object.cloudSqlInstance); - } - if (object.emptyDir != null) { - if (typeof object.emptyDir !== "object") - throw TypeError(".google.cloud.run.v2.Volume.emptyDir: object expected"); - message.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.fromObject(object.emptyDir); - } - if (object.nfs != null) { - if (typeof object.nfs !== "object") - throw TypeError(".google.cloud.run.v2.Volume.nfs: object expected"); - message.nfs = $root.google.cloud.run.v2.NFSVolumeSource.fromObject(object.nfs); - } - if (object.gcs != null) { - if (typeof object.gcs !== "object") - throw TypeError(".google.cloud.run.v2.Volume.gcs: object expected"); - message.gcs = $root.google.cloud.run.v2.GCSVolumeSource.fromObject(object.gcs); - } - return message; - }; - - /** - * Creates a plain object from a Volume message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Volume - * @static - * @param {google.cloud.run.v2.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.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.secret != null && message.hasOwnProperty("secret")) { - object.secret = $root.google.cloud.run.v2.SecretVolumeSource.toObject(message.secret, options); - if (options.oneofs) - object.volumeType = "secret"; - } - if (message.cloudSqlInstance != null && message.hasOwnProperty("cloudSqlInstance")) { - object.cloudSqlInstance = $root.google.cloud.run.v2.CloudSqlInstance.toObject(message.cloudSqlInstance, options); - if (options.oneofs) - object.volumeType = "cloudSqlInstance"; - } - if (message.emptyDir != null && message.hasOwnProperty("emptyDir")) { - object.emptyDir = $root.google.cloud.run.v2.EmptyDirVolumeSource.toObject(message.emptyDir, options); - if (options.oneofs) - object.volumeType = "emptyDir"; - } - if (message.nfs != null && message.hasOwnProperty("nfs")) { - object.nfs = $root.google.cloud.run.v2.NFSVolumeSource.toObject(message.nfs, options); - if (options.oneofs) - object.volumeType = "nfs"; - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - object.gcs = $root.google.cloud.run.v2.GCSVolumeSource.toObject(message.gcs, options); - if (options.oneofs) - object.volumeType = "gcs"; - } - return object; - }; - - /** - * Converts this Volume to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Volume"; - }; - - return Volume; - })(); - - v2.SecretVolumeSource = (function() { - - /** - * Properties of a SecretVolumeSource. - * @memberof google.cloud.run.v2 - * @interface ISecretVolumeSource - * @property {string|null} [secret] SecretVolumeSource secret - * @property {Array.|null} [items] SecretVolumeSource items - * @property {number|null} [defaultMode] SecretVolumeSource defaultMode - */ - - /** - * Constructs a new SecretVolumeSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents a SecretVolumeSource. - * @implements ISecretVolumeSource - * @constructor - * @param {google.cloud.run.v2.ISecretVolumeSource=} [properties] Properties to set - */ - function SecretVolumeSource(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]]; - } - - /** - * SecretVolumeSource secret. - * @member {string} secret - * @memberof google.cloud.run.v2.SecretVolumeSource - * @instance - */ - SecretVolumeSource.prototype.secret = ""; - - /** - * SecretVolumeSource items. - * @member {Array.} items - * @memberof google.cloud.run.v2.SecretVolumeSource - * @instance - */ - SecretVolumeSource.prototype.items = $util.emptyArray; - - /** - * SecretVolumeSource defaultMode. - * @member {number} defaultMode - * @memberof google.cloud.run.v2.SecretVolumeSource - * @instance - */ - SecretVolumeSource.prototype.defaultMode = 0; - - /** - * Creates a new SecretVolumeSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {google.cloud.run.v2.ISecretVolumeSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource instance - */ - SecretVolumeSource.create = function create(properties) { - return new SecretVolumeSource(properties); - }; - - /** - * Encodes the specified SecretVolumeSource message. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {google.cloud.run.v2.ISecretVolumeSource} message SecretVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecretVolumeSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secret); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.run.v2.VersionToPath.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.defaultMode != null && Object.hasOwnProperty.call(message, "defaultMode")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.defaultMode); - return writer; - }; - - /** - * Encodes the specified SecretVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SecretVolumeSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {google.cloud.run.v2.ISecretVolumeSource} message SecretVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecretVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecretVolumeSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecretVolumeSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SecretVolumeSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.secret = reader.string(); - break; - } - case 2: { - if (!(message.items && message.items.length)) - message.items = []; - message.items.push($root.google.cloud.run.v2.VersionToPath.decode(reader, reader.uint32())); - break; - } - case 3: { - message.defaultMode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecretVolumeSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecretVolumeSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecretVolumeSource message. - * @function verify - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecretVolumeSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.secret != null && message.hasOwnProperty("secret")) - if (!$util.isString(message.secret)) - return "secret: string expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) { - var error = $root.google.cloud.run.v2.VersionToPath.verify(message.items[i]); - if (error) - return "items." + error; - } - } - if (message.defaultMode != null && message.hasOwnProperty("defaultMode")) - if (!$util.isInteger(message.defaultMode)) - return "defaultMode: integer expected"; - return null; - }; - - /** - * Creates a SecretVolumeSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SecretVolumeSource} SecretVolumeSource - */ - SecretVolumeSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SecretVolumeSource) - return object; - var message = new $root.google.cloud.run.v2.SecretVolumeSource(); - if (object.secret != null) - message.secret = String(object.secret); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.cloud.run.v2.SecretVolumeSource.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") - throw TypeError(".google.cloud.run.v2.SecretVolumeSource.items: object expected"); - message.items[i] = $root.google.cloud.run.v2.VersionToPath.fromObject(object.items[i]); - } - } - if (object.defaultMode != null) - message.defaultMode = object.defaultMode | 0; - return message; - }; - - /** - * Creates a plain object from a SecretVolumeSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {google.cloud.run.v2.SecretVolumeSource} message SecretVolumeSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecretVolumeSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (options.defaults) { - object.secret = ""; - object.defaultMode = 0; - } - if (message.secret != null && message.hasOwnProperty("secret")) - object.secret = message.secret; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.run.v2.VersionToPath.toObject(message.items[j], options); - } - if (message.defaultMode != null && message.hasOwnProperty("defaultMode")) - object.defaultMode = message.defaultMode; - return object; - }; - - /** - * Converts this SecretVolumeSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SecretVolumeSource - * @instance - * @returns {Object.} JSON object - */ - SecretVolumeSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecretVolumeSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.SecretVolumeSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecretVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SecretVolumeSource"; - }; - - return SecretVolumeSource; - })(); - - v2.VersionToPath = (function() { - - /** - * Properties of a VersionToPath. - * @memberof google.cloud.run.v2 - * @interface IVersionToPath - * @property {string|null} [path] VersionToPath path - * @property {string|null} [version] VersionToPath version - * @property {number|null} [mode] VersionToPath mode - */ - - /** - * Constructs a new VersionToPath. - * @memberof google.cloud.run.v2 - * @classdesc Represents a VersionToPath. - * @implements IVersionToPath - * @constructor - * @param {google.cloud.run.v2.IVersionToPath=} [properties] Properties to set - */ - function VersionToPath(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VersionToPath path. - * @member {string} path - * @memberof google.cloud.run.v2.VersionToPath - * @instance - */ - VersionToPath.prototype.path = ""; - - /** - * VersionToPath version. - * @member {string} version - * @memberof google.cloud.run.v2.VersionToPath - * @instance - */ - VersionToPath.prototype.version = ""; - - /** - * VersionToPath mode. - * @member {number} mode - * @memberof google.cloud.run.v2.VersionToPath - * @instance - */ - VersionToPath.prototype.mode = 0; - - /** - * Creates a new VersionToPath instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {google.cloud.run.v2.IVersionToPath=} [properties] Properties to set - * @returns {google.cloud.run.v2.VersionToPath} VersionToPath instance - */ - VersionToPath.create = function create(properties) { - return new VersionToPath(properties); - }; - - /** - * Encodes the specified VersionToPath message. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {google.cloud.run.v2.IVersionToPath} message VersionToPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionToPath.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.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mode); - return writer; - }; - - /** - * Encodes the specified VersionToPath message, length delimited. Does not implicitly {@link google.cloud.run.v2.VersionToPath.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {google.cloud.run.v2.IVersionToPath} message VersionToPath message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VersionToPath.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VersionToPath message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.VersionToPath} VersionToPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionToPath.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VersionToPath(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.path = reader.string(); - break; - } - case 2: { - message.version = reader.string(); - break; - } - case 3: { - message.mode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VersionToPath message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.VersionToPath} VersionToPath - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VersionToPath.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VersionToPath message. - * @function verify - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VersionToPath.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.mode != null && message.hasOwnProperty("mode")) - if (!$util.isInteger(message.mode)) - return "mode: integer expected"; - return null; - }; - - /** - * Creates a VersionToPath message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.VersionToPath} VersionToPath - */ - VersionToPath.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.VersionToPath) - return object; - var message = new $root.google.cloud.run.v2.VersionToPath(); - if (object.path != null) - message.path = String(object.path); - if (object.version != null) - message.version = String(object.version); - if (object.mode != null) - message.mode = object.mode | 0; - return message; - }; - - /** - * Creates a plain object from a VersionToPath message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {google.cloud.run.v2.VersionToPath} message VersionToPath - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VersionToPath.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.path = ""; - object.version = ""; - object.mode = 0; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = message.mode; - return object; - }; - - /** - * Converts this VersionToPath to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.VersionToPath - * @instance - * @returns {Object.} JSON object - */ - VersionToPath.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VersionToPath - * @function getTypeUrl - * @memberof google.cloud.run.v2.VersionToPath - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VersionToPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.VersionToPath"; - }; - - return VersionToPath; - })(); - - v2.CloudSqlInstance = (function() { - - /** - * Properties of a CloudSqlInstance. - * @memberof google.cloud.run.v2 - * @interface ICloudSqlInstance - * @property {Array.|null} [instances] CloudSqlInstance instances - */ - - /** - * Constructs a new CloudSqlInstance. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CloudSqlInstance. - * @implements ICloudSqlInstance - * @constructor - * @param {google.cloud.run.v2.ICloudSqlInstance=} [properties] Properties to set - */ - function CloudSqlInstance(properties) { - 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]]; - } - - /** - * CloudSqlInstance instances. - * @member {Array.} instances - * @memberof google.cloud.run.v2.CloudSqlInstance - * @instance - */ - CloudSqlInstance.prototype.instances = $util.emptyArray; - - /** - * Creates a new CloudSqlInstance instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {google.cloud.run.v2.ICloudSqlInstance=} [properties] Properties to set - * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance instance - */ - CloudSqlInstance.create = function create(properties) { - return new CloudSqlInstance(properties); - }; - - /** - * Encodes the specified CloudSqlInstance message. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {google.cloud.run.v2.ICloudSqlInstance} message CloudSqlInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instances[i]); - return writer; - }; - - /** - * Encodes the specified CloudSqlInstance message, length delimited. Does not implicitly {@link google.cloud.run.v2.CloudSqlInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {google.cloud.run.v2.ICloudSqlInstance} message CloudSqlInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudSqlInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstance.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CloudSqlInstance(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudSqlInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudSqlInstance message. - * @function verify - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudSqlInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) - if (!$util.isString(message.instances[i])) - return "instances: string[] expected"; - } - return null; - }; - - /** - * Creates a CloudSqlInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CloudSqlInstance} CloudSqlInstance - */ - CloudSqlInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CloudSqlInstance) - return object; - var message = new $root.google.cloud.run.v2.CloudSqlInstance(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.run.v2.CloudSqlInstance.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) - message.instances[i] = String(object.instances[i]); - } - return message; - }; - - /** - * Creates a plain object from a CloudSqlInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {google.cloud.run.v2.CloudSqlInstance} message CloudSqlInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudSqlInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = message.instances[j]; - } - return object; - }; - - /** - * Converts this CloudSqlInstance to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.CloudSqlInstance - * @instance - * @returns {Object.} JSON object - */ - CloudSqlInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudSqlInstance - * @function getTypeUrl - * @memberof google.cloud.run.v2.CloudSqlInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudSqlInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.CloudSqlInstance"; - }; - - return CloudSqlInstance; - })(); - - v2.EmptyDirVolumeSource = (function() { - - /** - * Properties of an EmptyDirVolumeSource. - * @memberof google.cloud.run.v2 - * @interface IEmptyDirVolumeSource - * @property {google.cloud.run.v2.EmptyDirVolumeSource.Medium|null} [medium] EmptyDirVolumeSource medium - * @property {string|null} [sizeLimit] EmptyDirVolumeSource sizeLimit - */ - - /** - * Constructs a new EmptyDirVolumeSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents an EmptyDirVolumeSource. - * @implements IEmptyDirVolumeSource - * @constructor - * @param {google.cloud.run.v2.IEmptyDirVolumeSource=} [properties] Properties to set - */ - function EmptyDirVolumeSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EmptyDirVolumeSource medium. - * @member {google.cloud.run.v2.EmptyDirVolumeSource.Medium} medium - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @instance - */ - EmptyDirVolumeSource.prototype.medium = 0; - - /** - * EmptyDirVolumeSource sizeLimit. - * @member {string} sizeLimit - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @instance - */ - EmptyDirVolumeSource.prototype.sizeLimit = ""; - - /** - * Creates a new EmptyDirVolumeSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {google.cloud.run.v2.IEmptyDirVolumeSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource instance - */ - EmptyDirVolumeSource.create = function create(properties) { - return new EmptyDirVolumeSource(properties); - }; - - /** - * Encodes the specified EmptyDirVolumeSource message. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {google.cloud.run.v2.IEmptyDirVolumeSource} message EmptyDirVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmptyDirVolumeSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.medium != null && Object.hasOwnProperty.call(message, "medium")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.medium); - if (message.sizeLimit != null && Object.hasOwnProperty.call(message, "sizeLimit")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sizeLimit); - return writer; - }; - - /** - * Encodes the specified EmptyDirVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.EmptyDirVolumeSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {google.cloud.run.v2.IEmptyDirVolumeSource} message EmptyDirVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmptyDirVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EmptyDirVolumeSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmptyDirVolumeSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.EmptyDirVolumeSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.medium = reader.int32(); - break; - } - case 2: { - message.sizeLimit = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EmptyDirVolumeSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmptyDirVolumeSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EmptyDirVolumeSource message. - * @function verify - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EmptyDirVolumeSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.medium != null && message.hasOwnProperty("medium")) - switch (message.medium) { - default: - return "medium: enum value expected"; - case 0: - case 1: - break; - } - if (message.sizeLimit != null && message.hasOwnProperty("sizeLimit")) - if (!$util.isString(message.sizeLimit)) - return "sizeLimit: string expected"; - return null; - }; - - /** - * Creates an EmptyDirVolumeSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.EmptyDirVolumeSource} EmptyDirVolumeSource - */ - EmptyDirVolumeSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.EmptyDirVolumeSource) - return object; - var message = new $root.google.cloud.run.v2.EmptyDirVolumeSource(); - switch (object.medium) { - default: - if (typeof object.medium === "number") { - message.medium = object.medium; - break; - } - break; - case "MEDIUM_UNSPECIFIED": - case 0: - message.medium = 0; - break; - case "MEMORY": - case 1: - message.medium = 1; - break; - } - if (object.sizeLimit != null) - message.sizeLimit = String(object.sizeLimit); - return message; - }; - - /** - * Creates a plain object from an EmptyDirVolumeSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {google.cloud.run.v2.EmptyDirVolumeSource} message EmptyDirVolumeSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EmptyDirVolumeSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.medium = options.enums === String ? "MEDIUM_UNSPECIFIED" : 0; - object.sizeLimit = ""; - } - if (message.medium != null && message.hasOwnProperty("medium")) - object.medium = options.enums === String ? $root.google.cloud.run.v2.EmptyDirVolumeSource.Medium[message.medium] === undefined ? message.medium : $root.google.cloud.run.v2.EmptyDirVolumeSource.Medium[message.medium] : message.medium; - if (message.sizeLimit != null && message.hasOwnProperty("sizeLimit")) - object.sizeLimit = message.sizeLimit; - return object; - }; - - /** - * Converts this EmptyDirVolumeSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @instance - * @returns {Object.} JSON object - */ - EmptyDirVolumeSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EmptyDirVolumeSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.EmptyDirVolumeSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EmptyDirVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.EmptyDirVolumeSource"; - }; - - /** - * Medium enum. - * @name google.cloud.run.v2.EmptyDirVolumeSource.Medium - * @enum {number} - * @property {number} MEDIUM_UNSPECIFIED=0 MEDIUM_UNSPECIFIED value - * @property {number} MEMORY=1 MEMORY value - */ - EmptyDirVolumeSource.Medium = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MEDIUM_UNSPECIFIED"] = 0; - values[valuesById[1] = "MEMORY"] = 1; - return values; - })(); - - return EmptyDirVolumeSource; - })(); - - v2.NFSVolumeSource = (function() { - - /** - * Properties of a NFSVolumeSource. - * @memberof google.cloud.run.v2 - * @interface INFSVolumeSource - * @property {string|null} [server] NFSVolumeSource server - * @property {string|null} [path] NFSVolumeSource path - * @property {boolean|null} [readOnly] NFSVolumeSource readOnly - */ - - /** - * Constructs a new NFSVolumeSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents a NFSVolumeSource. - * @implements INFSVolumeSource - * @constructor - * @param {google.cloud.run.v2.INFSVolumeSource=} [properties] Properties to set - */ - function NFSVolumeSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NFSVolumeSource server. - * @member {string} server - * @memberof google.cloud.run.v2.NFSVolumeSource - * @instance - */ - NFSVolumeSource.prototype.server = ""; - - /** - * NFSVolumeSource path. - * @member {string} path - * @memberof google.cloud.run.v2.NFSVolumeSource - * @instance - */ - NFSVolumeSource.prototype.path = ""; - - /** - * NFSVolumeSource readOnly. - * @member {boolean} readOnly - * @memberof google.cloud.run.v2.NFSVolumeSource - * @instance - */ - NFSVolumeSource.prototype.readOnly = false; - - /** - * Creates a new NFSVolumeSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {google.cloud.run.v2.INFSVolumeSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource instance - */ - NFSVolumeSource.create = function create(properties) { - return new NFSVolumeSource(properties); - }; - - /** - * Encodes the specified NFSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {google.cloud.run.v2.INFSVolumeSource} message NFSVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFSVolumeSource.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.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.readOnly); - return writer; - }; - - /** - * Encodes the specified NFSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.NFSVolumeSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {google.cloud.run.v2.INFSVolumeSource} message NFSVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFSVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NFSVolumeSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFSVolumeSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.NFSVolumeSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.server = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - case 3: { - message.readOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NFSVolumeSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFSVolumeSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NFSVolumeSource message. - * @function verify - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NFSVolumeSource.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.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) - if (typeof message.readOnly !== "boolean") - return "readOnly: boolean expected"; - return null; - }; - - /** - * Creates a NFSVolumeSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.NFSVolumeSource} NFSVolumeSource - */ - NFSVolumeSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.NFSVolumeSource) - return object; - var message = new $root.google.cloud.run.v2.NFSVolumeSource(); - if (object.server != null) - message.server = String(object.server); - if (object.path != null) - message.path = String(object.path); - if (object.readOnly != null) - message.readOnly = Boolean(object.readOnly); - return message; - }; - - /** - * Creates a plain object from a NFSVolumeSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {google.cloud.run.v2.NFSVolumeSource} message NFSVolumeSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NFSVolumeSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.server = ""; - object.path = ""; - object.readOnly = false; - } - if (message.server != null && message.hasOwnProperty("server")) - object.server = message.server; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) - object.readOnly = message.readOnly; - return object; - }; - - /** - * Converts this NFSVolumeSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.NFSVolumeSource - * @instance - * @returns {Object.} JSON object - */ - NFSVolumeSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NFSVolumeSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.NFSVolumeSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NFSVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.NFSVolumeSource"; - }; - - return NFSVolumeSource; - })(); - - v2.GCSVolumeSource = (function() { - - /** - * Properties of a GCSVolumeSource. - * @memberof google.cloud.run.v2 - * @interface IGCSVolumeSource - * @property {string|null} [bucket] GCSVolumeSource bucket - * @property {boolean|null} [readOnly] GCSVolumeSource readOnly - * @property {Array.|null} [mountOptions] GCSVolumeSource mountOptions - */ - - /** - * Constructs a new GCSVolumeSource. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GCSVolumeSource. - * @implements IGCSVolumeSource - * @constructor - * @param {google.cloud.run.v2.IGCSVolumeSource=} [properties] Properties to set - */ - function GCSVolumeSource(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]]; - } - - /** - * GCSVolumeSource bucket. - * @member {string} bucket - * @memberof google.cloud.run.v2.GCSVolumeSource - * @instance - */ - GCSVolumeSource.prototype.bucket = ""; - - /** - * GCSVolumeSource readOnly. - * @member {boolean} readOnly - * @memberof google.cloud.run.v2.GCSVolumeSource - * @instance - */ - GCSVolumeSource.prototype.readOnly = false; - - /** - * GCSVolumeSource mountOptions. - * @member {Array.} mountOptions - * @memberof google.cloud.run.v2.GCSVolumeSource - * @instance - */ - GCSVolumeSource.prototype.mountOptions = $util.emptyArray; - - /** - * Creates a new GCSVolumeSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {google.cloud.run.v2.IGCSVolumeSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource instance - */ - GCSVolumeSource.create = function create(properties) { - return new GCSVolumeSource(properties); - }; - - /** - * Encodes the specified GCSVolumeSource message. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {google.cloud.run.v2.IGCSVolumeSource} message GCSVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCSVolumeSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); - if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.readOnly); - if (message.mountOptions != null && message.mountOptions.length) - for (var i = 0; i < message.mountOptions.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.mountOptions[i]); - return writer; - }; - - /** - * Encodes the specified GCSVolumeSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.GCSVolumeSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {google.cloud.run.v2.IGCSVolumeSource} message GCSVolumeSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCSVolumeSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCSVolumeSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCSVolumeSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GCSVolumeSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bucket = reader.string(); - break; - } - case 2: { - message.readOnly = reader.bool(); - break; - } - case 3: { - if (!(message.mountOptions && message.mountOptions.length)) - message.mountOptions = []; - message.mountOptions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCSVolumeSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCSVolumeSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCSVolumeSource message. - * @function verify - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCSVolumeSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bucket != null && message.hasOwnProperty("bucket")) - if (!$util.isString(message.bucket)) - return "bucket: string expected"; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) - if (typeof message.readOnly !== "boolean") - return "readOnly: boolean 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 GCSVolumeSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GCSVolumeSource} GCSVolumeSource - */ - GCSVolumeSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GCSVolumeSource) - return object; - var message = new $root.google.cloud.run.v2.GCSVolumeSource(); - if (object.bucket != null) - message.bucket = String(object.bucket); - if (object.readOnly != null) - message.readOnly = Boolean(object.readOnly); - if (object.mountOptions) { - if (!Array.isArray(object.mountOptions)) - throw TypeError(".google.cloud.run.v2.GCSVolumeSource.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 GCSVolumeSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {google.cloud.run.v2.GCSVolumeSource} message GCSVolumeSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCSVolumeSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mountOptions = []; - if (options.defaults) { - object.bucket = ""; - object.readOnly = false; - } - if (message.bucket != null && message.hasOwnProperty("bucket")) - object.bucket = message.bucket; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) - object.readOnly = message.readOnly; - if (message.mountOptions && message.mountOptions.length) { - object.mountOptions = []; - for (var j = 0; j < message.mountOptions.length; ++j) - object.mountOptions[j] = message.mountOptions[j]; - } - return object; - }; - - /** - * Converts this GCSVolumeSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GCSVolumeSource - * @instance - * @returns {Object.} JSON object - */ - GCSVolumeSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCSVolumeSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.GCSVolumeSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCSVolumeSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GCSVolumeSource"; - }; - - return GCSVolumeSource; - })(); - - v2.Probe = (function() { - - /** - * Properties of a Probe. - * @memberof google.cloud.run.v2 - * @interface IProbe - * @property {number|null} [initialDelaySeconds] Probe initialDelaySeconds - * @property {number|null} [timeoutSeconds] Probe timeoutSeconds - * @property {number|null} [periodSeconds] Probe periodSeconds - * @property {number|null} [failureThreshold] Probe failureThreshold - * @property {google.cloud.run.v2.IHTTPGetAction|null} [httpGet] Probe httpGet - * @property {google.cloud.run.v2.ITCPSocketAction|null} [tcpSocket] Probe tcpSocket - * @property {google.cloud.run.v2.IGRPCAction|null} [grpc] Probe grpc - */ - - /** - * Constructs a new Probe. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Probe. - * @implements IProbe - * @constructor - * @param {google.cloud.run.v2.IProbe=} [properties] Properties to set - */ - function Probe(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Probe initialDelaySeconds. - * @member {number} initialDelaySeconds - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.initialDelaySeconds = 0; - - /** - * Probe timeoutSeconds. - * @member {number} timeoutSeconds - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.timeoutSeconds = 0; - - /** - * Probe periodSeconds. - * @member {number} periodSeconds - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.periodSeconds = 0; - - /** - * Probe failureThreshold. - * @member {number} failureThreshold - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.failureThreshold = 0; - - /** - * Probe httpGet. - * @member {google.cloud.run.v2.IHTTPGetAction|null|undefined} httpGet - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.httpGet = null; - - /** - * Probe tcpSocket. - * @member {google.cloud.run.v2.ITCPSocketAction|null|undefined} tcpSocket - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.tcpSocket = null; - - /** - * Probe grpc. - * @member {google.cloud.run.v2.IGRPCAction|null|undefined} grpc - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Probe.prototype.grpc = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Probe probeType. - * @member {"httpGet"|"tcpSocket"|"grpc"|undefined} probeType - * @memberof google.cloud.run.v2.Probe - * @instance - */ - Object.defineProperty(Probe.prototype, "probeType", { - get: $util.oneOfGetter($oneOfFields = ["httpGet", "tcpSocket", "grpc"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Probe instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Probe - * @static - * @param {google.cloud.run.v2.IProbe=} [properties] Properties to set - * @returns {google.cloud.run.v2.Probe} Probe instance - */ - Probe.create = function create(properties) { - return new Probe(properties); - }; - - /** - * Encodes the specified Probe message. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Probe - * @static - * @param {google.cloud.run.v2.IProbe} message Probe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Probe.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialDelaySeconds != null && Object.hasOwnProperty.call(message, "initialDelaySeconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.initialDelaySeconds); - if (message.timeoutSeconds != null && Object.hasOwnProperty.call(message, "timeoutSeconds")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.timeoutSeconds); - if (message.periodSeconds != null && Object.hasOwnProperty.call(message, "periodSeconds")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.periodSeconds); - if (message.failureThreshold != null && Object.hasOwnProperty.call(message, "failureThreshold")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.failureThreshold); - if (message.httpGet != null && Object.hasOwnProperty.call(message, "httpGet")) - $root.google.cloud.run.v2.HTTPGetAction.encode(message.httpGet, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.tcpSocket != null && Object.hasOwnProperty.call(message, "tcpSocket")) - $root.google.cloud.run.v2.TCPSocketAction.encode(message.tcpSocket, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.grpc != null && Object.hasOwnProperty.call(message, "grpc")) - $root.google.cloud.run.v2.GRPCAction.encode(message.grpc, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Probe message, length delimited. Does not implicitly {@link google.cloud.run.v2.Probe.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Probe - * @static - * @param {google.cloud.run.v2.IProbe} message Probe message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Probe.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Probe message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Probe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Probe} Probe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Probe.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Probe(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialDelaySeconds = reader.int32(); - break; - } - case 2: { - message.timeoutSeconds = reader.int32(); - break; - } - case 3: { - message.periodSeconds = reader.int32(); - break; - } - case 4: { - message.failureThreshold = reader.int32(); - break; - } - case 5: { - message.httpGet = $root.google.cloud.run.v2.HTTPGetAction.decode(reader, reader.uint32()); - break; - } - case 6: { - message.tcpSocket = $root.google.cloud.run.v2.TCPSocketAction.decode(reader, reader.uint32()); - break; - } - case 7: { - message.grpc = $root.google.cloud.run.v2.GRPCAction.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Probe message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Probe - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Probe} Probe - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Probe.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Probe message. - * @function verify - * @memberof google.cloud.run.v2.Probe - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Probe.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.initialDelaySeconds != null && message.hasOwnProperty("initialDelaySeconds")) - if (!$util.isInteger(message.initialDelaySeconds)) - return "initialDelaySeconds: integer expected"; - if (message.timeoutSeconds != null && message.hasOwnProperty("timeoutSeconds")) - if (!$util.isInteger(message.timeoutSeconds)) - return "timeoutSeconds: integer expected"; - if (message.periodSeconds != null && message.hasOwnProperty("periodSeconds")) - if (!$util.isInteger(message.periodSeconds)) - return "periodSeconds: integer expected"; - if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) - if (!$util.isInteger(message.failureThreshold)) - return "failureThreshold: integer expected"; - if (message.httpGet != null && message.hasOwnProperty("httpGet")) { - properties.probeType = 1; - { - var error = $root.google.cloud.run.v2.HTTPGetAction.verify(message.httpGet); - if (error) - return "httpGet." + error; - } - } - if (message.tcpSocket != null && message.hasOwnProperty("tcpSocket")) { - if (properties.probeType === 1) - return "probeType: multiple values"; - properties.probeType = 1; - { - var error = $root.google.cloud.run.v2.TCPSocketAction.verify(message.tcpSocket); - if (error) - return "tcpSocket." + error; - } - } - if (message.grpc != null && message.hasOwnProperty("grpc")) { - if (properties.probeType === 1) - return "probeType: multiple values"; - properties.probeType = 1; - { - var error = $root.google.cloud.run.v2.GRPCAction.verify(message.grpc); - if (error) - return "grpc." + error; - } - } - return null; - }; - - /** - * Creates a Probe message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Probe - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Probe} Probe - */ - Probe.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Probe) - return object; - var message = new $root.google.cloud.run.v2.Probe(); - if (object.initialDelaySeconds != null) - message.initialDelaySeconds = object.initialDelaySeconds | 0; - if (object.timeoutSeconds != null) - message.timeoutSeconds = object.timeoutSeconds | 0; - if (object.periodSeconds != null) - message.periodSeconds = object.periodSeconds | 0; - if (object.failureThreshold != null) - message.failureThreshold = object.failureThreshold | 0; - if (object.httpGet != null) { - if (typeof object.httpGet !== "object") - throw TypeError(".google.cloud.run.v2.Probe.httpGet: object expected"); - message.httpGet = $root.google.cloud.run.v2.HTTPGetAction.fromObject(object.httpGet); - } - if (object.tcpSocket != null) { - if (typeof object.tcpSocket !== "object") - throw TypeError(".google.cloud.run.v2.Probe.tcpSocket: object expected"); - message.tcpSocket = $root.google.cloud.run.v2.TCPSocketAction.fromObject(object.tcpSocket); - } - if (object.grpc != null) { - if (typeof object.grpc !== "object") - throw TypeError(".google.cloud.run.v2.Probe.grpc: object expected"); - message.grpc = $root.google.cloud.run.v2.GRPCAction.fromObject(object.grpc); - } - return message; - }; - - /** - * Creates a plain object from a Probe message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Probe - * @static - * @param {google.cloud.run.v2.Probe} message Probe - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Probe.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialDelaySeconds = 0; - object.timeoutSeconds = 0; - object.periodSeconds = 0; - object.failureThreshold = 0; - } - if (message.initialDelaySeconds != null && message.hasOwnProperty("initialDelaySeconds")) - object.initialDelaySeconds = message.initialDelaySeconds; - if (message.timeoutSeconds != null && message.hasOwnProperty("timeoutSeconds")) - object.timeoutSeconds = message.timeoutSeconds; - if (message.periodSeconds != null && message.hasOwnProperty("periodSeconds")) - object.periodSeconds = message.periodSeconds; - if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) - object.failureThreshold = message.failureThreshold; - if (message.httpGet != null && message.hasOwnProperty("httpGet")) { - object.httpGet = $root.google.cloud.run.v2.HTTPGetAction.toObject(message.httpGet, options); - if (options.oneofs) - object.probeType = "httpGet"; - } - if (message.tcpSocket != null && message.hasOwnProperty("tcpSocket")) { - object.tcpSocket = $root.google.cloud.run.v2.TCPSocketAction.toObject(message.tcpSocket, options); - if (options.oneofs) - object.probeType = "tcpSocket"; - } - if (message.grpc != null && message.hasOwnProperty("grpc")) { - object.grpc = $root.google.cloud.run.v2.GRPCAction.toObject(message.grpc, options); - if (options.oneofs) - object.probeType = "grpc"; - } - return object; - }; - - /** - * Converts this Probe to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Probe - * @instance - * @returns {Object.} JSON object - */ - Probe.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Probe - * @function getTypeUrl - * @memberof google.cloud.run.v2.Probe - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Probe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Probe"; - }; - - return Probe; - })(); - - v2.HTTPGetAction = (function() { - - /** - * Properties of a HTTPGetAction. - * @memberof google.cloud.run.v2 - * @interface IHTTPGetAction - * @property {string|null} [path] HTTPGetAction path - * @property {Array.|null} [httpHeaders] HTTPGetAction httpHeaders - * @property {number|null} [port] HTTPGetAction port - */ - - /** - * Constructs a new HTTPGetAction. - * @memberof google.cloud.run.v2 - * @classdesc Represents a HTTPGetAction. - * @implements IHTTPGetAction - * @constructor - * @param {google.cloud.run.v2.IHTTPGetAction=} [properties] Properties to set - */ - function HTTPGetAction(properties) { - this.httpHeaders = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HTTPGetAction path. - * @member {string} path - * @memberof google.cloud.run.v2.HTTPGetAction - * @instance - */ - HTTPGetAction.prototype.path = ""; - - /** - * HTTPGetAction httpHeaders. - * @member {Array.} httpHeaders - * @memberof google.cloud.run.v2.HTTPGetAction - * @instance - */ - HTTPGetAction.prototype.httpHeaders = $util.emptyArray; - - /** - * HTTPGetAction port. - * @member {number} port - * @memberof google.cloud.run.v2.HTTPGetAction - * @instance - */ - HTTPGetAction.prototype.port = 0; - - /** - * Creates a new HTTPGetAction instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {google.cloud.run.v2.IHTTPGetAction=} [properties] Properties to set - * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction instance - */ - HTTPGetAction.create = function create(properties) { - return new HTTPGetAction(properties); - }; - - /** - * Encodes the specified HTTPGetAction message. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {google.cloud.run.v2.IHTTPGetAction} message HTTPGetAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HTTPGetAction.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.httpHeaders != null && message.httpHeaders.length) - for (var i = 0; i < message.httpHeaders.length; ++i) - $root.google.cloud.run.v2.HTTPHeader.encode(message.httpHeaders[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); - return writer; - }; - - /** - * Encodes the specified HTTPGetAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPGetAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {google.cloud.run.v2.IHTTPGetAction} message HTTPGetAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HTTPGetAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HTTPGetAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HTTPGetAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.HTTPGetAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.path = reader.string(); - break; - } - case 4: { - if (!(message.httpHeaders && message.httpHeaders.length)) - message.httpHeaders = []; - message.httpHeaders.push($root.google.cloud.run.v2.HTTPHeader.decode(reader, reader.uint32())); - break; - } - case 5: { - message.port = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HTTPGetAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HTTPGetAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HTTPGetAction message. - * @function verify - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HTTPGetAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - if (message.httpHeaders != null && message.hasOwnProperty("httpHeaders")) { - if (!Array.isArray(message.httpHeaders)) - return "httpHeaders: array expected"; - for (var i = 0; i < message.httpHeaders.length; ++i) { - var error = $root.google.cloud.run.v2.HTTPHeader.verify(message.httpHeaders[i]); - if (error) - return "httpHeaders." + error; - } - } - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isInteger(message.port)) - return "port: integer expected"; - return null; - }; - - /** - * Creates a HTTPGetAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.HTTPGetAction} HTTPGetAction - */ - HTTPGetAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.HTTPGetAction) - return object; - var message = new $root.google.cloud.run.v2.HTTPGetAction(); - if (object.path != null) - message.path = String(object.path); - if (object.httpHeaders) { - if (!Array.isArray(object.httpHeaders)) - throw TypeError(".google.cloud.run.v2.HTTPGetAction.httpHeaders: array expected"); - message.httpHeaders = []; - for (var i = 0; i < object.httpHeaders.length; ++i) { - if (typeof object.httpHeaders[i] !== "object") - throw TypeError(".google.cloud.run.v2.HTTPGetAction.httpHeaders: object expected"); - message.httpHeaders[i] = $root.google.cloud.run.v2.HTTPHeader.fromObject(object.httpHeaders[i]); - } - } - if (object.port != null) - message.port = object.port | 0; - return message; - }; - - /** - * Creates a plain object from a HTTPGetAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {google.cloud.run.v2.HTTPGetAction} message HTTPGetAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HTTPGetAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.httpHeaders = []; - if (options.defaults) { - object.path = ""; - object.port = 0; - } - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - if (message.httpHeaders && message.httpHeaders.length) { - object.httpHeaders = []; - for (var j = 0; j < message.httpHeaders.length; ++j) - object.httpHeaders[j] = $root.google.cloud.run.v2.HTTPHeader.toObject(message.httpHeaders[j], options); - } - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - return object; - }; - - /** - * Converts this HTTPGetAction to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.HTTPGetAction - * @instance - * @returns {Object.} JSON object - */ - HTTPGetAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HTTPGetAction - * @function getTypeUrl - * @memberof google.cloud.run.v2.HTTPGetAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HTTPGetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.HTTPGetAction"; - }; - - return HTTPGetAction; - })(); - - v2.HTTPHeader = (function() { - - /** - * Properties of a HTTPHeader. - * @memberof google.cloud.run.v2 - * @interface IHTTPHeader - * @property {string|null} [name] HTTPHeader name - * @property {string|null} [value] HTTPHeader value - */ - - /** - * Constructs a new HTTPHeader. - * @memberof google.cloud.run.v2 - * @classdesc Represents a HTTPHeader. - * @implements IHTTPHeader - * @constructor - * @param {google.cloud.run.v2.IHTTPHeader=} [properties] Properties to set - */ - function HTTPHeader(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HTTPHeader name. - * @member {string} name - * @memberof google.cloud.run.v2.HTTPHeader - * @instance - */ - HTTPHeader.prototype.name = ""; - - /** - * HTTPHeader value. - * @member {string} value - * @memberof google.cloud.run.v2.HTTPHeader - * @instance - */ - HTTPHeader.prototype.value = ""; - - /** - * Creates a new HTTPHeader instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {google.cloud.run.v2.IHTTPHeader=} [properties] Properties to set - * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader instance - */ - HTTPHeader.create = function create(properties) { - return new HTTPHeader(properties); - }; - - /** - * Encodes the specified HTTPHeader message. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {google.cloud.run.v2.IHTTPHeader} message HTTPHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HTTPHeader.encode = function encode(message, writer) { - if (!writer) - 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 && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - return writer; - }; - - /** - * Encodes the specified HTTPHeader message, length delimited. Does not implicitly {@link google.cloud.run.v2.HTTPHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {google.cloud.run.v2.IHTTPHeader} message HTTPHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HTTPHeader.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HTTPHeader message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HTTPHeader.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.HTTPHeader(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HTTPHeader message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HTTPHeader.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HTTPHeader message. - * @function verify - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HTTPHeader.verify = function verify(message) { - if (typeof message !== "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 (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a HTTPHeader message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.HTTPHeader} HTTPHeader - */ - HTTPHeader.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.HTTPHeader) - return object; - var message = new $root.google.cloud.run.v2.HTTPHeader(); - if (object.name != null) - message.name = String(object.name); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a HTTPHeader message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {google.cloud.run.v2.HTTPHeader} message HTTPHeader - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HTTPHeader.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.value = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this HTTPHeader to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.HTTPHeader - * @instance - * @returns {Object.} JSON object - */ - HTTPHeader.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HTTPHeader - * @function getTypeUrl - * @memberof google.cloud.run.v2.HTTPHeader - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HTTPHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.HTTPHeader"; - }; - - return HTTPHeader; - })(); - - v2.TCPSocketAction = (function() { - - /** - * Properties of a TCPSocketAction. - * @memberof google.cloud.run.v2 - * @interface ITCPSocketAction - * @property {number|null} [port] TCPSocketAction port - */ - - /** - * Constructs a new TCPSocketAction. - * @memberof google.cloud.run.v2 - * @classdesc Represents a TCPSocketAction. - * @implements ITCPSocketAction - * @constructor - * @param {google.cloud.run.v2.ITCPSocketAction=} [properties] Properties to set - */ - function TCPSocketAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TCPSocketAction port. - * @member {number} port - * @memberof google.cloud.run.v2.TCPSocketAction - * @instance - */ - TCPSocketAction.prototype.port = 0; - - /** - * Creates a new TCPSocketAction instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {google.cloud.run.v2.ITCPSocketAction=} [properties] Properties to set - * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction instance - */ - TCPSocketAction.create = function create(properties) { - return new TCPSocketAction(properties); - }; - - /** - * Encodes the specified TCPSocketAction message. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {google.cloud.run.v2.ITCPSocketAction} message TCPSocketAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TCPSocketAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port); - return writer; - }; - - /** - * Encodes the specified TCPSocketAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.TCPSocketAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {google.cloud.run.v2.ITCPSocketAction} message TCPSocketAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TCPSocketAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TCPSocketAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TCPSocketAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TCPSocketAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.port = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TCPSocketAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TCPSocketAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TCPSocketAction message. - * @function verify - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TCPSocketAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isInteger(message.port)) - return "port: integer expected"; - return null; - }; - - /** - * Creates a TCPSocketAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.TCPSocketAction} TCPSocketAction - */ - TCPSocketAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.TCPSocketAction) - return object; - var message = new $root.google.cloud.run.v2.TCPSocketAction(); - if (object.port != null) - message.port = object.port | 0; - return message; - }; - - /** - * Creates a plain object from a TCPSocketAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {google.cloud.run.v2.TCPSocketAction} message TCPSocketAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TCPSocketAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.port = 0; - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - return object; - }; - - /** - * Converts this TCPSocketAction to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.TCPSocketAction - * @instance - * @returns {Object.} JSON object - */ - TCPSocketAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TCPSocketAction - * @function getTypeUrl - * @memberof google.cloud.run.v2.TCPSocketAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TCPSocketAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.TCPSocketAction"; - }; - - return TCPSocketAction; - })(); - - v2.GRPCAction = (function() { - - /** - * Properties of a GRPCAction. - * @memberof google.cloud.run.v2 - * @interface IGRPCAction - * @property {number|null} [port] GRPCAction port - * @property {string|null} [service] GRPCAction service - */ - - /** - * Constructs a new GRPCAction. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GRPCAction. - * @implements IGRPCAction - * @constructor - * @param {google.cloud.run.v2.IGRPCAction=} [properties] Properties to set - */ - function GRPCAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GRPCAction port. - * @member {number} port - * @memberof google.cloud.run.v2.GRPCAction - * @instance - */ - GRPCAction.prototype.port = 0; - - /** - * GRPCAction service. - * @member {string} service - * @memberof google.cloud.run.v2.GRPCAction - * @instance - */ - GRPCAction.prototype.service = ""; - - /** - * Creates a new GRPCAction instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {google.cloud.run.v2.IGRPCAction=} [properties] Properties to set - * @returns {google.cloud.run.v2.GRPCAction} GRPCAction instance - */ - GRPCAction.create = function create(properties) { - return new GRPCAction(properties); - }; - - /** - * Encodes the specified GRPCAction message. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {google.cloud.run.v2.IGRPCAction} message GRPCAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GRPCAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - return writer; - }; - - /** - * Encodes the specified GRPCAction message, length delimited. Does not implicitly {@link google.cloud.run.v2.GRPCAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {google.cloud.run.v2.IGRPCAction} message GRPCAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GRPCAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GRPCAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GRPCAction} GRPCAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GRPCAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GRPCAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.port = reader.int32(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GRPCAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GRPCAction} GRPCAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GRPCAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GRPCAction message. - * @function verify - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GRPCAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isInteger(message.port)) - return "port: integer expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - return null; - }; - - /** - * Creates a GRPCAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GRPCAction} GRPCAction - */ - GRPCAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GRPCAction) - return object; - var message = new $root.google.cloud.run.v2.GRPCAction(); - if (object.port != null) - message.port = object.port | 0; - if (object.service != null) - message.service = String(object.service); - return message; - }; - - /** - * Creates a plain object from a GRPCAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {google.cloud.run.v2.GRPCAction} message GRPCAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GRPCAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.port = 0; - object.service = ""; - } - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - return object; - }; - - /** - * Converts this GRPCAction to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GRPCAction - * @instance - * @returns {Object.} JSON object - */ - GRPCAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GRPCAction - * @function getTypeUrl - * @memberof google.cloud.run.v2.GRPCAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GRPCAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GRPCAction"; - }; - - return GRPCAction; - })(); - - v2.BuildInfo = (function() { - - /** - * Properties of a BuildInfo. - * @memberof google.cloud.run.v2 - * @interface IBuildInfo - * @property {string|null} [functionTarget] BuildInfo functionTarget - * @property {string|null} [sourceLocation] BuildInfo sourceLocation - */ - - /** - * Constructs a new BuildInfo. - * @memberof google.cloud.run.v2 - * @classdesc Represents a BuildInfo. - * @implements IBuildInfo - * @constructor - * @param {google.cloud.run.v2.IBuildInfo=} [properties] Properties to set - */ - function BuildInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BuildInfo functionTarget. - * @member {string} functionTarget - * @memberof google.cloud.run.v2.BuildInfo - * @instance - */ - BuildInfo.prototype.functionTarget = ""; - - /** - * BuildInfo sourceLocation. - * @member {string} sourceLocation - * @memberof google.cloud.run.v2.BuildInfo - * @instance - */ - BuildInfo.prototype.sourceLocation = ""; - - /** - * Creates a new BuildInfo instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {google.cloud.run.v2.IBuildInfo=} [properties] Properties to set - * @returns {google.cloud.run.v2.BuildInfo} BuildInfo instance - */ - BuildInfo.create = function create(properties) { - return new BuildInfo(properties); - }; - - /** - * Encodes the specified BuildInfo message. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {google.cloud.run.v2.IBuildInfo} message BuildInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.functionTarget != null && Object.hasOwnProperty.call(message, "functionTarget")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.functionTarget); - if (message.sourceLocation != null && Object.hasOwnProperty.call(message, "sourceLocation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLocation); - return writer; - }; - - /** - * Encodes the specified BuildInfo message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {google.cloud.run.v2.IBuildInfo} message BuildInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BuildInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.BuildInfo} BuildInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.BuildInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.functionTarget = reader.string(); - break; - } - case 2: { - message.sourceLocation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BuildInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.BuildInfo} BuildInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BuildInfo message. - * @function verify - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BuildInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - if (!$util.isString(message.functionTarget)) - return "functionTarget: string expected"; - if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) - if (!$util.isString(message.sourceLocation)) - return "sourceLocation: string expected"; - return null; - }; - - /** - * Creates a BuildInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.BuildInfo} BuildInfo - */ - BuildInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.BuildInfo) - return object; - var message = new $root.google.cloud.run.v2.BuildInfo(); - if (object.functionTarget != null) - message.functionTarget = String(object.functionTarget); - if (object.sourceLocation != null) - message.sourceLocation = String(object.sourceLocation); - return message; - }; - - /** - * Creates a plain object from a BuildInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {google.cloud.run.v2.BuildInfo} message BuildInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BuildInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.functionTarget = ""; - object.sourceLocation = ""; - } - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - object.functionTarget = message.functionTarget; - if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) - object.sourceLocation = message.sourceLocation; - return object; - }; - - /** - * Converts this BuildInfo to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.BuildInfo - * @instance - * @returns {Object.} JSON object - */ - BuildInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BuildInfo - * @function getTypeUrl - * @memberof google.cloud.run.v2.BuildInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BuildInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.BuildInfo"; - }; - - return BuildInfo; - })(); - - v2.SourceCode = (function() { - - /** - * Properties of a SourceCode. - * @memberof google.cloud.run.v2 - * @interface ISourceCode - * @property {google.cloud.run.v2.SourceCode.ICloudStorageSource|null} [cloudStorageSource] SourceCode cloudStorageSource - */ - - /** - * Constructs a new SourceCode. - * @memberof google.cloud.run.v2 - * @classdesc Represents a SourceCode. - * @implements ISourceCode - * @constructor - * @param {google.cloud.run.v2.ISourceCode=} [properties] Properties to set - */ - function SourceCode(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCode cloudStorageSource. - * @member {google.cloud.run.v2.SourceCode.ICloudStorageSource|null|undefined} cloudStorageSource - * @memberof google.cloud.run.v2.SourceCode - * @instance - */ - SourceCode.prototype.cloudStorageSource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SourceCode sourceType. - * @member {"cloudStorageSource"|undefined} sourceType - * @memberof google.cloud.run.v2.SourceCode - * @instance - */ - Object.defineProperty(SourceCode.prototype, "sourceType", { - get: $util.oneOfGetter($oneOfFields = ["cloudStorageSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SourceCode instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {google.cloud.run.v2.ISourceCode=} [properties] Properties to set - * @returns {google.cloud.run.v2.SourceCode} SourceCode instance - */ - SourceCode.create = function create(properties) { - return new SourceCode(properties); - }; - - /** - * Encodes the specified SourceCode message. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {google.cloud.run.v2.ISourceCode} message SourceCode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cloudStorageSource != null && Object.hasOwnProperty.call(message, "cloudStorageSource")) - $root.google.cloud.run.v2.SourceCode.CloudStorageSource.encode(message.cloudStorageSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCode message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {google.cloud.run.v2.ISourceCode} message SourceCode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SourceCode} SourceCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SourceCode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.cloudStorageSource = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SourceCode} SourceCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCode message. - * @function verify - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.cloudStorageSource != null && message.hasOwnProperty("cloudStorageSource")) { - properties.sourceType = 1; - { - var error = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.verify(message.cloudStorageSource); - if (error) - return "cloudStorageSource." + error; - } - } - return null; - }; - - /** - * Creates a SourceCode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SourceCode} SourceCode - */ - SourceCode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SourceCode) - return object; - var message = new $root.google.cloud.run.v2.SourceCode(); - if (object.cloudStorageSource != null) { - if (typeof object.cloudStorageSource !== "object") - throw TypeError(".google.cloud.run.v2.SourceCode.cloudStorageSource: object expected"); - message.cloudStorageSource = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.fromObject(object.cloudStorageSource); - } - return message; - }; - - /** - * Creates a plain object from a SourceCode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {google.cloud.run.v2.SourceCode} message SourceCode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.cloudStorageSource != null && message.hasOwnProperty("cloudStorageSource")) { - object.cloudStorageSource = $root.google.cloud.run.v2.SourceCode.CloudStorageSource.toObject(message.cloudStorageSource, options); - if (options.oneofs) - object.sourceType = "cloudStorageSource"; - } - return object; - }; - - /** - * Converts this SourceCode to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SourceCode - * @instance - * @returns {Object.} JSON object - */ - SourceCode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCode - * @function getTypeUrl - * @memberof google.cloud.run.v2.SourceCode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SourceCode"; - }; - - SourceCode.CloudStorageSource = (function() { - - /** - * Properties of a CloudStorageSource. - * @memberof google.cloud.run.v2.SourceCode - * @interface ICloudStorageSource - * @property {string|null} [bucket] CloudStorageSource bucket - * @property {string|null} [object] CloudStorageSource object - * @property {number|Long|null} [generation] CloudStorageSource generation - */ - - /** - * Constructs a new CloudStorageSource. - * @memberof google.cloud.run.v2.SourceCode - * @classdesc Represents a CloudStorageSource. - * @implements ICloudStorageSource - * @constructor - * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource=} [properties] Properties to set - */ - function CloudStorageSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudStorageSource bucket. - * @member {string} bucket - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @instance - */ - CloudStorageSource.prototype.bucket = ""; - - /** - * CloudStorageSource object. - * @member {string} object - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @instance - */ - CloudStorageSource.prototype.object = ""; - - /** - * CloudStorageSource generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @instance - */ - CloudStorageSource.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new CloudStorageSource instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource=} [properties] Properties to set - * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource instance - */ - CloudStorageSource.create = function create(properties) { - return new CloudStorageSource(properties); - }; - - /** - * Encodes the specified CloudStorageSource message. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource} message CloudStorageSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudStorageSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); - if (message.object != null && Object.hasOwnProperty.call(message, "object")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - return writer; - }; - - /** - * Encodes the specified CloudStorageSource message, length delimited. Does not implicitly {@link google.cloud.run.v2.SourceCode.CloudStorageSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {google.cloud.run.v2.SourceCode.ICloudStorageSource} message CloudStorageSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudStorageSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudStorageSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudStorageSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.SourceCode.CloudStorageSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.bucket = reader.string(); - break; - } - case 2: { - message.object = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudStorageSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudStorageSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudStorageSource message. - * @function verify - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudStorageSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bucket != null && message.hasOwnProperty("bucket")) - if (!$util.isString(message.bucket)) - return "bucket: string expected"; - if (message.object != null && message.hasOwnProperty("object")) - if (!$util.isString(message.object)) - return "object: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - return null; - }; - - /** - * Creates a CloudStorageSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.SourceCode.CloudStorageSource} CloudStorageSource - */ - CloudStorageSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.SourceCode.CloudStorageSource) - return object; - var message = new $root.google.cloud.run.v2.SourceCode.CloudStorageSource(); - if (object.bucket != null) - message.bucket = String(object.bucket); - if (object.object != null) - message.object = String(object.object); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a CloudStorageSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {google.cloud.run.v2.SourceCode.CloudStorageSource} message CloudStorageSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudStorageSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.bucket = ""; - object.object = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - } - if (message.bucket != null && message.hasOwnProperty("bucket")) - object.bucket = message.bucket; - if (message.object != null && message.hasOwnProperty("object")) - object.object = message.object; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - return object; - }; - - /** - * Converts this CloudStorageSource to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @instance - * @returns {Object.} JSON object - */ - CloudStorageSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudStorageSource - * @function getTypeUrl - * @memberof google.cloud.run.v2.SourceCode.CloudStorageSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudStorageSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.SourceCode.CloudStorageSource"; - }; - - return CloudStorageSource; - })(); - - return SourceCode; - })(); - - v2.VpcAccess = (function() { - - /** - * Properties of a VpcAccess. - * @memberof google.cloud.run.v2 - * @interface IVpcAccess - * @property {string|null} [connector] VpcAccess connector - * @property {google.cloud.run.v2.VpcAccess.VpcEgress|null} [egress] VpcAccess egress - * @property {Array.|null} [networkInterfaces] VpcAccess networkInterfaces - */ - - /** - * Constructs a new VpcAccess. - * @memberof google.cloud.run.v2 - * @classdesc Represents a VpcAccess. - * @implements IVpcAccess - * @constructor - * @param {google.cloud.run.v2.IVpcAccess=} [properties] Properties to set - */ - function VpcAccess(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]]; - } - - /** - * VpcAccess connector. - * @member {string} connector - * @memberof google.cloud.run.v2.VpcAccess - * @instance - */ - VpcAccess.prototype.connector = ""; - - /** - * VpcAccess egress. - * @member {google.cloud.run.v2.VpcAccess.VpcEgress} egress - * @memberof google.cloud.run.v2.VpcAccess - * @instance - */ - VpcAccess.prototype.egress = 0; - - /** - * VpcAccess networkInterfaces. - * @member {Array.} networkInterfaces - * @memberof google.cloud.run.v2.VpcAccess - * @instance - */ - VpcAccess.prototype.networkInterfaces = $util.emptyArray; - - /** - * Creates a new VpcAccess instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {google.cloud.run.v2.IVpcAccess=} [properties] Properties to set - * @returns {google.cloud.run.v2.VpcAccess} VpcAccess instance - */ - VpcAccess.create = function create(properties) { - return new VpcAccess(properties); - }; - - /** - * Encodes the specified VpcAccess message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {google.cloud.run.v2.IVpcAccess} message VpcAccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VpcAccess.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.connector != null && Object.hasOwnProperty.call(message, "connector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.connector); - if (message.egress != null && Object.hasOwnProperty.call(message, "egress")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.egress); - if (message.networkInterfaces != null && message.networkInterfaces.length) - for (var i = 0; i < message.networkInterfaces.length; ++i) - $root.google.cloud.run.v2.VpcAccess.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VpcAccess message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {google.cloud.run.v2.IVpcAccess} message VpcAccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VpcAccess.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VpcAccess message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.VpcAccess} VpcAccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VpcAccess.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VpcAccess(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.connector = reader.string(); - break; - } - case 2: { - message.egress = reader.int32(); - break; - } - case 3: { - if (!(message.networkInterfaces && message.networkInterfaces.length)) - message.networkInterfaces = []; - message.networkInterfaces.push($root.google.cloud.run.v2.VpcAccess.NetworkInterface.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VpcAccess message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.VpcAccess} VpcAccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VpcAccess.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VpcAccess message. - * @function verify - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VpcAccess.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.connector != null && message.hasOwnProperty("connector")) - if (!$util.isString(message.connector)) - return "connector: string expected"; - if (message.egress != null && message.hasOwnProperty("egress")) - switch (message.egress) { - default: - return "egress: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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.run.v2.VpcAccess.NetworkInterface.verify(message.networkInterfaces[i]); - if (error) - return "networkInterfaces." + error; - } - } - return null; - }; - - /** - * Creates a VpcAccess message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.VpcAccess} VpcAccess - */ - VpcAccess.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.VpcAccess) - return object; - var message = new $root.google.cloud.run.v2.VpcAccess(); - if (object.connector != null) - message.connector = String(object.connector); - switch (object.egress) { - default: - if (typeof object.egress === "number") { - message.egress = object.egress; - break; - } - break; - case "VPC_EGRESS_UNSPECIFIED": - case 0: - message.egress = 0; - break; - case "ALL_TRAFFIC": - case 1: - message.egress = 1; - break; - case "PRIVATE_RANGES_ONLY": - case 2: - message.egress = 2; - break; - } - if (object.networkInterfaces) { - if (!Array.isArray(object.networkInterfaces)) - throw TypeError(".google.cloud.run.v2.VpcAccess.networkInterfaces: array expected"); - message.networkInterfaces = []; - for (var i = 0; i < object.networkInterfaces.length; ++i) { - if (typeof object.networkInterfaces[i] !== "object") - throw TypeError(".google.cloud.run.v2.VpcAccess.networkInterfaces: object expected"); - message.networkInterfaces[i] = $root.google.cloud.run.v2.VpcAccess.NetworkInterface.fromObject(object.networkInterfaces[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a VpcAccess message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {google.cloud.run.v2.VpcAccess} message VpcAccess - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VpcAccess.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.networkInterfaces = []; - if (options.defaults) { - object.connector = ""; - object.egress = options.enums === String ? "VPC_EGRESS_UNSPECIFIED" : 0; - } - if (message.connector != null && message.hasOwnProperty("connector")) - object.connector = message.connector; - if (message.egress != null && message.hasOwnProperty("egress")) - object.egress = options.enums === String ? $root.google.cloud.run.v2.VpcAccess.VpcEgress[message.egress] === undefined ? message.egress : $root.google.cloud.run.v2.VpcAccess.VpcEgress[message.egress] : message.egress; - if (message.networkInterfaces && message.networkInterfaces.length) { - object.networkInterfaces = []; - for (var j = 0; j < message.networkInterfaces.length; ++j) - object.networkInterfaces[j] = $root.google.cloud.run.v2.VpcAccess.NetworkInterface.toObject(message.networkInterfaces[j], options); - } - return object; - }; - - /** - * Converts this VpcAccess to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.VpcAccess - * @instance - * @returns {Object.} JSON object - */ - VpcAccess.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VpcAccess - * @function getTypeUrl - * @memberof google.cloud.run.v2.VpcAccess - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VpcAccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.VpcAccess"; - }; - - /** - * VpcEgress enum. - * @name google.cloud.run.v2.VpcAccess.VpcEgress - * @enum {number} - * @property {number} VPC_EGRESS_UNSPECIFIED=0 VPC_EGRESS_UNSPECIFIED value - * @property {number} ALL_TRAFFIC=1 ALL_TRAFFIC value - * @property {number} PRIVATE_RANGES_ONLY=2 PRIVATE_RANGES_ONLY value - */ - VpcAccess.VpcEgress = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VPC_EGRESS_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALL_TRAFFIC"] = 1; - values[valuesById[2] = "PRIVATE_RANGES_ONLY"] = 2; - return values; - })(); - - VpcAccess.NetworkInterface = (function() { - - /** - * Properties of a NetworkInterface. - * @memberof google.cloud.run.v2.VpcAccess - * @interface INetworkInterface - * @property {string|null} [network] NetworkInterface network - * @property {string|null} [subnetwork] NetworkInterface subnetwork - * @property {Array.|null} [tags] NetworkInterface tags - */ - - /** - * Constructs a new NetworkInterface. - * @memberof google.cloud.run.v2.VpcAccess - * @classdesc Represents a NetworkInterface. - * @implements INetworkInterface - * @constructor - * @param {google.cloud.run.v2.VpcAccess.INetworkInterface=} [properties] Properties to set - */ - function NetworkInterface(properties) { - 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]]; - } - - /** - * NetworkInterface network. - * @member {string} network - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @instance - */ - NetworkInterface.prototype.network = ""; - - /** - * NetworkInterface subnetwork. - * @member {string} subnetwork - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @instance - */ - NetworkInterface.prototype.subnetwork = ""; - - /** - * NetworkInterface tags. - * @member {Array.} tags - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @instance - */ - NetworkInterface.prototype.tags = $util.emptyArray; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @static - * @param {google.cloud.run.v2.VpcAccess.INetworkInterface=} [properties] Properties to set - * @returns {google.cloud.run.v2.VpcAccess.NetworkInterface} NetworkInterface instance - */ - NetworkInterface.create = function create(properties) { - return new NetworkInterface(properties); - }; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.run.v2.VpcAccess.NetworkInterface.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @static - * @param {google.cloud.run.v2.VpcAccess.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.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tags[i]); - return writer; - }; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.run.v2.VpcAccess.NetworkInterface.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @static - * @param {google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.VpcAccess.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.VpcAccess.NetworkInterface(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.subnetwork = reader.string(); - break; - } - case 3: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - 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.run.v2.VpcAccess.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.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.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 a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.VpcAccess.NetworkInterface} NetworkInterface - */ - NetworkInterface.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.VpcAccess.NetworkInterface) - return object; - var message = new $root.google.cloud.run.v2.VpcAccess.NetworkInterface(); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.run.v2.VpcAccess.NetworkInterface.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 a NetworkInterface message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.VpcAccess.NetworkInterface - * @static - * @param {google.cloud.run.v2.VpcAccess.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.arrays || options.defaults) - object.tags = []; - if (options.defaults) { - object.network = ""; - object.subnetwork = ""; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - object.subnetwork = message.subnetwork; - 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 NetworkInterface to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.VpcAccess.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.run.v2.VpcAccess.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.run.v2.VpcAccess.NetworkInterface"; - }; - - return NetworkInterface; - })(); - - return VpcAccess; - })(); - - v2.BinaryAuthorization = (function() { - - /** - * Properties of a BinaryAuthorization. - * @memberof google.cloud.run.v2 - * @interface IBinaryAuthorization - * @property {boolean|null} [useDefault] BinaryAuthorization useDefault - * @property {string|null} [policy] BinaryAuthorization policy - * @property {string|null} [breakglassJustification] BinaryAuthorization breakglassJustification - */ - - /** - * Constructs a new BinaryAuthorization. - * @memberof google.cloud.run.v2 - * @classdesc Represents a BinaryAuthorization. - * @implements IBinaryAuthorization - * @constructor - * @param {google.cloud.run.v2.IBinaryAuthorization=} [properties] Properties to set - */ - function BinaryAuthorization(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BinaryAuthorization useDefault. - * @member {boolean|null|undefined} useDefault - * @memberof google.cloud.run.v2.BinaryAuthorization - * @instance - */ - BinaryAuthorization.prototype.useDefault = null; - - /** - * BinaryAuthorization policy. - * @member {string|null|undefined} policy - * @memberof google.cloud.run.v2.BinaryAuthorization - * @instance - */ - BinaryAuthorization.prototype.policy = null; - - /** - * BinaryAuthorization breakglassJustification. - * @member {string} breakglassJustification - * @memberof google.cloud.run.v2.BinaryAuthorization - * @instance - */ - BinaryAuthorization.prototype.breakglassJustification = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BinaryAuthorization binauthzMethod. - * @member {"useDefault"|"policy"|undefined} binauthzMethod - * @memberof google.cloud.run.v2.BinaryAuthorization - * @instance - */ - Object.defineProperty(BinaryAuthorization.prototype, "binauthzMethod", { - get: $util.oneOfGetter($oneOfFields = ["useDefault", "policy"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BinaryAuthorization instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {google.cloud.run.v2.IBinaryAuthorization=} [properties] Properties to set - * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization instance - */ - BinaryAuthorization.create = function create(properties) { - return new BinaryAuthorization(properties); - }; - - /** - * Encodes the specified BinaryAuthorization message. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {google.cloud.run.v2.IBinaryAuthorization} message BinaryAuthorization message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BinaryAuthorization.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.useDefault != null && Object.hasOwnProperty.call(message, "useDefault")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useDefault); - if (message.breakglassJustification != null && Object.hasOwnProperty.call(message, "breakglassJustification")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.breakglassJustification); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.policy); - return writer; - }; - - /** - * Encodes the specified BinaryAuthorization message, length delimited. Does not implicitly {@link google.cloud.run.v2.BinaryAuthorization.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {google.cloud.run.v2.IBinaryAuthorization} message BinaryAuthorization message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BinaryAuthorization.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BinaryAuthorization message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BinaryAuthorization.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.BinaryAuthorization(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.useDefault = reader.bool(); - break; - } - case 3: { - message.policy = reader.string(); - break; - } - case 2: { - message.breakglassJustification = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BinaryAuthorization message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BinaryAuthorization.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BinaryAuthorization message. - * @function verify - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BinaryAuthorization.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.useDefault != null && message.hasOwnProperty("useDefault")) { - properties.binauthzMethod = 1; - if (typeof message.useDefault !== "boolean") - return "useDefault: boolean expected"; - } - if (message.policy != null && message.hasOwnProperty("policy")) { - if (properties.binauthzMethod === 1) - return "binauthzMethod: multiple values"; - properties.binauthzMethod = 1; - if (!$util.isString(message.policy)) - return "policy: string expected"; - } - if (message.breakglassJustification != null && message.hasOwnProperty("breakglassJustification")) - if (!$util.isString(message.breakglassJustification)) - return "breakglassJustification: string expected"; - return null; - }; - - /** - * Creates a BinaryAuthorization message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.BinaryAuthorization} BinaryAuthorization - */ - BinaryAuthorization.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.BinaryAuthorization) - return object; - var message = new $root.google.cloud.run.v2.BinaryAuthorization(); - if (object.useDefault != null) - message.useDefault = Boolean(object.useDefault); - if (object.policy != null) - message.policy = String(object.policy); - if (object.breakglassJustification != null) - message.breakglassJustification = String(object.breakglassJustification); - return message; - }; - - /** - * Creates a plain object from a BinaryAuthorization message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {google.cloud.run.v2.BinaryAuthorization} message BinaryAuthorization - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BinaryAuthorization.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.breakglassJustification = ""; - if (message.useDefault != null && message.hasOwnProperty("useDefault")) { - object.useDefault = message.useDefault; - if (options.oneofs) - object.binauthzMethod = "useDefault"; - } - if (message.breakglassJustification != null && message.hasOwnProperty("breakglassJustification")) - object.breakglassJustification = message.breakglassJustification; - if (message.policy != null && message.hasOwnProperty("policy")) { - object.policy = message.policy; - if (options.oneofs) - object.binauthzMethod = "policy"; - } - return object; - }; - - /** - * Converts this BinaryAuthorization to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.BinaryAuthorization - * @instance - * @returns {Object.} JSON object - */ - BinaryAuthorization.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BinaryAuthorization - * @function getTypeUrl - * @memberof google.cloud.run.v2.BinaryAuthorization - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BinaryAuthorization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.BinaryAuthorization"; - }; - - return BinaryAuthorization; - })(); - - v2.RevisionScaling = (function() { - - /** - * Properties of a RevisionScaling. - * @memberof google.cloud.run.v2 - * @interface IRevisionScaling - * @property {number|null} [minInstanceCount] RevisionScaling minInstanceCount - * @property {number|null} [maxInstanceCount] RevisionScaling maxInstanceCount - */ - - /** - * Constructs a new RevisionScaling. - * @memberof google.cloud.run.v2 - * @classdesc Represents a RevisionScaling. - * @implements IRevisionScaling - * @constructor - * @param {google.cloud.run.v2.IRevisionScaling=} [properties] Properties to set - */ - function RevisionScaling(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RevisionScaling minInstanceCount. - * @member {number} minInstanceCount - * @memberof google.cloud.run.v2.RevisionScaling - * @instance - */ - RevisionScaling.prototype.minInstanceCount = 0; - - /** - * RevisionScaling maxInstanceCount. - * @member {number} maxInstanceCount - * @memberof google.cloud.run.v2.RevisionScaling - * @instance - */ - RevisionScaling.prototype.maxInstanceCount = 0; - - /** - * Creates a new RevisionScaling instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {google.cloud.run.v2.IRevisionScaling=} [properties] Properties to set - * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling instance - */ - RevisionScaling.create = function create(properties) { - return new RevisionScaling(properties); - }; - - /** - * Encodes the specified RevisionScaling message. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {google.cloud.run.v2.IRevisionScaling} message RevisionScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionScaling.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minInstanceCount != null && Object.hasOwnProperty.call(message, "minInstanceCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minInstanceCount); - if (message.maxInstanceCount != null && Object.hasOwnProperty.call(message, "maxInstanceCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxInstanceCount); - return writer; - }; - - /** - * Encodes the specified RevisionScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScaling.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {google.cloud.run.v2.IRevisionScaling} message RevisionScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionScaling.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevisionScaling message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionScaling.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RevisionScaling(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minInstanceCount = reader.int32(); - break; - } - case 2: { - message.maxInstanceCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevisionScaling message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionScaling.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevisionScaling message. - * @function verify - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevisionScaling.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) - if (!$util.isInteger(message.minInstanceCount)) - return "minInstanceCount: integer expected"; - if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) - if (!$util.isInteger(message.maxInstanceCount)) - return "maxInstanceCount: integer expected"; - return null; - }; - - /** - * Creates a RevisionScaling message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RevisionScaling} RevisionScaling - */ - RevisionScaling.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RevisionScaling) - return object; - var message = new $root.google.cloud.run.v2.RevisionScaling(); - if (object.minInstanceCount != null) - message.minInstanceCount = object.minInstanceCount | 0; - if (object.maxInstanceCount != null) - message.maxInstanceCount = object.maxInstanceCount | 0; - return message; - }; - - /** - * Creates a plain object from a RevisionScaling message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {google.cloud.run.v2.RevisionScaling} message RevisionScaling - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevisionScaling.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minInstanceCount = 0; - object.maxInstanceCount = 0; - } - if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) - object.minInstanceCount = message.minInstanceCount; - if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) - object.maxInstanceCount = message.maxInstanceCount; - return object; - }; - - /** - * Converts this RevisionScaling to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RevisionScaling - * @instance - * @returns {Object.} JSON object - */ - RevisionScaling.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevisionScaling - * @function getTypeUrl - * @memberof google.cloud.run.v2.RevisionScaling - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevisionScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RevisionScaling"; - }; - - return RevisionScaling; - })(); - - v2.ServiceMesh = (function() { - - /** - * Properties of a ServiceMesh. - * @memberof google.cloud.run.v2 - * @interface IServiceMesh - * @property {string|null} [mesh] ServiceMesh mesh - */ - - /** - * Constructs a new ServiceMesh. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ServiceMesh. - * @implements IServiceMesh - * @constructor - * @param {google.cloud.run.v2.IServiceMesh=} [properties] Properties to set - */ - function ServiceMesh(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceMesh mesh. - * @member {string} mesh - * @memberof google.cloud.run.v2.ServiceMesh - * @instance - */ - ServiceMesh.prototype.mesh = ""; - - /** - * Creates a new ServiceMesh instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {google.cloud.run.v2.IServiceMesh=} [properties] Properties to set - * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh instance - */ - ServiceMesh.create = function create(properties) { - return new ServiceMesh(properties); - }; - - /** - * Encodes the specified ServiceMesh message. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {google.cloud.run.v2.IServiceMesh} message ServiceMesh message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceMesh.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mesh != null && Object.hasOwnProperty.call(message, "mesh")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mesh); - return writer; - }; - - /** - * Encodes the specified ServiceMesh message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceMesh.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {google.cloud.run.v2.IServiceMesh} message ServiceMesh message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceMesh.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceMesh message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceMesh.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ServiceMesh(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mesh = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceMesh message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceMesh.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceMesh message. - * @function verify - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceMesh.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mesh != null && message.hasOwnProperty("mesh")) - if (!$util.isString(message.mesh)) - return "mesh: string expected"; - return null; - }; - - /** - * Creates a ServiceMesh message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ServiceMesh} ServiceMesh - */ - ServiceMesh.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ServiceMesh) - return object; - var message = new $root.google.cloud.run.v2.ServiceMesh(); - if (object.mesh != null) - message.mesh = String(object.mesh); - return message; - }; - - /** - * Creates a plain object from a ServiceMesh message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {google.cloud.run.v2.ServiceMesh} message ServiceMesh - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceMesh.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.mesh = ""; - if (message.mesh != null && message.hasOwnProperty("mesh")) - object.mesh = message.mesh; - return object; - }; - - /** - * Converts this ServiceMesh to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ServiceMesh - * @instance - * @returns {Object.} JSON object - */ - ServiceMesh.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceMesh - * @function getTypeUrl - * @memberof google.cloud.run.v2.ServiceMesh - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceMesh.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ServiceMesh"; - }; - - return ServiceMesh; - })(); - - v2.ServiceScaling = (function() { - - /** - * Properties of a ServiceScaling. - * @memberof google.cloud.run.v2 - * @interface IServiceScaling - * @property {number|null} [minInstanceCount] ServiceScaling minInstanceCount - * @property {google.cloud.run.v2.ServiceScaling.ScalingMode|null} [scalingMode] ServiceScaling scalingMode - * @property {number|null} [maxInstanceCount] ServiceScaling maxInstanceCount - * @property {number|null} [manualInstanceCount] ServiceScaling manualInstanceCount - */ - - /** - * Constructs a new ServiceScaling. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ServiceScaling. - * @implements IServiceScaling - * @constructor - * @param {google.cloud.run.v2.IServiceScaling=} [properties] Properties to set - */ - function ServiceScaling(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceScaling minInstanceCount. - * @member {number} minInstanceCount - * @memberof google.cloud.run.v2.ServiceScaling - * @instance - */ - ServiceScaling.prototype.minInstanceCount = 0; - - /** - * ServiceScaling scalingMode. - * @member {google.cloud.run.v2.ServiceScaling.ScalingMode} scalingMode - * @memberof google.cloud.run.v2.ServiceScaling - * @instance - */ - ServiceScaling.prototype.scalingMode = 0; - - /** - * ServiceScaling maxInstanceCount. - * @member {number} maxInstanceCount - * @memberof google.cloud.run.v2.ServiceScaling - * @instance - */ - ServiceScaling.prototype.maxInstanceCount = 0; - - /** - * ServiceScaling manualInstanceCount. - * @member {number|null|undefined} manualInstanceCount - * @memberof google.cloud.run.v2.ServiceScaling - * @instance - */ - ServiceScaling.prototype.manualInstanceCount = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ServiceScaling.prototype, "_manualInstanceCount", { - get: $util.oneOfGetter($oneOfFields = ["manualInstanceCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ServiceScaling instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {google.cloud.run.v2.IServiceScaling=} [properties] Properties to set - * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling instance - */ - ServiceScaling.create = function create(properties) { - return new ServiceScaling(properties); - }; - - /** - * Encodes the specified ServiceScaling message. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {google.cloud.run.v2.IServiceScaling} message ServiceScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceScaling.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minInstanceCount != null && Object.hasOwnProperty.call(message, "minInstanceCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minInstanceCount); - if (message.scalingMode != null && Object.hasOwnProperty.call(message, "scalingMode")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.scalingMode); - if (message.maxInstanceCount != null && Object.hasOwnProperty.call(message, "maxInstanceCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxInstanceCount); - if (message.manualInstanceCount != null && Object.hasOwnProperty.call(message, "manualInstanceCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.manualInstanceCount); - return writer; - }; - - /** - * Encodes the specified ServiceScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.ServiceScaling.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {google.cloud.run.v2.IServiceScaling} message ServiceScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceScaling.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceScaling message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceScaling.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ServiceScaling(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minInstanceCount = reader.int32(); - break; - } - case 3: { - message.scalingMode = reader.int32(); - break; - } - case 4: { - message.maxInstanceCount = reader.int32(); - break; - } - case 6: { - message.manualInstanceCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceScaling message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceScaling.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceScaling message. - * @function verify - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceScaling.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) - if (!$util.isInteger(message.minInstanceCount)) - return "minInstanceCount: integer expected"; - if (message.scalingMode != null && message.hasOwnProperty("scalingMode")) - switch (message.scalingMode) { - default: - return "scalingMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) - if (!$util.isInteger(message.maxInstanceCount)) - return "maxInstanceCount: integer expected"; - if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { - properties._manualInstanceCount = 1; - if (!$util.isInteger(message.manualInstanceCount)) - return "manualInstanceCount: integer expected"; - } - return null; - }; - - /** - * Creates a ServiceScaling message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ServiceScaling} ServiceScaling - */ - ServiceScaling.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ServiceScaling) - return object; - var message = new $root.google.cloud.run.v2.ServiceScaling(); - if (object.minInstanceCount != null) - message.minInstanceCount = object.minInstanceCount | 0; - switch (object.scalingMode) { - default: - if (typeof object.scalingMode === "number") { - message.scalingMode = object.scalingMode; - break; - } - break; - case "SCALING_MODE_UNSPECIFIED": - case 0: - message.scalingMode = 0; - break; - case "AUTOMATIC": - case 1: - message.scalingMode = 1; - break; - case "MANUAL": - case 2: - message.scalingMode = 2; - break; - } - if (object.maxInstanceCount != null) - message.maxInstanceCount = object.maxInstanceCount | 0; - if (object.manualInstanceCount != null) - message.manualInstanceCount = object.manualInstanceCount | 0; - return message; - }; - - /** - * Creates a plain object from a ServiceScaling message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {google.cloud.run.v2.ServiceScaling} message ServiceScaling - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceScaling.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minInstanceCount = 0; - object.scalingMode = options.enums === String ? "SCALING_MODE_UNSPECIFIED" : 0; - object.maxInstanceCount = 0; - } - if (message.minInstanceCount != null && message.hasOwnProperty("minInstanceCount")) - object.minInstanceCount = message.minInstanceCount; - if (message.scalingMode != null && message.hasOwnProperty("scalingMode")) - object.scalingMode = options.enums === String ? $root.google.cloud.run.v2.ServiceScaling.ScalingMode[message.scalingMode] === undefined ? message.scalingMode : $root.google.cloud.run.v2.ServiceScaling.ScalingMode[message.scalingMode] : message.scalingMode; - if (message.maxInstanceCount != null && message.hasOwnProperty("maxInstanceCount")) - object.maxInstanceCount = message.maxInstanceCount; - if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { - object.manualInstanceCount = message.manualInstanceCount; - if (options.oneofs) - object._manualInstanceCount = "manualInstanceCount"; - } - return object; - }; - - /** - * Converts this ServiceScaling to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ServiceScaling - * @instance - * @returns {Object.} JSON object - */ - ServiceScaling.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceScaling - * @function getTypeUrl - * @memberof google.cloud.run.v2.ServiceScaling - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ServiceScaling"; - }; - - /** - * ScalingMode enum. - * @name google.cloud.run.v2.ServiceScaling.ScalingMode - * @enum {number} - * @property {number} SCALING_MODE_UNSPECIFIED=0 SCALING_MODE_UNSPECIFIED value - * @property {number} AUTOMATIC=1 AUTOMATIC value - * @property {number} MANUAL=2 MANUAL value - */ - ServiceScaling.ScalingMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCALING_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUTOMATIC"] = 1; - values[valuesById[2] = "MANUAL"] = 2; - return values; - })(); - - return ServiceScaling; - })(); - - v2.WorkerPoolScaling = (function() { - - /** - * Properties of a WorkerPoolScaling. - * @memberof google.cloud.run.v2 - * @interface IWorkerPoolScaling - * @property {number|null} [manualInstanceCount] WorkerPoolScaling manualInstanceCount - */ - - /** - * Constructs a new WorkerPoolScaling. - * @memberof google.cloud.run.v2 - * @classdesc Represents a WorkerPoolScaling. - * @implements IWorkerPoolScaling - * @constructor - * @param {google.cloud.run.v2.IWorkerPoolScaling=} [properties] Properties to set - */ - function WorkerPoolScaling(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkerPoolScaling manualInstanceCount. - * @member {number|null|undefined} manualInstanceCount - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @instance - */ - WorkerPoolScaling.prototype.manualInstanceCount = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(WorkerPoolScaling.prototype, "_manualInstanceCount", { - get: $util.oneOfGetter($oneOfFields = ["manualInstanceCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WorkerPoolScaling instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {google.cloud.run.v2.IWorkerPoolScaling=} [properties] Properties to set - * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling instance - */ - WorkerPoolScaling.create = function create(properties) { - return new WorkerPoolScaling(properties); - }; - - /** - * Encodes the specified WorkerPoolScaling message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {google.cloud.run.v2.IWorkerPoolScaling} message WorkerPoolScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPoolScaling.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.manualInstanceCount != null && Object.hasOwnProperty.call(message, "manualInstanceCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.manualInstanceCount); - return writer; - }; - - /** - * Encodes the specified WorkerPoolScaling message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolScaling.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {google.cloud.run.v2.IWorkerPoolScaling} message WorkerPoolScaling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPoolScaling.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkerPoolScaling message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPoolScaling.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.WorkerPoolScaling(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 6: { - message.manualInstanceCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkerPoolScaling message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPoolScaling.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkerPoolScaling message. - * @function verify - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkerPoolScaling.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { - properties._manualInstanceCount = 1; - if (!$util.isInteger(message.manualInstanceCount)) - return "manualInstanceCount: integer expected"; - } - return null; - }; - - /** - * Creates a WorkerPoolScaling message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.WorkerPoolScaling} WorkerPoolScaling - */ - WorkerPoolScaling.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.WorkerPoolScaling) - return object; - var message = new $root.google.cloud.run.v2.WorkerPoolScaling(); - if (object.manualInstanceCount != null) - message.manualInstanceCount = object.manualInstanceCount | 0; - return message; - }; - - /** - * Creates a plain object from a WorkerPoolScaling message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {google.cloud.run.v2.WorkerPoolScaling} message WorkerPoolScaling - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkerPoolScaling.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.manualInstanceCount != null && message.hasOwnProperty("manualInstanceCount")) { - object.manualInstanceCount = message.manualInstanceCount; - if (options.oneofs) - object._manualInstanceCount = "manualInstanceCount"; - } - return object; - }; - - /** - * Converts this WorkerPoolScaling to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @instance - * @returns {Object.} JSON object - */ - WorkerPoolScaling.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkerPoolScaling - * @function getTypeUrl - * @memberof google.cloud.run.v2.WorkerPoolScaling - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkerPoolScaling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.WorkerPoolScaling"; - }; - - return WorkerPoolScaling; - })(); - - v2.NodeSelector = (function() { - - /** - * Properties of a NodeSelector. - * @memberof google.cloud.run.v2 - * @interface INodeSelector - * @property {string|null} [accelerator] NodeSelector accelerator - */ - - /** - * Constructs a new NodeSelector. - * @memberof google.cloud.run.v2 - * @classdesc Represents a NodeSelector. - * @implements INodeSelector - * @constructor - * @param {google.cloud.run.v2.INodeSelector=} [properties] Properties to set - */ - function NodeSelector(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSelector accelerator. - * @member {string} accelerator - * @memberof google.cloud.run.v2.NodeSelector - * @instance - */ - NodeSelector.prototype.accelerator = ""; - - /** - * Creates a new NodeSelector instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {google.cloud.run.v2.INodeSelector=} [properties] Properties to set - * @returns {google.cloud.run.v2.NodeSelector} NodeSelector instance - */ - NodeSelector.create = function create(properties) { - return new NodeSelector(properties); - }; - - /** - * Encodes the specified NodeSelector message. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {google.cloud.run.v2.INodeSelector} message NodeSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.accelerator != null && Object.hasOwnProperty.call(message, "accelerator")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.accelerator); - return writer; - }; - - /** - * Encodes the specified NodeSelector message, length delimited. Does not implicitly {@link google.cloud.run.v2.NodeSelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {google.cloud.run.v2.INodeSelector} message NodeSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.NodeSelector} NodeSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSelector.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.NodeSelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.accelerator = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.NodeSelector} NodeSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSelector message. - * @function verify - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.accelerator != null && message.hasOwnProperty("accelerator")) - if (!$util.isString(message.accelerator)) - return "accelerator: string expected"; - return null; - }; - - /** - * Creates a NodeSelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.NodeSelector} NodeSelector - */ - NodeSelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.NodeSelector) - return object; - var message = new $root.google.cloud.run.v2.NodeSelector(); - if (object.accelerator != null) - message.accelerator = String(object.accelerator); - return message; - }; - - /** - * Creates a plain object from a NodeSelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {google.cloud.run.v2.NodeSelector} message NodeSelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.accelerator = ""; - if (message.accelerator != null && message.hasOwnProperty("accelerator")) - object.accelerator = message.accelerator; - return object; - }; - - /** - * Converts this NodeSelector to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.NodeSelector - * @instance - * @returns {Object.} JSON object - */ - NodeSelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSelector - * @function getTypeUrl - * @memberof google.cloud.run.v2.NodeSelector - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.NodeSelector"; - }; - - return NodeSelector; - })(); - - v2.BuildConfig = (function() { - - /** - * Properties of a BuildConfig. - * @memberof google.cloud.run.v2 - * @interface IBuildConfig - * @property {string|null} [name] BuildConfig name - * @property {string|null} [sourceLocation] BuildConfig sourceLocation - * @property {string|null} [functionTarget] BuildConfig functionTarget - * @property {string|null} [imageUri] BuildConfig imageUri - * @property {string|null} [baseImage] BuildConfig baseImage - * @property {boolean|null} [enableAutomaticUpdates] BuildConfig enableAutomaticUpdates - * @property {string|null} [workerPool] BuildConfig workerPool - * @property {Object.|null} [environmentVariables] BuildConfig environmentVariables - * @property {string|null} [serviceAccount] BuildConfig serviceAccount - */ - - /** - * Constructs a new BuildConfig. - * @memberof google.cloud.run.v2 - * @classdesc Represents a BuildConfig. - * @implements IBuildConfig - * @constructor - * @param {google.cloud.run.v2.IBuildConfig=} [properties] Properties to set - */ - function BuildConfig(properties) { - this.environmentVariables = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BuildConfig name. - * @member {string} name - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.name = ""; - - /** - * BuildConfig sourceLocation. - * @member {string} sourceLocation - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.sourceLocation = ""; - - /** - * BuildConfig functionTarget. - * @member {string} functionTarget - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.functionTarget = ""; - - /** - * BuildConfig imageUri. - * @member {string} imageUri - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.imageUri = ""; - - /** - * BuildConfig baseImage. - * @member {string} baseImage - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.baseImage = ""; - - /** - * BuildConfig enableAutomaticUpdates. - * @member {boolean} enableAutomaticUpdates - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.enableAutomaticUpdates = false; - - /** - * BuildConfig workerPool. - * @member {string} workerPool - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.workerPool = ""; - - /** - * BuildConfig environmentVariables. - * @member {Object.} environmentVariables - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.environmentVariables = $util.emptyObject; - - /** - * BuildConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.BuildConfig - * @instance - */ - BuildConfig.prototype.serviceAccount = ""; - - /** - * Creates a new BuildConfig instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {google.cloud.run.v2.IBuildConfig=} [properties] Properties to set - * @returns {google.cloud.run.v2.BuildConfig} BuildConfig instance - */ - BuildConfig.create = function create(properties) { - return new BuildConfig(properties); - }; - - /** - * Encodes the specified BuildConfig message. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {google.cloud.run.v2.IBuildConfig} message BuildConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.sourceLocation != null && Object.hasOwnProperty.call(message, "sourceLocation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLocation); - if (message.functionTarget != null && Object.hasOwnProperty.call(message, "functionTarget")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.functionTarget); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.imageUri); - if (message.baseImage != null && Object.hasOwnProperty.call(message, "baseImage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.baseImage); - if (message.enableAutomaticUpdates != null && Object.hasOwnProperty.call(message, "enableAutomaticUpdates")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableAutomaticUpdates); - if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.workerPool); - if (message.environmentVariables != null && Object.hasOwnProperty.call(message, "environmentVariables")) - for (var keys = Object.keys(message.environmentVariables), 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.environmentVariables[keys[i]]).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccount); - return writer; - }; - - /** - * Encodes the specified BuildConfig message, length delimited. Does not implicitly {@link google.cloud.run.v2.BuildConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {google.cloud.run.v2.IBuildConfig} message BuildConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BuildConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BuildConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.BuildConfig} BuildConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.BuildConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.sourceLocation = reader.string(); - break; - } - case 3: { - message.functionTarget = reader.string(); - break; - } - case 4: { - message.imageUri = reader.string(); - break; - } - case 5: { - message.baseImage = reader.string(); - break; - } - case 6: { - message.enableAutomaticUpdates = reader.bool(); - break; - } - case 7: { - message.workerPool = reader.string(); - break; - } - case 8: { - if (message.environmentVariables === $util.emptyObject) - message.environmentVariables = {}; - 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.environmentVariables[key] = value; - break; - } - case 9: { - message.serviceAccount = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BuildConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.BuildConfig} BuildConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BuildConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BuildConfig message. - * @function verify - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BuildConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) - if (!$util.isString(message.sourceLocation)) - return "sourceLocation: string expected"; - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - if (!$util.isString(message.functionTarget)) - return "functionTarget: string expected"; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.baseImage != null && message.hasOwnProperty("baseImage")) - if (!$util.isString(message.baseImage)) - return "baseImage: string expected"; - if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) - if (typeof message.enableAutomaticUpdates !== "boolean") - return "enableAutomaticUpdates: boolean expected"; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - if (!$util.isString(message.workerPool)) - return "workerPool: string expected"; - if (message.environmentVariables != null && message.hasOwnProperty("environmentVariables")) { - if (!$util.isObject(message.environmentVariables)) - return "environmentVariables: object expected"; - var key = Object.keys(message.environmentVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.environmentVariables[key[i]])) - return "environmentVariables: string{k:string} expected"; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - return null; - }; - - /** - * Creates a BuildConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.BuildConfig} BuildConfig - */ - BuildConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.BuildConfig) - return object; - var message = new $root.google.cloud.run.v2.BuildConfig(); - if (object.name != null) - message.name = String(object.name); - if (object.sourceLocation != null) - message.sourceLocation = String(object.sourceLocation); - if (object.functionTarget != null) - message.functionTarget = String(object.functionTarget); - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.baseImage != null) - message.baseImage = String(object.baseImage); - if (object.enableAutomaticUpdates != null) - message.enableAutomaticUpdates = Boolean(object.enableAutomaticUpdates); - if (object.workerPool != null) - message.workerPool = String(object.workerPool); - if (object.environmentVariables) { - if (typeof object.environmentVariables !== "object") - throw TypeError(".google.cloud.run.v2.BuildConfig.environmentVariables: object expected"); - message.environmentVariables = {}; - for (var keys = Object.keys(object.environmentVariables), i = 0; i < keys.length; ++i) - message.environmentVariables[keys[i]] = String(object.environmentVariables[keys[i]]); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - return message; - }; - - /** - * Creates a plain object from a BuildConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {google.cloud.run.v2.BuildConfig} message BuildConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BuildConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.environmentVariables = {}; - if (options.defaults) { - object.name = ""; - object.sourceLocation = ""; - object.functionTarget = ""; - object.imageUri = ""; - object.baseImage = ""; - object.enableAutomaticUpdates = false; - object.workerPool = ""; - object.serviceAccount = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.sourceLocation != null && message.hasOwnProperty("sourceLocation")) - object.sourceLocation = message.sourceLocation; - if (message.functionTarget != null && message.hasOwnProperty("functionTarget")) - object.functionTarget = message.functionTarget; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.baseImage != null && message.hasOwnProperty("baseImage")) - object.baseImage = message.baseImage; - if (message.enableAutomaticUpdates != null && message.hasOwnProperty("enableAutomaticUpdates")) - object.enableAutomaticUpdates = message.enableAutomaticUpdates; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - object.workerPool = message.workerPool; - var keys2; - if (message.environmentVariables && (keys2 = Object.keys(message.environmentVariables)).length) { - object.environmentVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.environmentVariables[keys2[j]] = message.environmentVariables[keys2[j]]; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - return object; - }; - - /** - * Converts this BuildConfig to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.BuildConfig - * @instance - * @returns {Object.} JSON object - */ - BuildConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BuildConfig - * @function getTypeUrl - * @memberof google.cloud.run.v2.BuildConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BuildConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.BuildConfig"; - }; - - return BuildConfig; - })(); - - /** - * IngressTraffic enum. - * @name google.cloud.run.v2.IngressTraffic - * @enum {number} - * @property {number} INGRESS_TRAFFIC_UNSPECIFIED=0 INGRESS_TRAFFIC_UNSPECIFIED value - * @property {number} INGRESS_TRAFFIC_ALL=1 INGRESS_TRAFFIC_ALL value - * @property {number} INGRESS_TRAFFIC_INTERNAL_ONLY=2 INGRESS_TRAFFIC_INTERNAL_ONLY value - * @property {number} INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER=3 INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER value - * @property {number} INGRESS_TRAFFIC_NONE=4 INGRESS_TRAFFIC_NONE value - */ - v2.IngressTraffic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INGRESS_TRAFFIC_UNSPECIFIED"] = 0; - values[valuesById[1] = "INGRESS_TRAFFIC_ALL"] = 1; - values[valuesById[2] = "INGRESS_TRAFFIC_INTERNAL_ONLY"] = 2; - values[valuesById[3] = "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"] = 3; - values[valuesById[4] = "INGRESS_TRAFFIC_NONE"] = 4; - return values; - })(); - - /** - * ExecutionEnvironment enum. - * @name google.cloud.run.v2.ExecutionEnvironment - * @enum {number} - * @property {number} EXECUTION_ENVIRONMENT_UNSPECIFIED=0 EXECUTION_ENVIRONMENT_UNSPECIFIED value - * @property {number} EXECUTION_ENVIRONMENT_GEN1=1 EXECUTION_ENVIRONMENT_GEN1 value - * @property {number} EXECUTION_ENVIRONMENT_GEN2=2 EXECUTION_ENVIRONMENT_GEN2 value - */ - v2.ExecutionEnvironment = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EXECUTION_ENVIRONMENT_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXECUTION_ENVIRONMENT_GEN1"] = 1; - values[valuesById[2] = "EXECUTION_ENVIRONMENT_GEN2"] = 2; - return values; - })(); - - /** - * EncryptionKeyRevocationAction enum. - * @name google.cloud.run.v2.EncryptionKeyRevocationAction - * @enum {number} - * @property {number} ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED=0 ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED value - * @property {number} PREVENT_NEW=1 PREVENT_NEW value - * @property {number} SHUTDOWN=2 SHUTDOWN value - */ - v2.EncryptionKeyRevocationAction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "PREVENT_NEW"] = 1; - values[valuesById[2] = "SHUTDOWN"] = 2; - return values; - })(); - - v2.ExecutionTemplate = (function() { - - /** - * Properties of an ExecutionTemplate. - * @memberof google.cloud.run.v2 - * @interface IExecutionTemplate - * @property {Object.|null} [labels] ExecutionTemplate labels - * @property {Object.|null} [annotations] ExecutionTemplate annotations - * @property {number|null} [parallelism] ExecutionTemplate parallelism - * @property {number|null} [taskCount] ExecutionTemplate taskCount - * @property {google.cloud.run.v2.ITaskTemplate|null} [template] ExecutionTemplate template - */ - - /** - * Constructs a new ExecutionTemplate. - * @memberof google.cloud.run.v2 - * @classdesc Represents an ExecutionTemplate. - * @implements IExecutionTemplate - * @constructor - * @param {google.cloud.run.v2.IExecutionTemplate=} [properties] Properties to set - */ - function ExecutionTemplate(properties) { - this.labels = {}; - this.annotations = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecutionTemplate labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - */ - ExecutionTemplate.prototype.labels = $util.emptyObject; - - /** - * ExecutionTemplate annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - */ - ExecutionTemplate.prototype.annotations = $util.emptyObject; - - /** - * ExecutionTemplate parallelism. - * @member {number} parallelism - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - */ - ExecutionTemplate.prototype.parallelism = 0; - - /** - * ExecutionTemplate taskCount. - * @member {number} taskCount - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - */ - ExecutionTemplate.prototype.taskCount = 0; - - /** - * ExecutionTemplate template. - * @member {google.cloud.run.v2.ITaskTemplate|null|undefined} template - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - */ - ExecutionTemplate.prototype.template = null; - - /** - * Creates a new ExecutionTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {google.cloud.run.v2.IExecutionTemplate=} [properties] Properties to set - * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate instance - */ - ExecutionTemplate.create = function create(properties) { - return new ExecutionTemplate(properties); - }; - - /** - * Encodes the specified ExecutionTemplate message. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {google.cloud.run.v2.IExecutionTemplate} message ExecutionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.parallelism); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.taskCount); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.run.v2.TaskTemplate.encode(message.template, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecutionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {google.cloud.run.v2.IExecutionTemplate} message ExecutionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecutionTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ExecutionTemplate(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - 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 2: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 3: { - message.parallelism = reader.int32(); - break; - } - case 4: { - message.taskCount = reader.int32(); - break; - } - case 5: { - message.template = $root.google.cloud.run.v2.TaskTemplate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecutionTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecutionTemplate message. - * @function verify - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecutionTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (!$util.isInteger(message.parallelism)) - return "parallelism: integer expected"; - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount)) - return "taskCount: integer expected"; - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.run.v2.TaskTemplate.verify(message.template); - if (error) - return "template." + error; - } - return null; - }; - - /** - * Creates an ExecutionTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ExecutionTemplate} ExecutionTemplate - */ - ExecutionTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ExecutionTemplate) - return object; - var message = new $root.google.cloud.run.v2.ExecutionTemplate(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionTemplate.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionTemplate.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.parallelism != null) - message.parallelism = object.parallelism | 0; - if (object.taskCount != null) - message.taskCount = object.taskCount | 0; - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionTemplate.template: object expected"); - message.template = $root.google.cloud.run.v2.TaskTemplate.fromObject(object.template); - } - return message; - }; - - /** - * Creates a plain object from an ExecutionTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {google.cloud.run.v2.ExecutionTemplate} message ExecutionTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecutionTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.parallelism = 0; - object.taskCount = 0; - object.template = null; - } - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - object.parallelism = message.parallelism; - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - object.taskCount = message.taskCount; - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.run.v2.TaskTemplate.toObject(message.template, options); - return object; - }; - - /** - * Converts this ExecutionTemplate to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ExecutionTemplate - * @instance - * @returns {Object.} JSON object - */ - ExecutionTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecutionTemplate - * @function getTypeUrl - * @memberof google.cloud.run.v2.ExecutionTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecutionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ExecutionTemplate"; - }; - - return ExecutionTemplate; - })(); - - v2.Instances = (function() { - - /** - * Constructs a new Instances service. - * @memberof google.cloud.run.v2 - * @classdesc Represents an Instances - * @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 Instances(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Instances.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Instances; - - /** - * Creates new Instances service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Instances - * @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 {Instances} RPC service. Useful where requests and/or responses are streamed. - */ - Instances.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|createInstance}. - * @memberof google.cloud.run.v2.Instances - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.cloud.run.v2.Instances.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.cloud.run.v2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); - - /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|deleteInstance}. - * @memberof google.cloud.run.v2.Instances - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.cloud.run.v2.Instances.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.cloud.run.v2.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteInstance" }); - - /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|getInstance}. - * @memberof google.cloud.run.v2.Instances - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Instance} [response] Instance - */ - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.cloud.run.v2.Instances.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.cloud.run.v2.GetInstanceRequest, $root.google.cloud.run.v2.Instance, request, callback); - }, "name", { value: "GetInstance" }); - - /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|listInstances}. - * @memberof google.cloud.run.v2.Instances - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListInstancesResponse} [response] ListInstancesResponse - */ - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.cloud.run.v2.Instances.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.cloud.run.v2.ListInstancesRequest, $root.google.cloud.run.v2.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); - - /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|stopInstance}. - * @memberof google.cloud.run.v2.Instances - * @typedef StopInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls StopInstance. - * @function stopInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IStopInstanceRequest} request StopInstanceRequest message or plain object - * @param {google.cloud.run.v2.Instances.StopInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.stopInstance = function stopInstance(request, callback) { - return this.rpcCall(stopInstance, $root.google.cloud.run.v2.StopInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "StopInstance" }); - - /** - * Calls StopInstance. - * @function stopInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IStopInstanceRequest} request StopInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Instances|startInstance}. - * @memberof google.cloud.run.v2.Instances - * @typedef StartInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls StartInstance. - * @function startInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IStartInstanceRequest} request StartInstanceRequest message or plain object - * @param {google.cloud.run.v2.Instances.StartInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Instances.prototype.startInstance = function startInstance(request, callback) { - return this.rpcCall(startInstance, $root.google.cloud.run.v2.StartInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "StartInstance" }); - - /** - * Calls StartInstance. - * @function startInstance - * @memberof google.cloud.run.v2.Instances - * @instance - * @param {google.cloud.run.v2.IStartInstanceRequest} request StartInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Instances; - })(); - - v2.CreateInstanceRequest = (function() { - - /** - * Properties of a CreateInstanceRequest. - * @memberof google.cloud.run.v2 - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {google.cloud.run.v2.IInstance|null} [instance] CreateInstanceRequest instance - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly - */ - - /** - * Constructs a new CreateInstanceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest - * @constructor - * @param {google.cloud.run.v2.ICreateInstanceRequest=} [properties] Properties to set - */ - function CreateInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.parent = ""; - - /** - * CreateInstanceRequest instance. - * @member {google.cloud.run.v2.IInstance|null|undefined} instance - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instance = null; - - /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.instanceId = ""; - - /** - * CreateInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @instance - */ - CreateInstanceRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {google.cloud.run.v2.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest instance - */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); - }; - - /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {google.cloud.run.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.run.v2.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {google.cloud.run.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.instance = $root.google.cloud.run.v2.Instance.decode(reader, reader.uint32()); - break; - } - case 3: { - message.instanceId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateInstanceRequest message. - * @function verify - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.run.v2.Instance.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest - */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CreateInstanceRequest) - return object; - var message = new $root.google.cloud.run.v2.CreateInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.run.v2.CreateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.run.v2.Instance.fromObject(object.instance); - } - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {google.cloud.run.v2.CreateInstanceRequest} message CreateInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.instance = null; - object.instanceId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.run.v2.Instance.toObject(message.instance, options); - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.CreateInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.CreateInstanceRequest"; - }; - - return CreateInstanceRequest; - })(); - - v2.GetInstanceRequest = (function() { - - /** - * Properties of a GetInstanceRequest. - * @memberof google.cloud.run.v2 - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - */ - - /** - * Constructs a new GetInstanceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest - * @constructor - * @param {google.cloud.run.v2.IGetInstanceRequest=} [properties] Properties to set - */ - function GetInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.GetInstanceRequest - * @instance - */ - GetInstanceRequest.prototype.name = ""; - - /** - * Creates a new GetInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {google.cloud.run.v2.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest instance - */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); - }; - - /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {google.cloud.run.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {google.cloud.run.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetInstanceRequest message. - * @function verify - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest - */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetInstanceRequest) - return object; - var message = new $root.google.cloud.run.v2.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {google.cloud.run.v2.GetInstanceRequest} message GetInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GetInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.GetInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GetInstanceRequest"; - }; - - return GetInstanceRequest; - })(); - - v2.DeleteInstanceRequest = (function() { - - /** - * Properties of a DeleteInstanceRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name - * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly - * @property {string|null} [etag] DeleteInstanceRequest etag - */ - - /** - * Constructs a new DeleteInstanceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest - * @constructor - * @param {google.cloud.run.v2.IDeleteInstanceRequest=} [properties] Properties to set - */ - function DeleteInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteInstanceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.name = ""; - - /** - * DeleteInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.validateOnly = false; - - /** - * DeleteInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @instance - */ - DeleteInstanceRequest.prototype.etag = ""; - - /** - * Creates a new DeleteInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {google.cloud.run.v2.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest instance - */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); - }; - - /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {google.cloud.run.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {google.cloud.run.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteInstanceRequest message. - * @function verify - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest - */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteInstanceRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {google.cloud.run.v2.DeleteInstanceRequest} message DeleteInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.DeleteInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.DeleteInstanceRequest"; - }; - - return DeleteInstanceRequest; - })(); - - v2.ListInstancesRequest = (function() { - - /** - * Properties of a ListInstancesRequest. - * @memberof google.cloud.run.v2 - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {boolean|null} [showDeleted] ListInstancesRequest showDeleted - */ - - /** - * Constructs a new ListInstancesRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest - * @constructor - * @param {google.cloud.run.v2.IListInstancesRequest=} [properties] Properties to set - */ - function ListInstancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.parent = ""; - - /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageSize = 0; - - /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.pageToken = ""; - - /** - * ListInstancesRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.showDeleted = false; - - /** - * Creates a new ListInstancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {google.cloud.run.v2.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest instance - */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); - }; - - /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {google.cloud.run.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {google.cloud.run.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListInstancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesRequest message. - * @function verify - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest - */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListInstancesRequest) - return object; - var message = new $root.google.cloud.run.v2.ListInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {google.cloud.run.v2.ListInstancesRequest} message ListInstancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListInstancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListInstancesRequest - * @instance - * @returns {Object.} JSON object - */ - ListInstancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListInstancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListInstancesRequest"; - }; - - return ListInstancesRequest; - })(); - - v2.ListInstancesResponse = (function() { - - /** - * Properties of a ListInstancesResponse. - * @memberof google.cloud.run.v2 - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - */ - - /** - * Constructs a new ListInstancesResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse - * @constructor - * @param {google.cloud.run.v2.IListInstancesResponse=} [properties] Properties to set - */ - function ListInstancesResponse(properties) { - 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]]; - } - - /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.run.v2.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.instances = $util.emptyArray; - - /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListInstancesResponse - * @instance - */ - ListInstancesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListInstancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {google.cloud.run.v2.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse instance - */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); - }; - - /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {google.cloud.run.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.run.v2.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {google.cloud.run.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListInstancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.run.v2.Instance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListInstancesResponse message. - * @function verify - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListInstancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.run.v2.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse - */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListInstancesResponse) - return object; - var message = new $root.google.cloud.run.v2.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.run.v2.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.run.v2.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.run.v2.Instance.fromObject(object.instances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {google.cloud.run.v2.ListInstancesResponse} message ListInstancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListInstancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.run.v2.Instance.toObject(message.instances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListInstancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListInstancesResponse - * @instance - * @returns {Object.} JSON object - */ - ListInstancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListInstancesResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListInstancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListInstancesResponse"; - }; - - return ListInstancesResponse; - })(); - - v2.StopInstanceRequest = (function() { - - /** - * Properties of a StopInstanceRequest. - * @memberof google.cloud.run.v2 - * @interface IStopInstanceRequest - * @property {string|null} [name] StopInstanceRequest name - * @property {boolean|null} [validateOnly] StopInstanceRequest validateOnly - * @property {string|null} [etag] StopInstanceRequest etag - */ - - /** - * Constructs a new StopInstanceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a StopInstanceRequest. - * @implements IStopInstanceRequest - * @constructor - * @param {google.cloud.run.v2.IStopInstanceRequest=} [properties] Properties to set - */ - function StopInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StopInstanceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.StopInstanceRequest - * @instance - */ - StopInstanceRequest.prototype.name = ""; - - /** - * StopInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.StopInstanceRequest - * @instance - */ - StopInstanceRequest.prototype.validateOnly = false; - - /** - * StopInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.StopInstanceRequest - * @instance - */ - StopInstanceRequest.prototype.etag = ""; - - /** - * Creates a new StopInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {google.cloud.run.v2.IStopInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest instance - */ - StopInstanceRequest.create = function create(properties) { - return new StopInstanceRequest(properties); - }; - - /** - * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {google.cloud.run.v2.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StopInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {google.cloud.run.v2.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StopInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StopInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StopInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StopInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StopInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StopInstanceRequest message. - * @function verify - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StopInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest - */ - StopInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.StopInstanceRequest) - return object; - var message = new $root.google.cloud.run.v2.StopInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {google.cloud.run.v2.StopInstanceRequest} message StopInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StopInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this StopInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.StopInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - StopInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StopInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.StopInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StopInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.StopInstanceRequest"; - }; - - return StopInstanceRequest; - })(); - - v2.StartInstanceRequest = (function() { - - /** - * Properties of a StartInstanceRequest. - * @memberof google.cloud.run.v2 - * @interface IStartInstanceRequest - * @property {string|null} [name] StartInstanceRequest name - * @property {boolean|null} [validateOnly] StartInstanceRequest validateOnly - * @property {string|null} [etag] StartInstanceRequest etag - */ - - /** - * Constructs a new StartInstanceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a StartInstanceRequest. - * @implements IStartInstanceRequest - * @constructor - * @param {google.cloud.run.v2.IStartInstanceRequest=} [properties] Properties to set - */ - function StartInstanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartInstanceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.StartInstanceRequest - * @instance - */ - StartInstanceRequest.prototype.name = ""; - - /** - * StartInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.StartInstanceRequest - * @instance - */ - StartInstanceRequest.prototype.validateOnly = false; - - /** - * StartInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.StartInstanceRequest - * @instance - */ - StartInstanceRequest.prototype.etag = ""; - - /** - * Creates a new StartInstanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {google.cloud.run.v2.IStartInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest instance - */ - StartInstanceRequest.create = function create(properties) { - return new StartInstanceRequest(properties); - }; - - /** - * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {google.cloud.run.v2.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartInstanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {google.cloud.run.v2.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartInstanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartInstanceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StartInstanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartInstanceRequest message. - * @function verify - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartInstanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest - */ - StartInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.StartInstanceRequest) - return object; - var message = new $root.google.cloud.run.v2.StartInstanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {google.cloud.run.v2.StartInstanceRequest} message StartInstanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartInstanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this StartInstanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.StartInstanceRequest - * @instance - * @returns {Object.} JSON object - */ - StartInstanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StartInstanceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.StartInstanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.StartInstanceRequest"; - }; - - return StartInstanceRequest; - })(); - - v2.Instance = (function() { - - /** - * Properties of an Instance. - * @memberof google.cloud.run.v2 - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [description] Instance description - * @property {string|null} [uid] Instance uid - * @property {number|Long|null} [generation] Instance generation - * @property {Object.|null} [labels] Instance labels - * @property {Object.|null} [annotations] Instance annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Instance expireTime - * @property {string|null} [creator] Instance creator - * @property {string|null} [lastModifier] Instance lastModifier - * @property {string|null} [client] Instance client - * @property {string|null} [clientVersion] Instance clientVersion - * @property {google.api.LaunchStage|null} [launchStage] Instance launchStage - * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Instance binaryAuthorization - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Instance vpcAccess - * @property {string|null} [serviceAccount] Instance serviceAccount - * @property {Array.|null} [containers] Instance containers - * @property {Array.|null} [volumes] Instance volumes - * @property {string|null} [encryptionKey] Instance encryptionKey - * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] Instance encryptionKeyRevocationAction - * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] Instance encryptionKeyShutdownDuration - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Instance nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] Instance gpuZonalRedundancyDisabled - * @property {google.cloud.run.v2.IngressTraffic|null} [ingress] Instance ingress - * @property {boolean|null} [invokerIamDisabled] Instance invokerIamDisabled - * @property {boolean|null} [iapEnabled] Instance iapEnabled - * @property {number|Long|null} [observedGeneration] Instance observedGeneration - * @property {string|null} [logUri] Instance logUri - * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Instance terminalCondition - * @property {Array.|null} [conditions] Instance conditions - * @property {Array.|null} [containerStatuses] Instance containerStatuses - * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs - * @property {Array.|null} [urls] Instance urls - * @property {boolean|null} [reconciling] Instance reconciling - * @property {string|null} [etag] Instance etag - */ - - /** - * Constructs a new Instance. - * @memberof google.cloud.run.v2 - * @classdesc Represents an Instance. - * @implements IInstance - * @constructor - * @param {google.cloud.run.v2.IInstance=} [properties] Properties to set - */ - function Instance(properties) { - this.labels = {}; - this.annotations = {}; - this.containers = []; - this.volumes = []; - this.conditions = []; - this.containerStatuses = []; - this.urls = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Instance name. - * @member {string} name - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.name = ""; - - /** - * Instance description. - * @member {string} description - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.description = ""; - - /** - * Instance uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.uid = ""; - - /** - * Instance generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Instance labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.labels = $util.emptyObject; - - /** - * Instance annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.annotations = $util.emptyObject; - - /** - * Instance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.createTime = null; - - /** - * Instance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.updateTime = null; - - /** - * Instance deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.deleteTime = null; - - /** - * Instance expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.expireTime = null; - - /** - * Instance creator. - * @member {string} creator - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.creator = ""; - - /** - * Instance lastModifier. - * @member {string} lastModifier - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.lastModifier = ""; - - /** - * Instance client. - * @member {string} client - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.client = ""; - - /** - * Instance clientVersion. - * @member {string} clientVersion - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.clientVersion = ""; - - /** - * Instance launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.launchStage = 0; - - /** - * Instance binaryAuthorization. - * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.binaryAuthorization = null; - - /** - * Instance vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.vpcAccess = null; - - /** - * Instance serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.serviceAccount = ""; - - /** - * Instance containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.containers = $util.emptyArray; - - /** - * Instance volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.volumes = $util.emptyArray; - - /** - * Instance encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.encryptionKey = ""; - - /** - * Instance encryptionKeyRevocationAction. - * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.encryptionKeyRevocationAction = 0; - - /** - * Instance encryptionKeyShutdownDuration. - * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.encryptionKeyShutdownDuration = null; - - /** - * Instance nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.nodeSelector = null; - - /** - * Instance gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.gpuZonalRedundancyDisabled = null; - - /** - * Instance ingress. - * @member {google.cloud.run.v2.IngressTraffic} ingress - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.ingress = 0; - - /** - * Instance invokerIamDisabled. - * @member {boolean} invokerIamDisabled - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.invokerIamDisabled = false; - - /** - * Instance iapEnabled. - * @member {boolean} iapEnabled - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.iapEnabled = false; - - /** - * Instance observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Instance logUri. - * @member {string} logUri - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.logUri = ""; - - /** - * Instance terminalCondition. - * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.terminalCondition = null; - - /** - * Instance conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.conditions = $util.emptyArray; - - /** - * Instance containerStatuses. - * @member {Array.} containerStatuses - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.containerStatuses = $util.emptyArray; - - /** - * Instance satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.satisfiesPzs = false; - - /** - * Instance urls. - * @member {Array.} urls - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.urls = $util.emptyArray; - - /** - * Instance reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.reconciling = false; - - /** - * Instance etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Instance - * @instance - */ - Instance.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Instance.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Instance instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Instance - * @static - * @param {google.cloud.run.v2.IInstance=} [properties] Properties to set - * @returns {google.cloud.run.v2.Instance} Instance instance - */ - Instance.create = function create(properties) { - return new Instance(properties); - }; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Instance - * @static - * @param {google.cloud.run.v2.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.uid); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.generation); - 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.creator); - if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.lastModifier); - if (message.client != null && Object.hasOwnProperty.call(message, "client")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.client); - if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.clientVersion); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); - if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) - $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 19, wireType 2 =*/154).string(message.serviceAccount); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 22, wireType 2 =*/178).string(message.encryptionKey); - if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.encryptionKeyRevocationAction); - if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) - $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.gpuZonalRedundancyDisabled); - if (message.ingress != null && Object.hasOwnProperty.call(message, "ingress")) - writer.uint32(/* id 28, wireType 0 =*/224).int32(message.ingress); - if (message.invokerIamDisabled != null && Object.hasOwnProperty.call(message, "invokerIamDisabled")) - writer.uint32(/* id 29, wireType 0 =*/232).bool(message.invokerIamDisabled); - if (message.iapEnabled != null && Object.hasOwnProperty.call(message, "iapEnabled")) - writer.uint32(/* id 30, wireType 0 =*/240).bool(message.iapEnabled); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 40, wireType 0 =*/320).int64(message.observedGeneration); - if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.logUri); - if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) - $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); - if (message.containerStatuses != null && message.containerStatuses.length) - for (var i = 0; i < message.containerStatuses.length; ++i) - $root.google.cloud.run.v2.ContainerStatus.encode(message.containerStatuses[i], writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); - if (message.urls != null && message.urls.length) - for (var i = 0; i < message.urls.length; ++i) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.urls[i]); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 46, wireType 0 =*/368).bool(message.satisfiesPzs); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Instance - * @static - * @param {google.cloud.run.v2.IInstance} message Instance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Instance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Instance(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.uid = reader.string(); - break; - } - case 5: { - message.generation = reader.int64(); - 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: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 8: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.creator = reader.string(); - break; - } - case 13: { - message.lastModifier = reader.string(); - break; - } - case 14: { - message.client = reader.string(); - break; - } - case 15: { - message.clientVersion = reader.string(); - break; - } - case 16: { - message.launchStage = reader.int32(); - break; - } - case 17: { - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); - break; - } - case 18: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 19: { - message.serviceAccount = reader.string(); - break; - } - case 20: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 21: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 22: { - message.encryptionKey = reader.string(); - break; - } - case 24: { - message.encryptionKeyRevocationAction = reader.int32(); - break; - } - case 25: { - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 26: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 27: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - case 28: { - message.ingress = reader.int32(); - break; - } - case 29: { - message.invokerIamDisabled = reader.bool(); - break; - } - case 30: { - message.iapEnabled = reader.bool(); - break; - } - case 40: { - message.observedGeneration = reader.int64(); - break; - } - case 41: { - message.logUri = reader.string(); - break; - } - case 42: { - message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); - break; - } - case 43: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 44: { - if (!(message.containerStatuses && message.containerStatuses.length)) - message.containerStatuses = []; - message.containerStatuses.push($root.google.cloud.run.v2.ContainerStatus.decode(reader, reader.uint32())); - break; - } - case 46: { - message.satisfiesPzs = reader.bool(); - break; - } - case 45: { - if (!(message.urls && message.urls.length)) - message.urls = []; - message.urls.push(reader.string()); - break; - } - case 98: { - message.reconciling = reader.bool(); - break; - } - case 99: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Instance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Instance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Instance} Instance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Instance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Instance message. - * @function verify - * @memberof google.cloud.run.v2.Instance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Instance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - if (!$util.isString(message.lastModifier)) - return "lastModifier: string expected"; - if (message.client != null && message.hasOwnProperty("client")) - if (!$util.isString(message.client)) - return "client: string expected"; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - if (!$util.isString(message.clientVersion)) - return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { - var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); - if (error) - return "binaryAuthorization." + error; - } - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - switch (message.encryptionKeyRevocationAction) { - default: - return "encryptionKeyRevocationAction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { - var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); - if (error) - return "encryptionKeyShutdownDuration." + error; - } - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - if (message.ingress != null && message.hasOwnProperty("ingress")) - switch (message.ingress) { - default: - return "ingress: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) - if (typeof message.invokerIamDisabled !== "boolean") - return "invokerIamDisabled: boolean expected"; - if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) - if (typeof message.iapEnabled !== "boolean") - return "iapEnabled: boolean expected"; - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.logUri != null && message.hasOwnProperty("logUri")) - if (!$util.isString(message.logUri)) - return "logUri: string expected"; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { - var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); - if (error) - return "terminalCondition." + error; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.containerStatuses != null && message.hasOwnProperty("containerStatuses")) { - if (!Array.isArray(message.containerStatuses)) - return "containerStatuses: array expected"; - for (var i = 0; i < message.containerStatuses.length; ++i) { - var error = $root.google.cloud.run.v2.ContainerStatus.verify(message.containerStatuses[i]); - if (error) - return "containerStatuses." + error; - } - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.urls != null && message.hasOwnProperty("urls")) { - if (!Array.isArray(message.urls)) - return "urls: array expected"; - for (var i = 0; i < message.urls.length; ++i) - if (!$util.isString(message.urls[i])) - return "urls: string[] expected"; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Instance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Instance} Instance - */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Instance) - return object; - var message = new $root.google.cloud.run.v2.Instance(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.Instance.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Instance.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.Instance.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.run.v2.Instance.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Instance.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Instance.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.lastModifier != null) - message.lastModifier = String(object.lastModifier); - if (object.client != null) - message.client = String(object.client); - if (object.clientVersion != null) - message.clientVersion = String(object.clientVersion); - 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.binaryAuthorization != null) { - if (typeof object.binaryAuthorization !== "object") - throw TypeError(".google.cloud.run.v2.Instance.binaryAuthorization: object expected"); - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); - } - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.Instance.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.Instance.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.Instance.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.Instance.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.Instance.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - switch (object.encryptionKeyRevocationAction) { - default: - if (typeof object.encryptionKeyRevocationAction === "number") { - message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; - break; - } - break; - case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": - case 0: - message.encryptionKeyRevocationAction = 0; - break; - case "PREVENT_NEW": - case 1: - message.encryptionKeyRevocationAction = 1; - break; - case "SHUTDOWN": - case 2: - message.encryptionKeyRevocationAction = 2; - break; - } - if (object.encryptionKeyShutdownDuration != null) { - if (typeof object.encryptionKeyShutdownDuration !== "object") - throw TypeError(".google.cloud.run.v2.Instance.encryptionKeyShutdownDuration: object expected"); - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); - } - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.Instance.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - switch (object.ingress) { - default: - if (typeof object.ingress === "number") { - message.ingress = object.ingress; - break; - } - break; - case "INGRESS_TRAFFIC_UNSPECIFIED": - case 0: - message.ingress = 0; - break; - case "INGRESS_TRAFFIC_ALL": - case 1: - message.ingress = 1; - break; - case "INGRESS_TRAFFIC_INTERNAL_ONLY": - case 2: - message.ingress = 2; - break; - case "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": - case 3: - message.ingress = 3; - break; - case "INGRESS_TRAFFIC_NONE": - case 4: - message.ingress = 4; - break; - } - if (object.invokerIamDisabled != null) - message.invokerIamDisabled = Boolean(object.invokerIamDisabled); - if (object.iapEnabled != null) - message.iapEnabled = Boolean(object.iapEnabled); - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.logUri != null) - message.logUri = String(object.logUri); - if (object.terminalCondition != null) { - if (typeof object.terminalCondition !== "object") - throw TypeError(".google.cloud.run.v2.Instance.terminalCondition: object expected"); - message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Instance.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Instance.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.containerStatuses) { - if (!Array.isArray(object.containerStatuses)) - throw TypeError(".google.cloud.run.v2.Instance.containerStatuses: array expected"); - message.containerStatuses = []; - for (var i = 0; i < object.containerStatuses.length; ++i) { - if (typeof object.containerStatuses[i] !== "object") - throw TypeError(".google.cloud.run.v2.Instance.containerStatuses: object expected"); - message.containerStatuses[i] = $root.google.cloud.run.v2.ContainerStatus.fromObject(object.containerStatuses[i]); - } - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.urls) { - if (!Array.isArray(object.urls)) - throw TypeError(".google.cloud.run.v2.Instance.urls: array expected"); - message.urls = []; - for (var i = 0; i < object.urls.length; ++i) - message.urls[i] = String(object.urls[i]); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Instance - * @static - * @param {google.cloud.run.v2.Instance} message Instance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Instance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - object.conditions = []; - object.containerStatuses = []; - object.urls = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.description = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.creator = ""; - object.lastModifier = ""; - object.client = ""; - object.clientVersion = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.binaryAuthorization = null; - object.vpcAccess = null; - object.serviceAccount = ""; - object.encryptionKey = ""; - object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; - object.encryptionKeyShutdownDuration = null; - object.nodeSelector = null; - object.ingress = options.enums === String ? "INGRESS_TRAFFIC_UNSPECIFIED" : 0; - object.invokerIamDisabled = false; - object.iapEnabled = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.logUri = ""; - object.terminalCondition = null; - object.satisfiesPzs = false; - object.reconciling = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - object.lastModifier = message.lastModifier; - if (message.client != null && message.hasOwnProperty("client")) - object.client = message.client; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - object.clientVersion = message.clientVersion; - 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) - object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) - object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - if (message.ingress != null && message.hasOwnProperty("ingress")) - object.ingress = options.enums === String ? $root.google.cloud.run.v2.IngressTraffic[message.ingress] === undefined ? message.ingress : $root.google.cloud.run.v2.IngressTraffic[message.ingress] : message.ingress; - if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) - object.invokerIamDisabled = message.invokerIamDisabled; - if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) - object.iapEnabled = message.iapEnabled; - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.logUri != null && message.hasOwnProperty("logUri")) - object.logUri = message.logUri; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) - object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.containerStatuses && message.containerStatuses.length) { - object.containerStatuses = []; - for (var j = 0; j < message.containerStatuses.length; ++j) - object.containerStatuses[j] = $root.google.cloud.run.v2.ContainerStatus.toObject(message.containerStatuses[j], options); - } - if (message.urls && message.urls.length) { - object.urls = []; - for (var j = 0; j < message.urls.length; ++j) - object.urls[j] = message.urls[j]; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Instance to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Instance - * @instance - * @returns {Object.} JSON object - */ - Instance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Instance - * @function getTypeUrl - * @memberof google.cloud.run.v2.Instance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Instance"; - }; - - return Instance; - })(); - - v2.InstanceSplit = (function() { - - /** - * Properties of an InstanceSplit. - * @memberof google.cloud.run.v2 - * @interface IInstanceSplit - * @property {google.cloud.run.v2.InstanceSplitAllocationType|null} [type] InstanceSplit type - * @property {string|null} [revision] InstanceSplit revision - * @property {number|null} [percent] InstanceSplit percent - */ - - /** - * Constructs a new InstanceSplit. - * @memberof google.cloud.run.v2 - * @classdesc Represents an InstanceSplit. - * @implements IInstanceSplit - * @constructor - * @param {google.cloud.run.v2.IInstanceSplit=} [properties] Properties to set - */ - function InstanceSplit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceSplit type. - * @member {google.cloud.run.v2.InstanceSplitAllocationType} type - * @memberof google.cloud.run.v2.InstanceSplit - * @instance - */ - InstanceSplit.prototype.type = 0; - - /** - * InstanceSplit revision. - * @member {string} revision - * @memberof google.cloud.run.v2.InstanceSplit - * @instance - */ - InstanceSplit.prototype.revision = ""; - - /** - * InstanceSplit percent. - * @member {number} percent - * @memberof google.cloud.run.v2.InstanceSplit - * @instance - */ - InstanceSplit.prototype.percent = 0; - - /** - * Creates a new InstanceSplit instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {google.cloud.run.v2.IInstanceSplit=} [properties] Properties to set - * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit instance - */ - InstanceSplit.create = function create(properties) { - return new InstanceSplit(properties); - }; - - /** - * Encodes the specified InstanceSplit message. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {google.cloud.run.v2.IInstanceSplit} message InstanceSplit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSplit.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.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); - if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); - return writer; - }; - - /** - * Encodes the specified InstanceSplit message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplit.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {google.cloud.run.v2.IInstanceSplit} message InstanceSplit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSplit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceSplit message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSplit.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.InstanceSplit(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.revision = reader.string(); - break; - } - case 3: { - message.percent = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceSplit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSplit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceSplit message. - * @function verify - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceSplit.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.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.percent != null && message.hasOwnProperty("percent")) - if (!$util.isInteger(message.percent)) - return "percent: integer expected"; - return null; - }; - - /** - * Creates an InstanceSplit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.InstanceSplit} InstanceSplit - */ - InstanceSplit.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.InstanceSplit) - return object; - var message = new $root.google.cloud.run.v2.InstanceSplit(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST": - case 1: - message.type = 1; - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION": - case 2: - message.type = 2; - break; - } - if (object.revision != null) - message.revision = String(object.revision); - if (object.percent != null) - message.percent = object.percent | 0; - return message; - }; - - /** - * Creates a plain object from an InstanceSplit message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {google.cloud.run.v2.InstanceSplit} message InstanceSplit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceSplit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED" : 0; - object.revision = ""; - object.percent = 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] : message.type; - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.percent != null && message.hasOwnProperty("percent")) - object.percent = message.percent; - return object; - }; - - /** - * Converts this InstanceSplit to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.InstanceSplit - * @instance - * @returns {Object.} JSON object - */ - InstanceSplit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceSplit - * @function getTypeUrl - * @memberof google.cloud.run.v2.InstanceSplit - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceSplit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.InstanceSplit"; - }; - - return InstanceSplit; - })(); - - v2.InstanceSplitStatus = (function() { - - /** - * Properties of an InstanceSplitStatus. - * @memberof google.cloud.run.v2 - * @interface IInstanceSplitStatus - * @property {google.cloud.run.v2.InstanceSplitAllocationType|null} [type] InstanceSplitStatus type - * @property {string|null} [revision] InstanceSplitStatus revision - * @property {number|null} [percent] InstanceSplitStatus percent - */ - - /** - * Constructs a new InstanceSplitStatus. - * @memberof google.cloud.run.v2 - * @classdesc Represents an InstanceSplitStatus. - * @implements IInstanceSplitStatus - * @constructor - * @param {google.cloud.run.v2.IInstanceSplitStatus=} [properties] Properties to set - */ - function InstanceSplitStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceSplitStatus type. - * @member {google.cloud.run.v2.InstanceSplitAllocationType} type - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @instance - */ - InstanceSplitStatus.prototype.type = 0; - - /** - * InstanceSplitStatus revision. - * @member {string} revision - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @instance - */ - InstanceSplitStatus.prototype.revision = ""; - - /** - * InstanceSplitStatus percent. - * @member {number} percent - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @instance - */ - InstanceSplitStatus.prototype.percent = 0; - - /** - * Creates a new InstanceSplitStatus instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {google.cloud.run.v2.IInstanceSplitStatus=} [properties] Properties to set - * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus instance - */ - InstanceSplitStatus.create = function create(properties) { - return new InstanceSplitStatus(properties); - }; - - /** - * Encodes the specified InstanceSplitStatus message. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {google.cloud.run.v2.IInstanceSplitStatus} message InstanceSplitStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSplitStatus.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.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); - if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); - return writer; - }; - - /** - * Encodes the specified InstanceSplitStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.InstanceSplitStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {google.cloud.run.v2.IInstanceSplitStatus} message InstanceSplitStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSplitStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceSplitStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSplitStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.InstanceSplitStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.revision = reader.string(); - break; - } - case 3: { - message.percent = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceSplitStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSplitStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceSplitStatus message. - * @function verify - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceSplitStatus.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.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.percent != null && message.hasOwnProperty("percent")) - if (!$util.isInteger(message.percent)) - return "percent: integer expected"; - return null; - }; - - /** - * Creates an InstanceSplitStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.InstanceSplitStatus} InstanceSplitStatus - */ - InstanceSplitStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.InstanceSplitStatus) - return object; - var message = new $root.google.cloud.run.v2.InstanceSplitStatus(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST": - case 1: - message.type = 1; - break; - case "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION": - case 2: - message.type = 2; - break; - } - if (object.revision != null) - message.revision = String(object.revision); - if (object.percent != null) - message.percent = object.percent | 0; - return message; - }; - - /** - * Creates a plain object from an InstanceSplitStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {google.cloud.run.v2.InstanceSplitStatus} message InstanceSplitStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceSplitStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED" : 0; - object.revision = ""; - object.percent = 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.InstanceSplitAllocationType[message.type] : message.type; - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.percent != null && message.hasOwnProperty("percent")) - object.percent = message.percent; - return object; - }; - - /** - * Converts this InstanceSplitStatus to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @instance - * @returns {Object.} JSON object - */ - InstanceSplitStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceSplitStatus - * @function getTypeUrl - * @memberof google.cloud.run.v2.InstanceSplitStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceSplitStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.InstanceSplitStatus"; - }; - - return InstanceSplitStatus; - })(); - - /** - * InstanceSplitAllocationType enum. - * @name google.cloud.run.v2.InstanceSplitAllocationType - * @enum {number} - * @property {number} INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED=0 INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED value - * @property {number} INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST=1 INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST value - * @property {number} INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION=2 INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION value - */ - v2.InstanceSplitAllocationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST"] = 1; - values[valuesById[2] = "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION"] = 2; - return values; - })(); - - v2.Jobs = (function() { - - /** - * Constructs a new Jobs service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Jobs - * @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 Jobs(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Jobs.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Jobs; - - /** - * Creates new Jobs service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Jobs - * @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 {Jobs} RPC service. Useful where requests and/or responses are streamed. - */ - Jobs.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|createJob}. - * @memberof google.cloud.run.v2.Jobs - * @typedef CreateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.ICreateJobRequest} request CreateJobRequest message or plain object - * @param {google.cloud.run.v2.Jobs.CreateJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.createJob = function createJob(request, callback) { - return this.rpcCall(createJob, $root.google.cloud.run.v2.CreateJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateJob" }); - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.ICreateJobRequest} request CreateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|getJob}. - * @memberof google.cloud.run.v2.Jobs - * @typedef GetJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Job} [response] Job - */ - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IGetJobRequest} request GetJobRequest message or plain object - * @param {google.cloud.run.v2.Jobs.GetJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.getJob = function getJob(request, callback) { - return this.rpcCall(getJob, $root.google.cloud.run.v2.GetJobRequest, $root.google.cloud.run.v2.Job, request, callback); - }, "name", { value: "GetJob" }); - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IGetJobRequest} request GetJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|listJobs}. - * @memberof google.cloud.run.v2.Jobs - * @typedef ListJobsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListJobsResponse} [response] ListJobsResponse - */ - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IListJobsRequest} request ListJobsRequest message or plain object - * @param {google.cloud.run.v2.Jobs.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.listJobs = function listJobs(request, callback) { - return this.rpcCall(listJobs, $root.google.cloud.run.v2.ListJobsRequest, $root.google.cloud.run.v2.ListJobsResponse, request, callback); - }, "name", { value: "ListJobs" }); - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IListJobsRequest} request ListJobsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|updateJob}. - * @memberof google.cloud.run.v2.Jobs - * @typedef UpdateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateJob. - * @function updateJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IUpdateJobRequest} request UpdateJobRequest message or plain object - * @param {google.cloud.run.v2.Jobs.UpdateJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.updateJob = function updateJob(request, callback) { - return this.rpcCall(updateJob, $root.google.cloud.run.v2.UpdateJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateJob" }); - - /** - * Calls UpdateJob. - * @function updateJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IUpdateJobRequest} request UpdateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|deleteJob}. - * @memberof google.cloud.run.v2.Jobs - * @typedef DeleteJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @param {google.cloud.run.v2.Jobs.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.deleteJob = function deleteJob(request, callback) { - return this.rpcCall(deleteJob, $root.google.cloud.run.v2.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteJob" }); - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|runJob}. - * @memberof google.cloud.run.v2.Jobs - * @typedef RunJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RunJob. - * @function runJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IRunJobRequest} request RunJobRequest message or plain object - * @param {google.cloud.run.v2.Jobs.RunJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.runJob = function runJob(request, callback) { - return this.rpcCall(runJob, $root.google.cloud.run.v2.RunJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RunJob" }); - - /** - * Calls RunJob. - * @function runJob - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.cloud.run.v2.IRunJobRequest} request RunJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|getIamPolicy}. - * @memberof google.cloud.run.v2.Jobs - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.Jobs.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|setIamPolicy}. - * @memberof google.cloud.run.v2.Jobs - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.Jobs.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Jobs|testIamPermissions}. - * @memberof google.cloud.run.v2.Jobs - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.run.v2.Jobs.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Jobs.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.Jobs - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Jobs; - })(); - - v2.CreateJobRequest = (function() { - - /** - * Properties of a CreateJobRequest. - * @memberof google.cloud.run.v2 - * @interface ICreateJobRequest - * @property {string|null} [parent] CreateJobRequest parent - * @property {google.cloud.run.v2.IJob|null} [job] CreateJobRequest job - * @property {string|null} [jobId] CreateJobRequest jobId - * @property {boolean|null} [validateOnly] CreateJobRequest validateOnly - */ - - /** - * Constructs a new CreateJobRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CreateJobRequest. - * @implements ICreateJobRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.parent = ""; - - /** - * CreateJobRequest job. - * @member {google.cloud.run.v2.IJob|null|undefined} job - * @memberof google.cloud.run.v2.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.job = null; - - /** - * CreateJobRequest jobId. - * @member {string} jobId - * @memberof google.cloud.run.v2.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.jobId = ""; - - /** - * CreateJobRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CreateJobRequest - * @static - * @param {google.cloud.run.v2.ICreateJobRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.CreateJobRequest} CreateJobRequest instance - */ - CreateJobRequest.create = function create(properties) { - return new CreateJobRequest(properties); - }; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.run.v2.CreateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CreateJobRequest - * @static - * @param {google.cloud.run.v2.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.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.run.v2.Job.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CreateJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.job = $root.google.cloud.run.v2.Job.decode(reader, reader.uint32()); - break; - } - case 3: { - message.jobId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - 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.run.v2.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.run.v2.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CreateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CreateJobRequest} CreateJobRequest - */ - CreateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CreateJobRequest) - return object; - var message = new $root.google.cloud.run.v2.CreateJobRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.run.v2.CreateJobRequest.job: object expected"); - message.job = $root.google.cloud.run.v2.Job.fromObject(object.job); - } - if (object.jobId != null) - message.jobId = String(object.jobId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CreateJobRequest - * @static - * @param {google.cloud.run.v2.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.job = null; - object.jobId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.run.v2.Job.toObject(message.job, options); - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.CreateJobRequest"; - }; - - return CreateJobRequest; - })(); - - v2.GetJobRequest = (function() { - - /** - * Properties of a GetJobRequest. - * @memberof google.cloud.run.v2 - * @interface IGetJobRequest - * @property {string|null} [name] GetJobRequest name - */ - - /** - * Constructs a new GetJobRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetJobRequest. - * @implements IGetJobRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.GetJobRequest - * @instance - */ - GetJobRequest.prototype.name = ""; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetJobRequest - * @static - * @param {google.cloud.run.v2.IGetJobRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetJobRequest} GetJobRequest instance - */ - GetJobRequest.create = function create(properties) { - return new GetJobRequest(properties); - }; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.run.v2.GetJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.GetJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.GetJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetJobRequest} GetJobRequest - */ - GetJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetJobRequest) - return object; - var message = new $root.google.cloud.run.v2.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.run.v2.GetJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.GetJobRequest"; - }; - - return GetJobRequest; - })(); - - v2.UpdateJobRequest = (function() { - - /** - * Properties of an UpdateJobRequest. - * @memberof google.cloud.run.v2 - * @interface IUpdateJobRequest - * @property {google.cloud.run.v2.IJob|null} [job] UpdateJobRequest job - * @property {boolean|null} [validateOnly] UpdateJobRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateJobRequest allowMissing - */ - - /** - * Constructs a new UpdateJobRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents an UpdateJobRequest. - * @implements IUpdateJobRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.IJob|null|undefined} job - * @memberof google.cloud.run.v2.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.job = null; - - /** - * UpdateJobRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.validateOnly = false; - - /** - * UpdateJobRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.run.v2.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.UpdateJobRequest - * @static - * @param {google.cloud.run.v2.IUpdateJobRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.UpdateJobRequest} UpdateJobRequest instance - */ - UpdateJobRequest.create = function create(properties) { - return new UpdateJobRequest(properties); - }; - - /** - * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.UpdateJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.UpdateJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.UpdateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.UpdateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.job = $root.google.cloud.run.v2.Job.decode(reader, reader.uint32()); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.allowMissing = reader.bool(); - 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.run.v2.UpdateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.UpdateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.UpdateJobRequest} UpdateJobRequest - */ - UpdateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.UpdateJobRequest) - return object; - var message = new $root.google.cloud.run.v2.UpdateJobRequest(); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.run.v2.UpdateJobRequest.job: object expected"); - message.job = $root.google.cloud.run.v2.Job.fromObject(object.job); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.UpdateJobRequest - * @static - * @param {google.cloud.run.v2.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.validateOnly = false; - object.allowMissing = false; - } - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.run.v2.Job.toObject(message.job, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.UpdateJobRequest"; - }; - - return UpdateJobRequest; - })(); - - v2.ListJobsRequest = (function() { - - /** - * Properties of a ListJobsRequest. - * @memberof google.cloud.run.v2 - * @interface IListJobsRequest - * @property {string|null} [parent] ListJobsRequest parent - * @property {number|null} [pageSize] ListJobsRequest pageSize - * @property {string|null} [pageToken] ListJobsRequest pageToken - * @property {boolean|null} [showDeleted] ListJobsRequest showDeleted - */ - - /** - * Constructs a new ListJobsRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListJobsRequest. - * @implements IListJobsRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.parent = ""; - - /** - * ListJobsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageSize = 0; - - /** - * ListJobsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageToken = ""; - - /** - * ListJobsRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.showDeleted = false; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListJobsRequest - * @static - * @param {google.cloud.run.v2.IListJobsRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListJobsRequest} ListJobsRequest instance - */ - ListJobsRequest.create = function create(properties) { - return new ListJobsRequest(properties); - }; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.run.v2.ListJobsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListJobsRequest - * @static - * @param {google.cloud.run.v2.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListJobsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListJobsRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListJobsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - 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.run.v2.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListJobsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListJobsRequest} ListJobsRequest - */ - ListJobsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListJobsRequest) - return object; - var message = new $root.google.cloud.run.v2.ListJobsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListJobsRequest - * @static - * @param {google.cloud.run.v2.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.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListJobsRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListJobsRequest"; - }; - - return ListJobsRequest; - })(); - - v2.ListJobsResponse = (function() { - - /** - * Properties of a ListJobsResponse. - * @memberof google.cloud.run.v2 - * @interface IListJobsResponse - * @property {Array.|null} [jobs] ListJobsResponse jobs - * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken - */ - - /** - * Constructs a new ListJobsResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListJobsResponse. - * @implements IListJobsResponse - * @constructor - * @param {google.cloud.run.v2.IListJobsResponse=} [properties] Properties to set - */ - function ListJobsResponse(properties) { - this.jobs = []; - if (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.run.v2.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.jobs = $util.emptyArray; - - /** - * ListJobsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListJobsResponse - * @static - * @param {google.cloud.run.v2.IListJobsResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListJobsResponse} ListJobsResponse instance - */ - ListJobsResponse.create = function create(properties) { - return new ListJobsResponse(properties); - }; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.run.v2.ListJobsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListJobsResponse - * @static - * @param {google.cloud.run.v2.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.run.v2.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); - return writer; - }; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListJobsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListJobsResponse - * @static - * @param {google.cloud.run.v2.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.run.v2.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListJobsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.jobs && message.jobs.length)) - message.jobs = []; - message.jobs.push($root.google.cloud.run.v2.Job.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = 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.run.v2.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.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"; - return null; - }; - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListJobsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListJobsResponse} ListJobsResponse - */ - ListJobsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListJobsResponse) - return object; - var message = new $root.google.cloud.run.v2.ListJobsResponse(); - if (object.jobs) { - if (!Array.isArray(object.jobs)) - throw TypeError(".google.cloud.run.v2.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.run.v2.ListJobsResponse.jobs: object expected"); - message.jobs[i] = $root.google.cloud.run.v2.Job.fromObject(object.jobs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListJobsResponse - * @static - * @param {google.cloud.run.v2.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 = []; - 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.run.v2.Job.toObject(message.jobs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListJobsResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListJobsResponse"; - }; - - return ListJobsResponse; - })(); - - v2.DeleteJobRequest = (function() { - - /** - * Properties of a DeleteJobRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteJobRequest - * @property {string|null} [name] DeleteJobRequest name - * @property {boolean|null} [validateOnly] DeleteJobRequest validateOnly - * @property {string|null} [etag] DeleteJobRequest etag - */ - - /** - * Constructs a new DeleteJobRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteJobRequest. - * @implements IDeleteJobRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.name = ""; - - /** - * DeleteJobRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.validateOnly = false; - - /** - * DeleteJobRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.etag = ""; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteJobRequest - * @static - * @param {google.cloud.run.v2.IDeleteJobRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteJobRequest} DeleteJobRequest instance - */ - DeleteJobRequest.create = function create(properties) { - return new DeleteJobRequest(properties); - }; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteJobRequest - * @static - * @param {google.cloud.run.v2.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.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteJobRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.etag = 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.run.v2.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: 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.run.v2.DeleteJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteJobRequest} DeleteJobRequest - */ - DeleteJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteJobRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteJobRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteJobRequest - * @static - * @param {google.cloud.run.v2.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.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.DeleteJobRequest"; - }; - - return DeleteJobRequest; - })(); - - v2.RunJobRequest = (function() { - - /** - * Properties of a RunJobRequest. - * @memberof google.cloud.run.v2 - * @interface IRunJobRequest - * @property {string|null} [name] RunJobRequest name - * @property {boolean|null} [validateOnly] RunJobRequest validateOnly - * @property {string|null} [etag] RunJobRequest etag - * @property {google.cloud.run.v2.RunJobRequest.IOverrides|null} [overrides] RunJobRequest overrides - */ - - /** - * Constructs a new RunJobRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a RunJobRequest. - * @implements IRunJobRequest - * @constructor - * @param {google.cloud.run.v2.IRunJobRequest=} [properties] Properties to set - */ - function RunJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunJobRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.RunJobRequest - * @instance - */ - RunJobRequest.prototype.name = ""; - - /** - * RunJobRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.RunJobRequest - * @instance - */ - RunJobRequest.prototype.validateOnly = false; - - /** - * RunJobRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.RunJobRequest - * @instance - */ - RunJobRequest.prototype.etag = ""; - - /** - * RunJobRequest overrides. - * @member {google.cloud.run.v2.RunJobRequest.IOverrides|null|undefined} overrides - * @memberof google.cloud.run.v2.RunJobRequest - * @instance - */ - RunJobRequest.prototype.overrides = null; - - /** - * Creates a new RunJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {google.cloud.run.v2.IRunJobRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest instance - */ - RunJobRequest.create = function create(properties) { - return new RunJobRequest(properties); - }; - - /** - * Encodes the specified RunJobRequest message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {google.cloud.run.v2.IRunJobRequest} message RunJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) - $root.google.cloud.run.v2.RunJobRequest.Overrides.encode(message.overrides, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RunJobRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {google.cloud.run.v2.IRunJobRequest} message RunJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunJobRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunJobRequest message. - * @function verify - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.overrides != null && message.hasOwnProperty("overrides")) { - var error = $root.google.cloud.run.v2.RunJobRequest.Overrides.verify(message.overrides); - if (error) - return "overrides." + error; - } - return null; - }; - - /** - * Creates a RunJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RunJobRequest} RunJobRequest - */ - RunJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RunJobRequest) - return object; - var message = new $root.google.cloud.run.v2.RunJobRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - if (object.overrides != null) { - if (typeof object.overrides !== "object") - throw TypeError(".google.cloud.run.v2.RunJobRequest.overrides: object expected"); - message.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.fromObject(object.overrides); - } - return message; - }; - - /** - * Creates a plain object from a RunJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {google.cloud.run.v2.RunJobRequest} message RunJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - object.overrides = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.overrides != null && message.hasOwnProperty("overrides")) - object.overrides = $root.google.cloud.run.v2.RunJobRequest.Overrides.toObject(message.overrides, options); - return object; - }; - - /** - * Converts this RunJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RunJobRequest - * @instance - * @returns {Object.} JSON object - */ - RunJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunJobRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.RunJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest"; - }; - - RunJobRequest.Overrides = (function() { - - /** - * Properties of an Overrides. - * @memberof google.cloud.run.v2.RunJobRequest - * @interface IOverrides - * @property {Array.|null} [containerOverrides] Overrides containerOverrides - * @property {number|null} [taskCount] Overrides taskCount - * @property {google.protobuf.IDuration|null} [timeout] Overrides timeout - */ - - /** - * Constructs a new Overrides. - * @memberof google.cloud.run.v2.RunJobRequest - * @classdesc Represents an Overrides. - * @implements IOverrides - * @constructor - * @param {google.cloud.run.v2.RunJobRequest.IOverrides=} [properties] Properties to set - */ - function Overrides(properties) { - this.containerOverrides = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Overrides containerOverrides. - * @member {Array.} containerOverrides - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @instance - */ - Overrides.prototype.containerOverrides = $util.emptyArray; - - /** - * Overrides taskCount. - * @member {number} taskCount - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @instance - */ - Overrides.prototype.taskCount = 0; - - /** - * Overrides timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @instance - */ - Overrides.prototype.timeout = null; - - /** - * Creates a new Overrides instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {google.cloud.run.v2.RunJobRequest.IOverrides=} [properties] Properties to set - * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides instance - */ - Overrides.create = function create(properties) { - return new Overrides(properties); - }; - - /** - * Encodes the specified Overrides message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {google.cloud.run.v2.RunJobRequest.IOverrides} message Overrides message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Overrides.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.containerOverrides != null && message.containerOverrides.length) - for (var i = 0; i < message.containerOverrides.length; ++i) - $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.encode(message.containerOverrides[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.taskCount); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Overrides message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {google.cloud.run.v2.RunJobRequest.IOverrides} message Overrides message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Overrides.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Overrides message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Overrides.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest.Overrides(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.containerOverrides && message.containerOverrides.length)) - message.containerOverrides = []; - message.containerOverrides.push($root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.decode(reader, reader.uint32())); - break; - } - case 2: { - message.taskCount = reader.int32(); - break; - } - case 4: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Overrides message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Overrides.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Overrides message. - * @function verify - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Overrides.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.containerOverrides != null && message.hasOwnProperty("containerOverrides")) { - if (!Array.isArray(message.containerOverrides)) - return "containerOverrides: array expected"; - for (var i = 0; i < message.containerOverrides.length; ++i) { - var error = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify(message.containerOverrides[i]); - if (error) - return "containerOverrides." + error; - } - } - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount)) - return "taskCount: integer 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 an Overrides message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RunJobRequest.Overrides} Overrides - */ - Overrides.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RunJobRequest.Overrides) - return object; - var message = new $root.google.cloud.run.v2.RunJobRequest.Overrides(); - if (object.containerOverrides) { - if (!Array.isArray(object.containerOverrides)) - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.containerOverrides: array expected"); - message.containerOverrides = []; - for (var i = 0; i < object.containerOverrides.length; ++i) { - if (typeof object.containerOverrides[i] !== "object") - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.containerOverrides: object expected"); - message.containerOverrides[i] = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.fromObject(object.containerOverrides[i]); - } - } - if (object.taskCount != null) - message.taskCount = object.taskCount | 0; - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from an Overrides message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {google.cloud.run.v2.RunJobRequest.Overrides} message Overrides - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Overrides.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.containerOverrides = []; - if (options.defaults) { - object.taskCount = 0; - object.timeout = null; - } - if (message.containerOverrides && message.containerOverrides.length) { - object.containerOverrides = []; - for (var j = 0; j < message.containerOverrides.length; ++j) - object.containerOverrides[j] = $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.toObject(message.containerOverrides[j], options); - } - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - object.taskCount = message.taskCount; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this Overrides to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @instance - * @returns {Object.} JSON object - */ - Overrides.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Overrides - * @function getTypeUrl - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Overrides.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest.Overrides"; - }; - - Overrides.ContainerOverride = (function() { - - /** - * Properties of a ContainerOverride. - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @interface IContainerOverride - * @property {string|null} [name] ContainerOverride name - * @property {Array.|null} [args] ContainerOverride args - * @property {Array.|null} [env] ContainerOverride env - * @property {boolean|null} [clearArgs] ContainerOverride clearArgs - */ - - /** - * Constructs a new ContainerOverride. - * @memberof google.cloud.run.v2.RunJobRequest.Overrides - * @classdesc Represents a ContainerOverride. - * @implements IContainerOverride - * @constructor - * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride=} [properties] Properties to set - */ - function ContainerOverride(properties) { - this.args = []; - this.env = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ContainerOverride name. - * @member {string} name - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @instance - */ - ContainerOverride.prototype.name = ""; - - /** - * ContainerOverride args. - * @member {Array.} args - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @instance - */ - ContainerOverride.prototype.args = $util.emptyArray; - - /** - * ContainerOverride env. - * @member {Array.} env - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @instance - */ - ContainerOverride.prototype.env = $util.emptyArray; - - /** - * ContainerOverride clearArgs. - * @member {boolean} clearArgs - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @instance - */ - ContainerOverride.prototype.clearArgs = false; - - /** - * Creates a new ContainerOverride instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride=} [properties] Properties to set - * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride instance - */ - ContainerOverride.create = function create(properties) { - return new ContainerOverride(properties); - }; - - /** - * Encodes the specified ContainerOverride message. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride} message ContainerOverride message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerOverride.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.args != null && message.args.length) - for (var i = 0; i < message.args.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.args[i]); - if (message.env != null && message.env.length) - for (var i = 0; i < message.env.length; ++i) - $root.google.cloud.run.v2.EnvVar.encode(message.env[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.clearArgs != null && Object.hasOwnProperty.call(message, "clearArgs")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.clearArgs); - return writer; - }; - - /** - * Encodes the specified ContainerOverride message, length delimited. Does not implicitly {@link google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {google.cloud.run.v2.RunJobRequest.Overrides.IContainerOverride} message ContainerOverride message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContainerOverride.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContainerOverride message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerOverride.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 3: { - if (!(message.env && message.env.length)) - message.env = []; - message.env.push($root.google.cloud.run.v2.EnvVar.decode(reader, reader.uint32())); - break; - } - case 4: { - message.clearArgs = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContainerOverride message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContainerOverride.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContainerOverride message. - * @function verify - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContainerOverride.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.args != null && message.hasOwnProperty("args")) { - if (!Array.isArray(message.args)) - return "args: array expected"; - for (var i = 0; i < message.args.length; ++i) - if (!$util.isString(message.args[i])) - return "args: string[] expected"; - } - if (message.env != null && message.hasOwnProperty("env")) { - if (!Array.isArray(message.env)) - return "env: array expected"; - for (var i = 0; i < message.env.length; ++i) { - var error = $root.google.cloud.run.v2.EnvVar.verify(message.env[i]); - if (error) - return "env." + error; - } - } - if (message.clearArgs != null && message.hasOwnProperty("clearArgs")) - if (typeof message.clearArgs !== "boolean") - return "clearArgs: boolean expected"; - return null; - }; - - /** - * Creates a ContainerOverride message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} ContainerOverride - */ - ContainerOverride.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride) - return object; - var message = new $root.google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride(); - if (object.name != null) - message.name = String(object.name); - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.env) { - if (!Array.isArray(object.env)) - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.env: array expected"); - message.env = []; - for (var i = 0; i < object.env.length; ++i) { - if (typeof object.env[i] !== "object") - throw TypeError(".google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride.env: object expected"); - message.env[i] = $root.google.cloud.run.v2.EnvVar.fromObject(object.env[i]); - } - } - if (object.clearArgs != null) - message.clearArgs = Boolean(object.clearArgs); - return message; - }; - - /** - * Creates a plain object from a ContainerOverride message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride} message ContainerOverride - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContainerOverride.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.args = []; - object.env = []; - } - if (options.defaults) { - object.name = ""; - object.clearArgs = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.args && message.args.length) { - object.args = []; - for (var j = 0; j < message.args.length; ++j) - object.args[j] = message.args[j]; - } - if (message.env && message.env.length) { - object.env = []; - for (var j = 0; j < message.env.length; ++j) - object.env[j] = $root.google.cloud.run.v2.EnvVar.toObject(message.env[j], options); - } - if (message.clearArgs != null && message.hasOwnProperty("clearArgs")) - object.clearArgs = message.clearArgs; - return object; - }; - - /** - * Converts this ContainerOverride to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @instance - * @returns {Object.} JSON object - */ - ContainerOverride.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContainerOverride - * @function getTypeUrl - * @memberof google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ContainerOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RunJobRequest.Overrides.ContainerOverride"; - }; - - return ContainerOverride; - })(); - - return Overrides; - })(); - - return RunJobRequest; - })(); - - v2.Job = (function() { - - /** - * Properties of a Job. - * @memberof google.cloud.run.v2 - * @interface IJob - * @property {string|null} [name] Job name - * @property {string|null} [uid] Job uid - * @property {number|Long|null} [generation] Job generation - * @property {Object.|null} [labels] Job labels - * @property {Object.|null} [annotations] Job annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Job deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Job expireTime - * @property {string|null} [creator] Job creator - * @property {string|null} [lastModifier] Job lastModifier - * @property {string|null} [client] Job client - * @property {string|null} [clientVersion] Job clientVersion - * @property {google.api.LaunchStage|null} [launchStage] Job launchStage - * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Job binaryAuthorization - * @property {google.cloud.run.v2.IExecutionTemplate|null} [template] Job template - * @property {number|Long|null} [observedGeneration] Job observedGeneration - * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Job terminalCondition - * @property {Array.|null} [conditions] Job conditions - * @property {number|null} [executionCount] Job executionCount - * @property {google.cloud.run.v2.IExecutionReference|null} [latestCreatedExecution] Job latestCreatedExecution - * @property {boolean|null} [reconciling] Job reconciling - * @property {boolean|null} [satisfiesPzs] Job satisfiesPzs - * @property {string|null} [startExecutionToken] Job startExecutionToken - * @property {string|null} [runExecutionToken] Job runExecutionToken - * @property {string|null} [etag] Job etag - */ - - /** - * Constructs a new Job. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Job. - * @implements IJob - * @constructor - * @param {google.cloud.run.v2.IJob=} [properties] Properties to set - */ - function Job(properties) { - this.labels = {}; - this.annotations = {}; - this.conditions = []; - if (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.run.v2.Job - * @instance - */ - Job.prototype.name = ""; - - /** - * Job uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.uid = ""; - - /** - * Job generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Job labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.labels = $util.emptyObject; - - /** - * Job annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.annotations = $util.emptyObject; - - /** - * Job createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.createTime = null; - - /** - * Job updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.updateTime = null; - - /** - * Job deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.deleteTime = null; - - /** - * Job expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.expireTime = null; - - /** - * Job creator. - * @member {string} creator - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.creator = ""; - - /** - * Job lastModifier. - * @member {string} lastModifier - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.lastModifier = ""; - - /** - * Job client. - * @member {string} client - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.client = ""; - - /** - * Job clientVersion. - * @member {string} clientVersion - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.clientVersion = ""; - - /** - * Job launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.launchStage = 0; - - /** - * Job binaryAuthorization. - * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.binaryAuthorization = null; - - /** - * Job template. - * @member {google.cloud.run.v2.IExecutionTemplate|null|undefined} template - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.template = null; - - /** - * Job observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Job terminalCondition. - * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.terminalCondition = null; - - /** - * Job conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.conditions = $util.emptyArray; - - /** - * Job executionCount. - * @member {number} executionCount - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.executionCount = 0; - - /** - * Job latestCreatedExecution. - * @member {google.cloud.run.v2.IExecutionReference|null|undefined} latestCreatedExecution - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.latestCreatedExecution = null; - - /** - * Job reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.reconciling = false; - - /** - * Job satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.satisfiesPzs = false; - - /** - * Job startExecutionToken. - * @member {string|null|undefined} startExecutionToken - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.startExecutionToken = null; - - /** - * Job runExecutionToken. - * @member {string|null|undefined} runExecutionToken - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.runExecutionToken = null; - - /** - * Job etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Job - * @instance - */ - Job.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Job createExecution. - * @member {"startExecutionToken"|"runExecutionToken"|undefined} createExecution - * @memberof google.cloud.run.v2.Job - * @instance - */ - Object.defineProperty(Job.prototype, "createExecution", { - get: $util.oneOfGetter($oneOfFields = ["startExecutionToken", "runExecutionToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Job instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Job - * @static - * @param {google.cloud.run.v2.IJob=} [properties] Properties to set - * @returns {google.cloud.run.v2.Job} Job instance - */ - Job.create = function create(properties) { - return new Job(properties); - }; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.run.v2.Job.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Job - * @static - * @param {google.cloud.run.v2.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.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.creator); - if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.lastModifier); - if (message.client != null && Object.hasOwnProperty.call(message, "client")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.client); - if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.clientVersion); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.launchStage); - if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) - $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.run.v2.ExecutionTemplate.encode(message.template, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.observedGeneration); - if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) - $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.executionCount != null && Object.hasOwnProperty.call(message, "executionCount")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.executionCount); - if (message.latestCreatedExecution != null && Object.hasOwnProperty.call(message, "latestCreatedExecution")) - $root.google.cloud.run.v2.ExecutionReference.encode(message.latestCreatedExecution, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.reconciling); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 25, wireType 0 =*/200).bool(message.satisfiesPzs); - if (message.startExecutionToken != null && Object.hasOwnProperty.call(message, "startExecutionToken")) - writer.uint32(/* id 26, wireType 2 =*/210).string(message.startExecutionToken); - if (message.runExecutionToken != null && Object.hasOwnProperty.call(message, "runExecutionToken")) - writer.uint32(/* id 27, wireType 2 =*/218).string(message.runExecutionToken); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.run.v2.Job.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Job - * @static - * @param {google.cloud.run.v2.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.run.v2.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Job(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 5: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.creator = reader.string(); - break; - } - case 11: { - message.lastModifier = reader.string(); - break; - } - case 12: { - message.client = reader.string(); - break; - } - case 13: { - message.clientVersion = reader.string(); - break; - } - case 14: { - message.launchStage = reader.int32(); - break; - } - case 15: { - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); - break; - } - case 16: { - message.template = $root.google.cloud.run.v2.ExecutionTemplate.decode(reader, reader.uint32()); - break; - } - case 17: { - message.observedGeneration = reader.int64(); - break; - } - case 18: { - message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); - break; - } - case 19: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 20: { - message.executionCount = reader.int32(); - break; - } - case 22: { - message.latestCreatedExecution = $root.google.cloud.run.v2.ExecutionReference.decode(reader, reader.uint32()); - break; - } - case 23: { - message.reconciling = reader.bool(); - break; - } - case 25: { - message.satisfiesPzs = reader.bool(); - break; - } - case 26: { - message.startExecutionToken = reader.string(); - break; - } - case 27: { - message.runExecutionToken = reader.string(); - break; - } - case 99: { - message.etag = reader.string(); - 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.run.v2.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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"; - var properties = {}; - 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.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - if (!$util.isString(message.lastModifier)) - return "lastModifier: string expected"; - if (message.client != null && message.hasOwnProperty("client")) - if (!$util.isString(message.client)) - return "client: string expected"; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - if (!$util.isString(message.clientVersion)) - return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { - var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); - if (error) - return "binaryAuthorization." + error; - } - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.run.v2.ExecutionTemplate.verify(message.template); - if (error) - return "template." + error; - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { - var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); - if (error) - return "terminalCondition." + error; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.executionCount != null && message.hasOwnProperty("executionCount")) - if (!$util.isInteger(message.executionCount)) - return "executionCount: integer expected"; - if (message.latestCreatedExecution != null && message.hasOwnProperty("latestCreatedExecution")) { - var error = $root.google.cloud.run.v2.ExecutionReference.verify(message.latestCreatedExecution); - if (error) - return "latestCreatedExecution." + error; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.startExecutionToken != null && message.hasOwnProperty("startExecutionToken")) { - properties.createExecution = 1; - if (!$util.isString(message.startExecutionToken)) - return "startExecutionToken: string expected"; - } - if (message.runExecutionToken != null && message.hasOwnProperty("runExecutionToken")) { - if (properties.createExecution === 1) - return "createExecution: multiple values"; - properties.createExecution = 1; - if (!$util.isString(message.runExecutionToken)) - return "runExecutionToken: string expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Job - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Job} Job - */ - Job.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Job) - return object; - var message = new $root.google.cloud.run.v2.Job(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Job.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.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.run.v2.Job.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Job.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Job.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.lastModifier != null) - message.lastModifier = String(object.lastModifier); - if (object.client != null) - message.client = String(object.client); - if (object.clientVersion != null) - message.clientVersion = String(object.clientVersion); - 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.binaryAuthorization != null) { - if (typeof object.binaryAuthorization !== "object") - throw TypeError(".google.cloud.run.v2.Job.binaryAuthorization: object expected"); - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); - } - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.run.v2.Job.template: object expected"); - message.template = $root.google.cloud.run.v2.ExecutionTemplate.fromObject(object.template); - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.terminalCondition != null) { - if (typeof object.terminalCondition !== "object") - throw TypeError(".google.cloud.run.v2.Job.terminalCondition: object expected"); - message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Job.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Job.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.executionCount != null) - message.executionCount = object.executionCount | 0; - if (object.latestCreatedExecution != null) { - if (typeof object.latestCreatedExecution !== "object") - throw TypeError(".google.cloud.run.v2.Job.latestCreatedExecution: object expected"); - message.latestCreatedExecution = $root.google.cloud.run.v2.ExecutionReference.fromObject(object.latestCreatedExecution); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.startExecutionToken != null) - message.startExecutionToken = String(object.startExecutionToken); - if (object.runExecutionToken != null) - message.runExecutionToken = String(object.runExecutionToken); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Job - * @static - * @param {google.cloud.run.v2.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.conditions = []; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.creator = ""; - object.lastModifier = ""; - object.client = ""; - object.clientVersion = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.binaryAuthorization = null; - object.template = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.terminalCondition = null; - object.executionCount = 0; - object.latestCreatedExecution = null; - object.reconciling = false; - object.satisfiesPzs = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - object.lastModifier = message.lastModifier; - if (message.client != null && message.hasOwnProperty("client")) - object.client = message.client; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - object.clientVersion = message.clientVersion; - 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) - object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.run.v2.ExecutionTemplate.toObject(message.template, options); - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) - object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.executionCount != null && message.hasOwnProperty("executionCount")) - object.executionCount = message.executionCount; - if (message.latestCreatedExecution != null && message.hasOwnProperty("latestCreatedExecution")) - object.latestCreatedExecution = $root.google.cloud.run.v2.ExecutionReference.toObject(message.latestCreatedExecution, options); - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.startExecutionToken != null && message.hasOwnProperty("startExecutionToken")) { - object.startExecutionToken = message.startExecutionToken; - if (options.oneofs) - object.createExecution = "startExecutionToken"; - } - if (message.runExecutionToken != null && message.hasOwnProperty("runExecutionToken")) { - object.runExecutionToken = message.runExecutionToken; - if (options.oneofs) - object.createExecution = "runExecutionToken"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Job to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Job"; - }; - - return Job; - })(); - - v2.ExecutionReference = (function() { - - /** - * Properties of an ExecutionReference. - * @memberof google.cloud.run.v2 - * @interface IExecutionReference - * @property {string|null} [name] ExecutionReference name - * @property {google.protobuf.ITimestamp|null} [createTime] ExecutionReference createTime - * @property {google.protobuf.ITimestamp|null} [completionTime] ExecutionReference completionTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] ExecutionReference deleteTime - * @property {google.cloud.run.v2.ExecutionReference.CompletionStatus|null} [completionStatus] ExecutionReference completionStatus - */ - - /** - * Constructs a new ExecutionReference. - * @memberof google.cloud.run.v2 - * @classdesc Represents an ExecutionReference. - * @implements IExecutionReference - * @constructor - * @param {google.cloud.run.v2.IExecutionReference=} [properties] Properties to set - */ - function ExecutionReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecutionReference name. - * @member {string} name - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - */ - ExecutionReference.prototype.name = ""; - - /** - * ExecutionReference createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - */ - ExecutionReference.prototype.createTime = null; - - /** - * ExecutionReference completionTime. - * @member {google.protobuf.ITimestamp|null|undefined} completionTime - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - */ - ExecutionReference.prototype.completionTime = null; - - /** - * ExecutionReference deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - */ - ExecutionReference.prototype.deleteTime = null; - - /** - * ExecutionReference completionStatus. - * @member {google.cloud.run.v2.ExecutionReference.CompletionStatus} completionStatus - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - */ - ExecutionReference.prototype.completionStatus = 0; - - /** - * Creates a new ExecutionReference instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {google.cloud.run.v2.IExecutionReference=} [properties] Properties to set - * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference instance - */ - ExecutionReference.create = function create(properties) { - return new ExecutionReference(properties); - }; - - /** - * Encodes the specified ExecutionReference message. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {google.cloud.run.v2.IExecutionReference} message ExecutionReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) - $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.completionStatus != null && Object.hasOwnProperty.call(message, "completionStatus")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.completionStatus); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecutionReference message, length delimited. Does not implicitly {@link google.cloud.run.v2.ExecutionReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {google.cloud.run.v2.IExecutionReference} message ExecutionReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecutionReference message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ExecutionReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.completionStatus = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecutionReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecutionReference message. - * @function verify - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecutionReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.completionTime != null && message.hasOwnProperty("completionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.completionTime); - if (error) - return "completionTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.completionStatus != null && message.hasOwnProperty("completionStatus")) - switch (message.completionStatus) { - default: - return "completionStatus: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; - - /** - * Creates an ExecutionReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ExecutionReference} ExecutionReference - */ - ExecutionReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ExecutionReference) - return object; - var message = new $root.google.cloud.run.v2.ExecutionReference(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionReference.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.completionTime != null) { - if (typeof object.completionTime !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionReference.completionTime: object expected"); - message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.ExecutionReference.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - switch (object.completionStatus) { - default: - if (typeof object.completionStatus === "number") { - message.completionStatus = object.completionStatus; - break; - } - break; - case "COMPLETION_STATUS_UNSPECIFIED": - case 0: - message.completionStatus = 0; - break; - case "EXECUTION_SUCCEEDED": - case 1: - message.completionStatus = 1; - break; - case "EXECUTION_FAILED": - case 2: - message.completionStatus = 2; - break; - case "EXECUTION_RUNNING": - case 3: - message.completionStatus = 3; - break; - case "EXECUTION_PENDING": - case 4: - message.completionStatus = 4; - break; - case "EXECUTION_CANCELLED": - case 5: - message.completionStatus = 5; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExecutionReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {google.cloud.run.v2.ExecutionReference} message ExecutionReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecutionReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.completionTime = null; - object.completionStatus = options.enums === String ? "COMPLETION_STATUS_UNSPECIFIED" : 0; - object.deleteTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.completionTime != null && message.hasOwnProperty("completionTime")) - object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); - if (message.completionStatus != null && message.hasOwnProperty("completionStatus")) - object.completionStatus = options.enums === String ? $root.google.cloud.run.v2.ExecutionReference.CompletionStatus[message.completionStatus] === undefined ? message.completionStatus : $root.google.cloud.run.v2.ExecutionReference.CompletionStatus[message.completionStatus] : message.completionStatus; - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - return object; - }; - - /** - * Converts this ExecutionReference to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ExecutionReference - * @instance - * @returns {Object.} JSON object - */ - ExecutionReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecutionReference - * @function getTypeUrl - * @memberof google.cloud.run.v2.ExecutionReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecutionReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ExecutionReference"; - }; - - /** - * CompletionStatus enum. - * @name google.cloud.run.v2.ExecutionReference.CompletionStatus - * @enum {number} - * @property {number} COMPLETION_STATUS_UNSPECIFIED=0 COMPLETION_STATUS_UNSPECIFIED value - * @property {number} EXECUTION_SUCCEEDED=1 EXECUTION_SUCCEEDED value - * @property {number} EXECUTION_FAILED=2 EXECUTION_FAILED value - * @property {number} EXECUTION_RUNNING=3 EXECUTION_RUNNING value - * @property {number} EXECUTION_PENDING=4 EXECUTION_PENDING value - * @property {number} EXECUTION_CANCELLED=5 EXECUTION_CANCELLED value - */ - ExecutionReference.CompletionStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMPLETION_STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXECUTION_SUCCEEDED"] = 1; - values[valuesById[2] = "EXECUTION_FAILED"] = 2; - values[valuesById[3] = "EXECUTION_RUNNING"] = 3; - values[valuesById[4] = "EXECUTION_PENDING"] = 4; - values[valuesById[5] = "EXECUTION_CANCELLED"] = 5; - return values; - })(); - - return ExecutionReference; - })(); - - v2.Revisions = (function() { - - /** - * Constructs a new Revisions service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Revisions - * @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 Revisions(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Revisions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Revisions; - - /** - * Creates new Revisions service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Revisions - * @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 {Revisions} RPC service. Useful where requests and/or responses are streamed. - */ - Revisions.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|getRevision}. - * @memberof google.cloud.run.v2.Revisions - * @typedef GetRevisionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Revision} [response] Revision - */ - - /** - * Calls GetRevision. - * @function getRevision - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IGetRevisionRequest} request GetRevisionRequest message or plain object - * @param {google.cloud.run.v2.Revisions.GetRevisionCallback} callback Node-style callback called with the error, if any, and Revision - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Revisions.prototype.getRevision = function getRevision(request, callback) { - return this.rpcCall(getRevision, $root.google.cloud.run.v2.GetRevisionRequest, $root.google.cloud.run.v2.Revision, request, callback); - }, "name", { value: "GetRevision" }); - - /** - * Calls GetRevision. - * @function getRevision - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IGetRevisionRequest} request GetRevisionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|listRevisions}. - * @memberof google.cloud.run.v2.Revisions - * @typedef ListRevisionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListRevisionsResponse} [response] ListRevisionsResponse - */ - - /** - * Calls ListRevisions. - * @function listRevisions - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IListRevisionsRequest} request ListRevisionsRequest message or plain object - * @param {google.cloud.run.v2.Revisions.ListRevisionsCallback} callback Node-style callback called with the error, if any, and ListRevisionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Revisions.prototype.listRevisions = function listRevisions(request, callback) { - return this.rpcCall(listRevisions, $root.google.cloud.run.v2.ListRevisionsRequest, $root.google.cloud.run.v2.ListRevisionsResponse, request, callback); - }, "name", { value: "ListRevisions" }); - - /** - * Calls ListRevisions. - * @function listRevisions - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IListRevisionsRequest} request ListRevisionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Revisions|deleteRevision}. - * @memberof google.cloud.run.v2.Revisions - * @typedef DeleteRevisionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteRevision. - * @function deleteRevision - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IDeleteRevisionRequest} request DeleteRevisionRequest message or plain object - * @param {google.cloud.run.v2.Revisions.DeleteRevisionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Revisions.prototype.deleteRevision = function deleteRevision(request, callback) { - return this.rpcCall(deleteRevision, $root.google.cloud.run.v2.DeleteRevisionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteRevision" }); - - /** - * Calls DeleteRevision. - * @function deleteRevision - * @memberof google.cloud.run.v2.Revisions - * @instance - * @param {google.cloud.run.v2.IDeleteRevisionRequest} request DeleteRevisionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Revisions; - })(); - - v2.GetRevisionRequest = (function() { - - /** - * Properties of a GetRevisionRequest. - * @memberof google.cloud.run.v2 - * @interface IGetRevisionRequest - * @property {string|null} [name] GetRevisionRequest name - */ - - /** - * Constructs a new GetRevisionRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetRevisionRequest. - * @implements IGetRevisionRequest - * @constructor - * @param {google.cloud.run.v2.IGetRevisionRequest=} [properties] Properties to set - */ - function GetRevisionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetRevisionRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.GetRevisionRequest - * @instance - */ - GetRevisionRequest.prototype.name = ""; - - /** - * Creates a new GetRevisionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {google.cloud.run.v2.IGetRevisionRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest instance - */ - GetRevisionRequest.create = function create(properties) { - return new GetRevisionRequest(properties); - }; - - /** - * Encodes the specified GetRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {google.cloud.run.v2.IGetRevisionRequest} message GetRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetRevisionRequest.encode = function encode(message, writer) { - 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 GetRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetRevisionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {google.cloud.run.v2.IGetRevisionRequest} message GetRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetRevisionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetRevisionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetRevisionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetRevisionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetRevisionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetRevisionRequest message. - * @function verify - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetRevisionRequest.verify = function verify(message) { - if (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 GetRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetRevisionRequest} GetRevisionRequest - */ - GetRevisionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetRevisionRequest) - return object; - var message = new $root.google.cloud.run.v2.GetRevisionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetRevisionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {google.cloud.run.v2.GetRevisionRequest} message GetRevisionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetRevisionRequest.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 GetRevisionRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GetRevisionRequest - * @instance - * @returns {Object.} JSON object - */ - GetRevisionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetRevisionRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.GetRevisionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GetRevisionRequest"; - }; - - return GetRevisionRequest; - })(); - - v2.ListRevisionsRequest = (function() { - - /** - * Properties of a ListRevisionsRequest. - * @memberof google.cloud.run.v2 - * @interface IListRevisionsRequest - * @property {string|null} [parent] ListRevisionsRequest parent - * @property {number|null} [pageSize] ListRevisionsRequest pageSize - * @property {string|null} [pageToken] ListRevisionsRequest pageToken - * @property {boolean|null} [showDeleted] ListRevisionsRequest showDeleted - */ - - /** - * Constructs a new ListRevisionsRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListRevisionsRequest. - * @implements IListRevisionsRequest - * @constructor - * @param {google.cloud.run.v2.IListRevisionsRequest=} [properties] Properties to set - */ - function ListRevisionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListRevisionsRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @instance - */ - ListRevisionsRequest.prototype.parent = ""; - - /** - * ListRevisionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @instance - */ - ListRevisionsRequest.prototype.pageSize = 0; - - /** - * ListRevisionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @instance - */ - ListRevisionsRequest.prototype.pageToken = ""; - - /** - * ListRevisionsRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @instance - */ - ListRevisionsRequest.prototype.showDeleted = false; - - /** - * Creates a new ListRevisionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {google.cloud.run.v2.IListRevisionsRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest instance - */ - ListRevisionsRequest.create = function create(properties) { - return new ListRevisionsRequest(properties); - }; - - /** - * Encodes the specified ListRevisionsRequest message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {google.cloud.run.v2.IListRevisionsRequest} message ListRevisionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRevisionsRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {google.cloud.run.v2.IListRevisionsRequest} message ListRevisionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListRevisionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRevisionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListRevisionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListRevisionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListRevisionsRequest message. - * @function verify - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListRevisionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListRevisionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListRevisionsRequest} ListRevisionsRequest - */ - ListRevisionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListRevisionsRequest) - return object; - var message = new $root.google.cloud.run.v2.ListRevisionsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListRevisionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {google.cloud.run.v2.ListRevisionsRequest} message ListRevisionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListRevisionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListRevisionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListRevisionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListRevisionsRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListRevisionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListRevisionsRequest"; - }; - - return ListRevisionsRequest; - })(); - - v2.ListRevisionsResponse = (function() { - - /** - * Properties of a ListRevisionsResponse. - * @memberof google.cloud.run.v2 - * @interface IListRevisionsResponse - * @property {Array.|null} [revisions] ListRevisionsResponse revisions - * @property {string|null} [nextPageToken] ListRevisionsResponse nextPageToken - */ - - /** - * Constructs a new ListRevisionsResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListRevisionsResponse. - * @implements IListRevisionsResponse - * @constructor - * @param {google.cloud.run.v2.IListRevisionsResponse=} [properties] Properties to set - */ - function ListRevisionsResponse(properties) { - this.revisions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListRevisionsResponse revisions. - * @member {Array.} revisions - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @instance - */ - ListRevisionsResponse.prototype.revisions = $util.emptyArray; - - /** - * ListRevisionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @instance - */ - ListRevisionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListRevisionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {google.cloud.run.v2.IListRevisionsResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse instance - */ - ListRevisionsResponse.create = function create(properties) { - return new ListRevisionsResponse(properties); - }; - - /** - * Encodes the specified ListRevisionsResponse message. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {google.cloud.run.v2.IListRevisionsResponse} message ListRevisionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRevisionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revisions != null && message.revisions.length) - for (var i = 0; i < message.revisions.length; ++i) - $root.google.cloud.run.v2.Revision.encode(message.revisions[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 ListRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListRevisionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {google.cloud.run.v2.IListRevisionsResponse} message ListRevisionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListRevisionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRevisionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListRevisionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.revisions && message.revisions.length)) - message.revisions = []; - message.revisions.push($root.google.cloud.run.v2.Revision.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListRevisionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListRevisionsResponse message. - * @function verify - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListRevisionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revisions != null && message.hasOwnProperty("revisions")) { - if (!Array.isArray(message.revisions)) - return "revisions: array expected"; - for (var i = 0; i < message.revisions.length; ++i) { - var error = $root.google.cloud.run.v2.Revision.verify(message.revisions[i]); - if (error) - return "revisions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListRevisionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListRevisionsResponse} ListRevisionsResponse - */ - ListRevisionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListRevisionsResponse) - return object; - var message = new $root.google.cloud.run.v2.ListRevisionsResponse(); - if (object.revisions) { - if (!Array.isArray(object.revisions)) - throw TypeError(".google.cloud.run.v2.ListRevisionsResponse.revisions: array expected"); - message.revisions = []; - for (var i = 0; i < object.revisions.length; ++i) { - if (typeof object.revisions[i] !== "object") - throw TypeError(".google.cloud.run.v2.ListRevisionsResponse.revisions: object expected"); - message.revisions[i] = $root.google.cloud.run.v2.Revision.fromObject(object.revisions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListRevisionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {google.cloud.run.v2.ListRevisionsResponse} message ListRevisionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListRevisionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.revisions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.revisions && message.revisions.length) { - object.revisions = []; - for (var j = 0; j < message.revisions.length; ++j) - object.revisions[j] = $root.google.cloud.run.v2.Revision.toObject(message.revisions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListRevisionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListRevisionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListRevisionsResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListRevisionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListRevisionsResponse"; - }; - - return ListRevisionsResponse; - })(); - - v2.DeleteRevisionRequest = (function() { - - /** - * Properties of a DeleteRevisionRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteRevisionRequest - * @property {string|null} [name] DeleteRevisionRequest name - * @property {boolean|null} [validateOnly] DeleteRevisionRequest validateOnly - * @property {string|null} [etag] DeleteRevisionRequest etag - */ - - /** - * Constructs a new DeleteRevisionRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteRevisionRequest. - * @implements IDeleteRevisionRequest - * @constructor - * @param {google.cloud.run.v2.IDeleteRevisionRequest=} [properties] Properties to set - */ - function DeleteRevisionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteRevisionRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @instance - */ - DeleteRevisionRequest.prototype.name = ""; - - /** - * DeleteRevisionRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @instance - */ - DeleteRevisionRequest.prototype.validateOnly = false; - - /** - * DeleteRevisionRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @instance - */ - DeleteRevisionRequest.prototype.etag = ""; - - /** - * Creates a new DeleteRevisionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {google.cloud.run.v2.IDeleteRevisionRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest instance - */ - DeleteRevisionRequest.create = function create(properties) { - return new DeleteRevisionRequest(properties); - }; - - /** - * Encodes the specified DeleteRevisionRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {google.cloud.run.v2.IDeleteRevisionRequest} message DeleteRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteRevisionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteRevisionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {google.cloud.run.v2.IDeleteRevisionRequest} message DeleteRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteRevisionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteRevisionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteRevisionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteRevisionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteRevisionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteRevisionRequest message. - * @function verify - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteRevisionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteRevisionRequest} DeleteRevisionRequest - */ - DeleteRevisionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteRevisionRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteRevisionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteRevisionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {google.cloud.run.v2.DeleteRevisionRequest} message DeleteRevisionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteRevisionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteRevisionRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteRevisionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteRevisionRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.DeleteRevisionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.DeleteRevisionRequest"; - }; - - return DeleteRevisionRequest; - })(); - - v2.Revision = (function() { - - /** - * Properties of a Revision. - * @memberof google.cloud.run.v2 - * @interface IRevision - * @property {string|null} [name] Revision name - * @property {string|null} [uid] Revision uid - * @property {number|Long|null} [generation] Revision generation - * @property {Object.|null} [labels] Revision labels - * @property {Object.|null} [annotations] Revision annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Revision createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Revision updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Revision deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Revision expireTime - * @property {google.api.LaunchStage|null} [launchStage] Revision launchStage - * @property {string|null} [service] Revision service - * @property {google.cloud.run.v2.IRevisionScaling|null} [scaling] Revision scaling - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Revision vpcAccess - * @property {number|null} [maxInstanceRequestConcurrency] Revision maxInstanceRequestConcurrency - * @property {google.protobuf.IDuration|null} [timeout] Revision timeout - * @property {string|null} [serviceAccount] Revision serviceAccount - * @property {Array.|null} [containers] Revision containers - * @property {Array.|null} [volumes] Revision volumes - * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] Revision executionEnvironment - * @property {string|null} [encryptionKey] Revision encryptionKey - * @property {google.cloud.run.v2.IServiceMesh|null} [serviceMesh] Revision serviceMesh - * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] Revision encryptionKeyRevocationAction - * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] Revision encryptionKeyShutdownDuration - * @property {boolean|null} [reconciling] Revision reconciling - * @property {Array.|null} [conditions] Revision conditions - * @property {number|Long|null} [observedGeneration] Revision observedGeneration - * @property {string|null} [logUri] Revision logUri - * @property {boolean|null} [satisfiesPzs] Revision satisfiesPzs - * @property {boolean|null} [sessionAffinity] Revision sessionAffinity - * @property {google.cloud.run.v2.IRevisionScalingStatus|null} [scalingStatus] Revision scalingStatus - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Revision nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] Revision gpuZonalRedundancyDisabled - * @property {string|null} [creator] Revision creator - * @property {string|null} [etag] Revision etag - */ - - /** - * Constructs a new Revision. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Revision. - * @implements IRevision - * @constructor - * @param {google.cloud.run.v2.IRevision=} [properties] Properties to set - */ - function Revision(properties) { - this.labels = {}; - this.annotations = {}; - this.containers = []; - this.volumes = []; - this.conditions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Revision name. - * @member {string} name - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.name = ""; - - /** - * Revision uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.uid = ""; - - /** - * Revision generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Revision labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.labels = $util.emptyObject; - - /** - * Revision annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.annotations = $util.emptyObject; - - /** - * Revision createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.createTime = null; - - /** - * Revision updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.updateTime = null; - - /** - * Revision deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.deleteTime = null; - - /** - * Revision expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.expireTime = null; - - /** - * Revision launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.launchStage = 0; - - /** - * Revision service. - * @member {string} service - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.service = ""; - - /** - * Revision scaling. - * @member {google.cloud.run.v2.IRevisionScaling|null|undefined} scaling - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.scaling = null; - - /** - * Revision vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.vpcAccess = null; - - /** - * Revision maxInstanceRequestConcurrency. - * @member {number} maxInstanceRequestConcurrency - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.maxInstanceRequestConcurrency = 0; - - /** - * Revision timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.timeout = null; - - /** - * Revision serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.serviceAccount = ""; - - /** - * Revision containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.containers = $util.emptyArray; - - /** - * Revision volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.volumes = $util.emptyArray; - - /** - * Revision executionEnvironment. - * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.executionEnvironment = 0; - - /** - * Revision encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.encryptionKey = ""; - - /** - * Revision serviceMesh. - * @member {google.cloud.run.v2.IServiceMesh|null|undefined} serviceMesh - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.serviceMesh = null; - - /** - * Revision encryptionKeyRevocationAction. - * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.encryptionKeyRevocationAction = 0; - - /** - * Revision encryptionKeyShutdownDuration. - * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.encryptionKeyShutdownDuration = null; - - /** - * Revision reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.reconciling = false; - - /** - * Revision conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.conditions = $util.emptyArray; - - /** - * Revision observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Revision logUri. - * @member {string} logUri - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.logUri = ""; - - /** - * Revision satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.satisfiesPzs = false; - - /** - * Revision sessionAffinity. - * @member {boolean} sessionAffinity - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.sessionAffinity = false; - - /** - * Revision scalingStatus. - * @member {google.cloud.run.v2.IRevisionScalingStatus|null|undefined} scalingStatus - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.scalingStatus = null; - - /** - * Revision nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.nodeSelector = null; - - /** - * Revision gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.gpuZonalRedundancyDisabled = null; - - /** - * Revision creator. - * @member {string} creator - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.creator = ""; - - /** - * Revision etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Revision - * @instance - */ - Revision.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Revision.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Revision instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Revision - * @static - * @param {google.cloud.run.v2.IRevision=} [properties] Properties to set - * @returns {google.cloud.run.v2.Revision} Revision instance - */ - Revision.create = function create(properties) { - return new Revision(properties); - }; - - /** - * Encodes the specified Revision message. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Revision - * @static - * @param {google.cloud.run.v2.IRevision} message Revision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Revision.encode = function encode(message, writer) { - if (!writer) - 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.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.launchStage); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.service); - if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) - $root.google.cloud.run.v2.RevisionScaling.encode(message.scaling, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.serviceAccount); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.executionEnvironment); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 21, wireType 2 =*/170).string(message.encryptionKey); - if (message.serviceMesh != null && Object.hasOwnProperty.call(message, "serviceMesh")) - $root.google.cloud.run.v2.ServiceMesh.encode(message.serviceMesh, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) - writer.uint32(/* id 23, wireType 0 =*/184).int32(message.encryptionKeyRevocationAction); - if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) - $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 30, wireType 0 =*/240).bool(message.reconciling); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 32, wireType 0 =*/256).int64(message.observedGeneration); - if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) - writer.uint32(/* id 33, wireType 2 =*/266).string(message.logUri); - if (message.maxInstanceRequestConcurrency != null && Object.hasOwnProperty.call(message, "maxInstanceRequestConcurrency")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.maxInstanceRequestConcurrency); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 37, wireType 0 =*/296).bool(message.satisfiesPzs); - if (message.sessionAffinity != null && Object.hasOwnProperty.call(message, "sessionAffinity")) - writer.uint32(/* id 38, wireType 0 =*/304).bool(message.sessionAffinity); - if (message.scalingStatus != null && Object.hasOwnProperty.call(message, "scalingStatus")) - $root.google.cloud.run.v2.RevisionScalingStatus.encode(message.scalingStatus, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 48, wireType 0 =*/384).bool(message.gpuZonalRedundancyDisabled); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 49, wireType 2 =*/394).string(message.creator); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.run.v2.Revision.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Revision - * @static - * @param {google.cloud.run.v2.IRevision} message Revision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Revision.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Revision message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Revision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Revision} Revision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Revision.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Revision(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 5: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.launchStage = reader.int32(); - break; - } - case 11: { - message.service = reader.string(); - break; - } - case 12: { - message.scaling = $root.google.cloud.run.v2.RevisionScaling.decode(reader, reader.uint32()); - break; - } - case 13: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 34: { - message.maxInstanceRequestConcurrency = reader.int32(); - break; - } - case 15: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 16: { - message.serviceAccount = reader.string(); - break; - } - case 17: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 18: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 20: { - message.executionEnvironment = reader.int32(); - break; - } - case 21: { - message.encryptionKey = reader.string(); - break; - } - case 22: { - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.decode(reader, reader.uint32()); - break; - } - case 23: { - message.encryptionKeyRevocationAction = reader.int32(); - break; - } - case 24: { - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 30: { - message.reconciling = reader.bool(); - break; - } - case 31: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 32: { - message.observedGeneration = reader.int64(); - break; - } - case 33: { - message.logUri = reader.string(); - break; - } - case 37: { - message.satisfiesPzs = reader.bool(); - break; - } - case 38: { - message.sessionAffinity = reader.bool(); - break; - } - case 39: { - message.scalingStatus = $root.google.cloud.run.v2.RevisionScalingStatus.decode(reader, reader.uint32()); - break; - } - case 40: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 48: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - case 49: { - message.creator = reader.string(); - break; - } - case 99: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Revision message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Revision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Revision} Revision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Revision.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Revision message. - * @function verify - * @memberof google.cloud.run.v2.Revision - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Revision.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.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - 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.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.scaling != null && message.hasOwnProperty("scaling")) { - var error = $root.google.cloud.run.v2.RevisionScaling.verify(message.scaling); - if (error) - return "scaling." + error; - } - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) - if (!$util.isInteger(message.maxInstanceRequestConcurrency)) - return "maxInstanceRequestConcurrency: integer expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - switch (message.executionEnvironment) { - default: - return "executionEnvironment: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) { - var error = $root.google.cloud.run.v2.ServiceMesh.verify(message.serviceMesh); - if (error) - return "serviceMesh." + error; - } - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - switch (message.encryptionKeyRevocationAction) { - default: - return "encryptionKeyRevocationAction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { - var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); - if (error) - return "encryptionKeyShutdownDuration." + error; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.logUri != null && message.hasOwnProperty("logUri")) - if (!$util.isString(message.logUri)) - return "logUri: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) - if (typeof message.sessionAffinity !== "boolean") - return "sessionAffinity: boolean expected"; - if (message.scalingStatus != null && message.hasOwnProperty("scalingStatus")) { - var error = $root.google.cloud.run.v2.RevisionScalingStatus.verify(message.scalingStatus); - if (error) - return "scalingStatus." + error; - } - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Revision message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Revision - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Revision} Revision - */ - Revision.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Revision) - return object; - var message = new $root.google.cloud.run.v2.Revision(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.Revision.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Revision.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.Revision.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.run.v2.Revision.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Revision.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Revision.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - 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.service != null) - message.service = String(object.service); - if (object.scaling != null) { - if (typeof object.scaling !== "object") - throw TypeError(".google.cloud.run.v2.Revision.scaling: object expected"); - message.scaling = $root.google.cloud.run.v2.RevisionScaling.fromObject(object.scaling); - } - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.Revision.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.maxInstanceRequestConcurrency != null) - message.maxInstanceRequestConcurrency = object.maxInstanceRequestConcurrency | 0; - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.run.v2.Revision.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.Revision.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.Revision.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.Revision.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.Revision.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - switch (object.executionEnvironment) { - default: - if (typeof object.executionEnvironment === "number") { - message.executionEnvironment = object.executionEnvironment; - break; - } - break; - case "EXECUTION_ENVIRONMENT_UNSPECIFIED": - case 0: - message.executionEnvironment = 0; - break; - case "EXECUTION_ENVIRONMENT_GEN1": - case 1: - message.executionEnvironment = 1; - break; - case "EXECUTION_ENVIRONMENT_GEN2": - case 2: - message.executionEnvironment = 2; - break; - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - if (object.serviceMesh != null) { - if (typeof object.serviceMesh !== "object") - throw TypeError(".google.cloud.run.v2.Revision.serviceMesh: object expected"); - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.fromObject(object.serviceMesh); - } - switch (object.encryptionKeyRevocationAction) { - default: - if (typeof object.encryptionKeyRevocationAction === "number") { - message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; - break; - } - break; - case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": - case 0: - message.encryptionKeyRevocationAction = 0; - break; - case "PREVENT_NEW": - case 1: - message.encryptionKeyRevocationAction = 1; - break; - case "SHUTDOWN": - case 2: - message.encryptionKeyRevocationAction = 2; - break; - } - if (object.encryptionKeyShutdownDuration != null) { - if (typeof object.encryptionKeyShutdownDuration !== "object") - throw TypeError(".google.cloud.run.v2.Revision.encryptionKeyShutdownDuration: object expected"); - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Revision.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Revision.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.logUri != null) - message.logUri = String(object.logUri); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.sessionAffinity != null) - message.sessionAffinity = Boolean(object.sessionAffinity); - if (object.scalingStatus != null) { - if (typeof object.scalingStatus !== "object") - throw TypeError(".google.cloud.run.v2.Revision.scalingStatus: object expected"); - message.scalingStatus = $root.google.cloud.run.v2.RevisionScalingStatus.fromObject(object.scalingStatus); - } - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.Revision.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - if (object.creator != null) - message.creator = String(object.creator); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Revision message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Revision - * @static - * @param {google.cloud.run.v2.Revision} message Revision - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Revision.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - object.conditions = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.service = ""; - object.scaling = null; - object.vpcAccess = null; - object.timeout = null; - object.serviceAccount = ""; - object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; - object.encryptionKey = ""; - object.serviceMesh = null; - object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; - object.encryptionKeyShutdownDuration = null; - object.reconciling = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.logUri = ""; - object.maxInstanceRequestConcurrency = 0; - object.satisfiesPzs = false; - object.sessionAffinity = false; - object.scalingStatus = null; - object.nodeSelector = null; - object.creator = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - 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.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.scaling != null && message.hasOwnProperty("scaling")) - object.scaling = $root.google.cloud.run.v2.RevisionScaling.toObject(message.scaling, options); - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) - object.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.toObject(message.serviceMesh, options); - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) - object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.logUri != null && message.hasOwnProperty("logUri")) - object.logUri = message.logUri; - if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) - object.maxInstanceRequestConcurrency = message.maxInstanceRequestConcurrency; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) - object.sessionAffinity = message.sessionAffinity; - if (message.scalingStatus != null && message.hasOwnProperty("scalingStatus")) - object.scalingStatus = $root.google.cloud.run.v2.RevisionScalingStatus.toObject(message.scalingStatus, options); - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Revision to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Revision - * @instance - * @returns {Object.} JSON object - */ - Revision.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Revision - * @function getTypeUrl - * @memberof google.cloud.run.v2.Revision - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Revision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Revision"; - }; - - return Revision; - })(); - - v2.RevisionScalingStatus = (function() { - - /** - * Properties of a RevisionScalingStatus. - * @memberof google.cloud.run.v2 - * @interface IRevisionScalingStatus - * @property {number|null} [desiredMinInstanceCount] RevisionScalingStatus desiredMinInstanceCount - */ - - /** - * Constructs a new RevisionScalingStatus. - * @memberof google.cloud.run.v2 - * @classdesc Represents a RevisionScalingStatus. - * @implements IRevisionScalingStatus - * @constructor - * @param {google.cloud.run.v2.IRevisionScalingStatus=} [properties] Properties to set - */ - function RevisionScalingStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RevisionScalingStatus desiredMinInstanceCount. - * @member {number} desiredMinInstanceCount - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @instance - */ - RevisionScalingStatus.prototype.desiredMinInstanceCount = 0; - - /** - * Creates a new RevisionScalingStatus instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {google.cloud.run.v2.IRevisionScalingStatus=} [properties] Properties to set - * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus instance - */ - RevisionScalingStatus.create = function create(properties) { - return new RevisionScalingStatus(properties); - }; - - /** - * Encodes the specified RevisionScalingStatus message. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {google.cloud.run.v2.IRevisionScalingStatus} message RevisionScalingStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionScalingStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.desiredMinInstanceCount != null && Object.hasOwnProperty.call(message, "desiredMinInstanceCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.desiredMinInstanceCount); - return writer; - }; - - /** - * Encodes the specified RevisionScalingStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionScalingStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {google.cloud.run.v2.IRevisionScalingStatus} message RevisionScalingStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionScalingStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevisionScalingStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionScalingStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RevisionScalingStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.desiredMinInstanceCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevisionScalingStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionScalingStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevisionScalingStatus message. - * @function verify - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevisionScalingStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.desiredMinInstanceCount != null && message.hasOwnProperty("desiredMinInstanceCount")) - if (!$util.isInteger(message.desiredMinInstanceCount)) - return "desiredMinInstanceCount: integer expected"; - return null; - }; - - /** - * Creates a RevisionScalingStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RevisionScalingStatus} RevisionScalingStatus - */ - RevisionScalingStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RevisionScalingStatus) - return object; - var message = new $root.google.cloud.run.v2.RevisionScalingStatus(); - if (object.desiredMinInstanceCount != null) - message.desiredMinInstanceCount = object.desiredMinInstanceCount | 0; - return message; - }; - - /** - * Creates a plain object from a RevisionScalingStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {google.cloud.run.v2.RevisionScalingStatus} message RevisionScalingStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevisionScalingStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.desiredMinInstanceCount = 0; - if (message.desiredMinInstanceCount != null && message.hasOwnProperty("desiredMinInstanceCount")) - object.desiredMinInstanceCount = message.desiredMinInstanceCount; - return object; - }; - - /** - * Converts this RevisionScalingStatus to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @instance - * @returns {Object.} JSON object - */ - RevisionScalingStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevisionScalingStatus - * @function getTypeUrl - * @memberof google.cloud.run.v2.RevisionScalingStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevisionScalingStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RevisionScalingStatus"; - }; - - return RevisionScalingStatus; - })(); - - v2.RevisionTemplate = (function() { - - /** - * Properties of a RevisionTemplate. - * @memberof google.cloud.run.v2 - * @interface IRevisionTemplate - * @property {string|null} [revision] RevisionTemplate revision - * @property {Object.|null} [labels] RevisionTemplate labels - * @property {Object.|null} [annotations] RevisionTemplate annotations - * @property {google.cloud.run.v2.IRevisionScaling|null} [scaling] RevisionTemplate scaling - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] RevisionTemplate vpcAccess - * @property {google.protobuf.IDuration|null} [timeout] RevisionTemplate timeout - * @property {string|null} [serviceAccount] RevisionTemplate serviceAccount - * @property {Array.|null} [containers] RevisionTemplate containers - * @property {Array.|null} [volumes] RevisionTemplate volumes - * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] RevisionTemplate executionEnvironment - * @property {string|null} [encryptionKey] RevisionTemplate encryptionKey - * @property {number|null} [maxInstanceRequestConcurrency] RevisionTemplate maxInstanceRequestConcurrency - * @property {google.cloud.run.v2.IServiceMesh|null} [serviceMesh] RevisionTemplate serviceMesh - * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] RevisionTemplate encryptionKeyRevocationAction - * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] RevisionTemplate encryptionKeyShutdownDuration - * @property {boolean|null} [sessionAffinity] RevisionTemplate sessionAffinity - * @property {boolean|null} [healthCheckDisabled] RevisionTemplate healthCheckDisabled - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] RevisionTemplate nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] RevisionTemplate gpuZonalRedundancyDisabled - */ - - /** - * Constructs a new RevisionTemplate. - * @memberof google.cloud.run.v2 - * @classdesc Represents a RevisionTemplate. - * @implements IRevisionTemplate - * @constructor - * @param {google.cloud.run.v2.IRevisionTemplate=} [properties] Properties to set - */ - function RevisionTemplate(properties) { - this.labels = {}; - this.annotations = {}; - this.containers = []; - 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]]; - } - - /** - * RevisionTemplate revision. - * @member {string} revision - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.revision = ""; - - /** - * RevisionTemplate labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.labels = $util.emptyObject; - - /** - * RevisionTemplate annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.annotations = $util.emptyObject; - - /** - * RevisionTemplate scaling. - * @member {google.cloud.run.v2.IRevisionScaling|null|undefined} scaling - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.scaling = null; - - /** - * RevisionTemplate vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.vpcAccess = null; - - /** - * RevisionTemplate timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.timeout = null; - - /** - * RevisionTemplate serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.serviceAccount = ""; - - /** - * RevisionTemplate containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.containers = $util.emptyArray; - - /** - * RevisionTemplate volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.volumes = $util.emptyArray; - - /** - * RevisionTemplate executionEnvironment. - * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.executionEnvironment = 0; - - /** - * RevisionTemplate encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.encryptionKey = ""; - - /** - * RevisionTemplate maxInstanceRequestConcurrency. - * @member {number} maxInstanceRequestConcurrency - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.maxInstanceRequestConcurrency = 0; - - /** - * RevisionTemplate serviceMesh. - * @member {google.cloud.run.v2.IServiceMesh|null|undefined} serviceMesh - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.serviceMesh = null; - - /** - * RevisionTemplate encryptionKeyRevocationAction. - * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.encryptionKeyRevocationAction = 0; - - /** - * RevisionTemplate encryptionKeyShutdownDuration. - * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.encryptionKeyShutdownDuration = null; - - /** - * RevisionTemplate sessionAffinity. - * @member {boolean} sessionAffinity - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.sessionAffinity = false; - - /** - * RevisionTemplate healthCheckDisabled. - * @member {boolean} healthCheckDisabled - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.healthCheckDisabled = false; - - /** - * RevisionTemplate nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.nodeSelector = null; - - /** - * RevisionTemplate gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - */ - RevisionTemplate.prototype.gpuZonalRedundancyDisabled = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(RevisionTemplate.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RevisionTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {google.cloud.run.v2.IRevisionTemplate=} [properties] Properties to set - * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate instance - */ - RevisionTemplate.create = function create(properties) { - return new RevisionTemplate(properties); - }; - - /** - * Encodes the specified RevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {google.cloud.run.v2.IRevisionTemplate} message RevisionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.revision); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) - $root.google.cloud.run.v2.RevisionScaling.encode(message.scaling, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 6, wireType 2 =*/50).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.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccount); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.executionEnvironment); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.encryptionKey); - if (message.maxInstanceRequestConcurrency != null && Object.hasOwnProperty.call(message, "maxInstanceRequestConcurrency")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.maxInstanceRequestConcurrency); - if (message.serviceMesh != null && Object.hasOwnProperty.call(message, "serviceMesh")) - $root.google.cloud.run.v2.ServiceMesh.encode(message.serviceMesh, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.encryptionKeyRevocationAction); - if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) - $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.sessionAffinity != null && Object.hasOwnProperty.call(message, "sessionAffinity")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.sessionAffinity); - if (message.healthCheckDisabled != null && Object.hasOwnProperty.call(message, "healthCheckDisabled")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.healthCheckDisabled); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 24, wireType 0 =*/192).bool(message.gpuZonalRedundancyDisabled); - return writer; - }; - - /** - * Encodes the specified RevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.RevisionTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {google.cloud.run.v2.IRevisionTemplate} message RevisionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevisionTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.RevisionTemplate(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revision = reader.string(); - break; - } - case 2: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 3: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 4: { - message.scaling = $root.google.cloud.run.v2.RevisionScaling.decode(reader, reader.uint32()); - break; - } - case 6: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 8: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - message.serviceAccount = reader.string(); - break; - } - case 10: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 11: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 13: { - message.executionEnvironment = reader.int32(); - break; - } - case 14: { - message.encryptionKey = reader.string(); - break; - } - case 15: { - message.maxInstanceRequestConcurrency = reader.int32(); - break; - } - case 16: { - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.decode(reader, reader.uint32()); - break; - } - case 17: { - message.encryptionKeyRevocationAction = reader.int32(); - break; - } - case 18: { - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 19: { - message.sessionAffinity = reader.bool(); - break; - } - case 20: { - message.healthCheckDisabled = reader.bool(); - break; - } - case 21: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 24: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevisionTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevisionTemplate message. - * @function verify - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevisionTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.scaling != null && message.hasOwnProperty("scaling")) { - var error = $root.google.cloud.run.v2.RevisionScaling.verify(message.scaling); - if (error) - return "scaling." + error; - } - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - switch (message.executionEnvironment) { - default: - return "executionEnvironment: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) - if (!$util.isInteger(message.maxInstanceRequestConcurrency)) - return "maxInstanceRequestConcurrency: integer expected"; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) { - var error = $root.google.cloud.run.v2.ServiceMesh.verify(message.serviceMesh); - if (error) - return "serviceMesh." + error; - } - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - switch (message.encryptionKeyRevocationAction) { - default: - return "encryptionKeyRevocationAction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { - var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); - if (error) - return "encryptionKeyShutdownDuration." + error; - } - if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) - if (typeof message.sessionAffinity !== "boolean") - return "sessionAffinity: boolean expected"; - if (message.healthCheckDisabled != null && message.hasOwnProperty("healthCheckDisabled")) - if (typeof message.healthCheckDisabled !== "boolean") - return "healthCheckDisabled: boolean expected"; - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - return null; - }; - - /** - * Creates a RevisionTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.RevisionTemplate} RevisionTemplate - */ - RevisionTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.RevisionTemplate) - return object; - var message = new $root.google.cloud.run.v2.RevisionTemplate(); - if (object.revision != null) - message.revision = String(object.revision); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.scaling != null) { - if (typeof object.scaling !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.scaling: object expected"); - message.scaling = $root.google.cloud.run.v2.RevisionScaling.fromObject(object.scaling); - } - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.RevisionTemplate.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.RevisionTemplate.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - switch (object.executionEnvironment) { - default: - if (typeof object.executionEnvironment === "number") { - message.executionEnvironment = object.executionEnvironment; - break; - } - break; - case "EXECUTION_ENVIRONMENT_UNSPECIFIED": - case 0: - message.executionEnvironment = 0; - break; - case "EXECUTION_ENVIRONMENT_GEN1": - case 1: - message.executionEnvironment = 1; - break; - case "EXECUTION_ENVIRONMENT_GEN2": - case 2: - message.executionEnvironment = 2; - break; - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - if (object.maxInstanceRequestConcurrency != null) - message.maxInstanceRequestConcurrency = object.maxInstanceRequestConcurrency | 0; - if (object.serviceMesh != null) { - if (typeof object.serviceMesh !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.serviceMesh: object expected"); - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.fromObject(object.serviceMesh); - } - switch (object.encryptionKeyRevocationAction) { - default: - if (typeof object.encryptionKeyRevocationAction === "number") { - message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; - break; - } - break; - case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": - case 0: - message.encryptionKeyRevocationAction = 0; - break; - case "PREVENT_NEW": - case 1: - message.encryptionKeyRevocationAction = 1; - break; - case "SHUTDOWN": - case 2: - message.encryptionKeyRevocationAction = 2; - break; - } - if (object.encryptionKeyShutdownDuration != null) { - if (typeof object.encryptionKeyShutdownDuration !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.encryptionKeyShutdownDuration: object expected"); - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); - } - if (object.sessionAffinity != null) - message.sessionAffinity = Boolean(object.sessionAffinity); - if (object.healthCheckDisabled != null) - message.healthCheckDisabled = Boolean(object.healthCheckDisabled); - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.RevisionTemplate.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - return message; - }; - - /** - * Creates a plain object from a RevisionTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {google.cloud.run.v2.RevisionTemplate} message RevisionTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevisionTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.revision = ""; - object.scaling = null; - object.vpcAccess = null; - object.timeout = null; - object.serviceAccount = ""; - object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; - object.encryptionKey = ""; - object.maxInstanceRequestConcurrency = 0; - object.serviceMesh = null; - object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; - object.encryptionKeyShutdownDuration = null; - object.sessionAffinity = false; - object.healthCheckDisabled = false; - object.nodeSelector = null; - } - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.scaling != null && message.hasOwnProperty("scaling")) - object.scaling = $root.google.cloud.run.v2.RevisionScaling.toObject(message.scaling, options); - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.maxInstanceRequestConcurrency != null && message.hasOwnProperty("maxInstanceRequestConcurrency")) - object.maxInstanceRequestConcurrency = message.maxInstanceRequestConcurrency; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) - object.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.toObject(message.serviceMesh, options); - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) - object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); - if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) - object.sessionAffinity = message.sessionAffinity; - if (message.healthCheckDisabled != null && message.hasOwnProperty("healthCheckDisabled")) - object.healthCheckDisabled = message.healthCheckDisabled; - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - return object; - }; - - /** - * Converts this RevisionTemplate to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.RevisionTemplate - * @instance - * @returns {Object.} JSON object - */ - RevisionTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevisionTemplate - * @function getTypeUrl - * @memberof google.cloud.run.v2.RevisionTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevisionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.RevisionTemplate"; - }; - - return RevisionTemplate; - })(); - - v2.Services = (function() { - - /** - * Constructs a new Services service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Services - * @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 Services(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Services.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Services; - - /** - * Creates new Services service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Services - * @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 {Services} RPC service. Useful where requests and/or responses are streamed. - */ - Services.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Services|createService}. - * @memberof google.cloud.run.v2.Services - * @typedef CreateServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateService. - * @function createService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.ICreateServiceRequest} request CreateServiceRequest message or plain object - * @param {google.cloud.run.v2.Services.CreateServiceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.createService = function createService(request, callback) { - return this.rpcCall(createService, $root.google.cloud.run.v2.CreateServiceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateService" }); - - /** - * Calls CreateService. - * @function createService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.ICreateServiceRequest} request CreateServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|getService}. - * @memberof google.cloud.run.v2.Services - * @typedef GetServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Service} [response] Service - */ - - /** - * Calls GetService. - * @function getService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IGetServiceRequest} request GetServiceRequest message or plain object - * @param {google.cloud.run.v2.Services.GetServiceCallback} callback Node-style callback called with the error, if any, and Service - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.getService = function getService(request, callback) { - return this.rpcCall(getService, $root.google.cloud.run.v2.GetServiceRequest, $root.google.cloud.run.v2.Service, request, callback); - }, "name", { value: "GetService" }); - - /** - * Calls GetService. - * @function getService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IGetServiceRequest} request GetServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|listServices}. - * @memberof google.cloud.run.v2.Services - * @typedef ListServicesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListServicesResponse} [response] ListServicesResponse - */ - - /** - * Calls ListServices. - * @function listServices - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IListServicesRequest} request ListServicesRequest message or plain object - * @param {google.cloud.run.v2.Services.ListServicesCallback} callback Node-style callback called with the error, if any, and ListServicesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.listServices = function listServices(request, callback) { - return this.rpcCall(listServices, $root.google.cloud.run.v2.ListServicesRequest, $root.google.cloud.run.v2.ListServicesResponse, request, callback); - }, "name", { value: "ListServices" }); - - /** - * Calls ListServices. - * @function listServices - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IListServicesRequest} request ListServicesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|updateService}. - * @memberof google.cloud.run.v2.Services - * @typedef UpdateServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateService. - * @function updateService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IUpdateServiceRequest} request UpdateServiceRequest message or plain object - * @param {google.cloud.run.v2.Services.UpdateServiceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.updateService = function updateService(request, callback) { - return this.rpcCall(updateService, $root.google.cloud.run.v2.UpdateServiceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateService" }); - - /** - * Calls UpdateService. - * @function updateService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IUpdateServiceRequest} request UpdateServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|deleteService}. - * @memberof google.cloud.run.v2.Services - * @typedef DeleteServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteService. - * @function deleteService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IDeleteServiceRequest} request DeleteServiceRequest message or plain object - * @param {google.cloud.run.v2.Services.DeleteServiceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.deleteService = function deleteService(request, callback) { - return this.rpcCall(deleteService, $root.google.cloud.run.v2.DeleteServiceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteService" }); - - /** - * Calls DeleteService. - * @function deleteService - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.cloud.run.v2.IDeleteServiceRequest} request DeleteServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|getIamPolicy}. - * @memberof google.cloud.run.v2.Services - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.Services.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|setIamPolicy}. - * @memberof google.cloud.run.v2.Services - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.Services.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Services|testIamPermissions}. - * @memberof google.cloud.run.v2.Services - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.run.v2.Services.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Services.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.Services - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Services; - })(); - - v2.CreateServiceRequest = (function() { - - /** - * Properties of a CreateServiceRequest. - * @memberof google.cloud.run.v2 - * @interface ICreateServiceRequest - * @property {string|null} [parent] CreateServiceRequest parent - * @property {google.cloud.run.v2.IService|null} [service] CreateServiceRequest service - * @property {string|null} [serviceId] CreateServiceRequest serviceId - * @property {boolean|null} [validateOnly] CreateServiceRequest validateOnly - */ - - /** - * Constructs a new CreateServiceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CreateServiceRequest. - * @implements ICreateServiceRequest - * @constructor - * @param {google.cloud.run.v2.ICreateServiceRequest=} [properties] Properties to set - */ - function CreateServiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateServiceRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.parent = ""; - - /** - * CreateServiceRequest service. - * @member {google.cloud.run.v2.IService|null|undefined} service - * @memberof google.cloud.run.v2.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.service = null; - - /** - * CreateServiceRequest serviceId. - * @member {string} serviceId - * @memberof google.cloud.run.v2.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.serviceId = ""; - - /** - * CreateServiceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateServiceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {google.cloud.run.v2.ICreateServiceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest instance - */ - CreateServiceRequest.create = function create(properties) { - return new CreateServiceRequest(properties); - }; - - /** - * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {google.cloud.run.v2.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateServiceRequest.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.service != null && Object.hasOwnProperty.call(message, "service")) - $root.google.cloud.run.v2.Service.encode(message.service, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.serviceId != null && Object.hasOwnProperty.call(message, "serviceId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {google.cloud.run.v2.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateServiceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.service = $root.google.cloud.run.v2.Service.decode(reader, reader.uint32()); - break; - } - case 3: { - message.serviceId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateServiceRequest message. - * @function verify - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateServiceRequest.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.service != null && message.hasOwnProperty("service")) { - var error = $root.google.cloud.run.v2.Service.verify(message.service); - if (error) - return "service." + error; - } - if (message.serviceId != null && message.hasOwnProperty("serviceId")) - if (!$util.isString(message.serviceId)) - return "serviceId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CreateServiceRequest} CreateServiceRequest - */ - CreateServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CreateServiceRequest) - return object; - var message = new $root.google.cloud.run.v2.CreateServiceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.service != null) { - if (typeof object.service !== "object") - throw TypeError(".google.cloud.run.v2.CreateServiceRequest.service: object expected"); - message.service = $root.google.cloud.run.v2.Service.fromObject(object.service); - } - if (object.serviceId != null) - message.serviceId = String(object.serviceId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {google.cloud.run.v2.CreateServiceRequest} message CreateServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateServiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.service = null; - object.serviceId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.service != null && message.hasOwnProperty("service")) - object.service = $root.google.cloud.run.v2.Service.toObject(message.service, options); - if (message.serviceId != null && message.hasOwnProperty("serviceId")) - object.serviceId = message.serviceId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateServiceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.CreateServiceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateServiceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.CreateServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.CreateServiceRequest"; - }; - - return CreateServiceRequest; - })(); - - v2.UpdateServiceRequest = (function() { - - /** - * Properties of an UpdateServiceRequest. - * @memberof google.cloud.run.v2 - * @interface IUpdateServiceRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServiceRequest updateMask - * @property {google.cloud.run.v2.IService|null} [service] UpdateServiceRequest service - * @property {boolean|null} [validateOnly] UpdateServiceRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateServiceRequest allowMissing - */ - - /** - * Constructs a new UpdateServiceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents an UpdateServiceRequest. - * @implements IUpdateServiceRequest - * @constructor - * @param {google.cloud.run.v2.IUpdateServiceRequest=} [properties] Properties to set - */ - function UpdateServiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateServiceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @instance - */ - UpdateServiceRequest.prototype.updateMask = null; - - /** - * UpdateServiceRequest service. - * @member {google.cloud.run.v2.IService|null|undefined} service - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @instance - */ - UpdateServiceRequest.prototype.service = null; - - /** - * UpdateServiceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @instance - */ - UpdateServiceRequest.prototype.validateOnly = false; - - /** - * UpdateServiceRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @instance - */ - UpdateServiceRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateServiceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {google.cloud.run.v2.IUpdateServiceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest instance - */ - UpdateServiceRequest.create = function create(properties) { - return new UpdateServiceRequest(properties); - }; - - /** - * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {google.cloud.run.v2.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateServiceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - $root.google.cloud.run.v2.Service.encode(message.service, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {google.cloud.run.v2.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateServiceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.UpdateServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 1: { - message.service = $root.google.cloud.run.v2.Service.decode(reader, reader.uint32()); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateServiceRequest message. - * @function verify - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.service != null && message.hasOwnProperty("service")) { - var error = $root.google.cloud.run.v2.Service.verify(message.service); - if (error) - return "service." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.UpdateServiceRequest} UpdateServiceRequest - */ - UpdateServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.UpdateServiceRequest) - return object; - var message = new $root.google.cloud.run.v2.UpdateServiceRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.run.v2.UpdateServiceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.service != null) { - if (typeof object.service !== "object") - throw TypeError(".google.cloud.run.v2.UpdateServiceRequest.service: object expected"); - message.service = $root.google.cloud.run.v2.Service.fromObject(object.service); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {google.cloud.run.v2.UpdateServiceRequest} message UpdateServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateServiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.service = null; - object.updateMask = null; - object.validateOnly = false; - object.allowMissing = false; - } - if (message.service != null && message.hasOwnProperty("service")) - object.service = $root.google.cloud.run.v2.Service.toObject(message.service, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateServiceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateServiceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.UpdateServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.UpdateServiceRequest"; - }; - - return UpdateServiceRequest; - })(); - - v2.ListServicesRequest = (function() { - - /** - * Properties of a ListServicesRequest. - * @memberof google.cloud.run.v2 - * @interface IListServicesRequest - * @property {string|null} [parent] ListServicesRequest parent - * @property {number|null} [pageSize] ListServicesRequest pageSize - * @property {string|null} [pageToken] ListServicesRequest pageToken - * @property {boolean|null} [showDeleted] ListServicesRequest showDeleted - */ - - /** - * Constructs a new ListServicesRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListServicesRequest. - * @implements IListServicesRequest - * @constructor - * @param {google.cloud.run.v2.IListServicesRequest=} [properties] Properties to set - */ - function ListServicesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListServicesRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.ListServicesRequest - * @instance - */ - ListServicesRequest.prototype.parent = ""; - - /** - * ListServicesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListServicesRequest - * @instance - */ - ListServicesRequest.prototype.pageSize = 0; - - /** - * ListServicesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListServicesRequest - * @instance - */ - ListServicesRequest.prototype.pageToken = ""; - - /** - * ListServicesRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListServicesRequest - * @instance - */ - ListServicesRequest.prototype.showDeleted = false; - - /** - * Creates a new ListServicesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {google.cloud.run.v2.IListServicesRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest instance - */ - ListServicesRequest.create = function create(properties) { - return new ListServicesRequest(properties); - }; - - /** - * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {google.cloud.run.v2.IListServicesRequest} message ListServicesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServicesRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {google.cloud.run.v2.IListServicesRequest} message ListServicesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListServicesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServicesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListServicesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServicesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListServicesRequest message. - * @function verify - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListServicesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListServicesRequest} ListServicesRequest - */ - ListServicesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListServicesRequest) - return object; - var message = new $root.google.cloud.run.v2.ListServicesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {google.cloud.run.v2.ListServicesRequest} message ListServicesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListServicesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListServicesRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListServicesRequest - * @instance - * @returns {Object.} JSON object - */ - ListServicesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListServicesRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListServicesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListServicesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListServicesRequest"; - }; - - return ListServicesRequest; - })(); - - v2.ListServicesResponse = (function() { - - /** - * Properties of a ListServicesResponse. - * @memberof google.cloud.run.v2 - * @interface IListServicesResponse - * @property {Array.|null} [services] ListServicesResponse services - * @property {string|null} [nextPageToken] ListServicesResponse nextPageToken - * @property {Array.|null} [unreachable] ListServicesResponse unreachable - */ - - /** - * Constructs a new ListServicesResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListServicesResponse. - * @implements IListServicesResponse - * @constructor - * @param {google.cloud.run.v2.IListServicesResponse=} [properties] Properties to set - */ - function ListServicesResponse(properties) { - this.services = []; - 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]]; - } - - /** - * ListServicesResponse services. - * @member {Array.} services - * @memberof google.cloud.run.v2.ListServicesResponse - * @instance - */ - ListServicesResponse.prototype.services = $util.emptyArray; - - /** - * ListServicesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListServicesResponse - * @instance - */ - ListServicesResponse.prototype.nextPageToken = ""; - - /** - * ListServicesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.run.v2.ListServicesResponse - * @instance - */ - ListServicesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListServicesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {google.cloud.run.v2.IListServicesResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse instance - */ - ListServicesResponse.create = function create(properties) { - return new ListServicesResponse(properties); - }; - - /** - * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {google.cloud.run.v2.IListServicesResponse} message ListServicesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServicesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.services != null && message.services.length) - for (var i = 0; i < message.services.length; ++i) - $root.google.cloud.run.v2.Service.encode(message.services[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 ListServicesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListServicesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {google.cloud.run.v2.IListServicesResponse} message ListServicesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServicesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListServicesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServicesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListServicesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.services && message.services.length)) - message.services = []; - message.services.push($root.google.cloud.run.v2.Service.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 ListServicesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServicesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListServicesResponse message. - * @function verify - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListServicesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.services != null && message.hasOwnProperty("services")) { - if (!Array.isArray(message.services)) - return "services: array expected"; - for (var i = 0; i < message.services.length; ++i) { - var error = $root.google.cloud.run.v2.Service.verify(message.services[i]); - if (error) - return "services." + 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 ListServicesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListServicesResponse} ListServicesResponse - */ - ListServicesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListServicesResponse) - return object; - var message = new $root.google.cloud.run.v2.ListServicesResponse(); - if (object.services) { - if (!Array.isArray(object.services)) - throw TypeError(".google.cloud.run.v2.ListServicesResponse.services: array expected"); - message.services = []; - for (var i = 0; i < object.services.length; ++i) { - if (typeof object.services[i] !== "object") - throw TypeError(".google.cloud.run.v2.ListServicesResponse.services: object expected"); - message.services[i] = $root.google.cloud.run.v2.Service.fromObject(object.services[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.run.v2.ListServicesResponse.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 ListServicesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {google.cloud.run.v2.ListServicesResponse} message ListServicesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListServicesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.services = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.services && message.services.length) { - object.services = []; - for (var j = 0; j < message.services.length; ++j) - object.services[j] = $root.google.cloud.run.v2.Service.toObject(message.services[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 ListServicesResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListServicesResponse - * @instance - * @returns {Object.} JSON object - */ - ListServicesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListServicesResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListServicesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListServicesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListServicesResponse"; - }; - - return ListServicesResponse; - })(); - - v2.GetServiceRequest = (function() { - - /** - * Properties of a GetServiceRequest. - * @memberof google.cloud.run.v2 - * @interface IGetServiceRequest - * @property {string|null} [name] GetServiceRequest name - */ - - /** - * Constructs a new GetServiceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetServiceRequest. - * @implements IGetServiceRequest - * @constructor - * @param {google.cloud.run.v2.IGetServiceRequest=} [properties] Properties to set - */ - function GetServiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetServiceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.GetServiceRequest - * @instance - */ - GetServiceRequest.prototype.name = ""; - - /** - * Creates a new GetServiceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {google.cloud.run.v2.IGetServiceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest instance - */ - GetServiceRequest.create = function create(properties) { - return new GetServiceRequest(properties); - }; - - /** - * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {google.cloud.run.v2.IGetServiceRequest} message GetServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetServiceRequest.encode = function encode(message, writer) { - 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 GetServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {google.cloud.run.v2.IGetServiceRequest} message GetServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetServiceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetServiceRequest message. - * @function verify - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetServiceRequest.verify = function verify(message) { - if (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 GetServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetServiceRequest} GetServiceRequest - */ - GetServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetServiceRequest) - return object; - var message = new $root.google.cloud.run.v2.GetServiceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {google.cloud.run.v2.GetServiceRequest} message GetServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetServiceRequest.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 GetServiceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GetServiceRequest - * @instance - * @returns {Object.} JSON object - */ - GetServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetServiceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.GetServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GetServiceRequest"; - }; - - return GetServiceRequest; - })(); - - v2.DeleteServiceRequest = (function() { - - /** - * Properties of a DeleteServiceRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteServiceRequest - * @property {string|null} [name] DeleteServiceRequest name - * @property {boolean|null} [validateOnly] DeleteServiceRequest validateOnly - * @property {string|null} [etag] DeleteServiceRequest etag - */ - - /** - * Constructs a new DeleteServiceRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteServiceRequest. - * @implements IDeleteServiceRequest - * @constructor - * @param {google.cloud.run.v2.IDeleteServiceRequest=} [properties] Properties to set - */ - function DeleteServiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteServiceRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @instance - */ - DeleteServiceRequest.prototype.name = ""; - - /** - * DeleteServiceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @instance - */ - DeleteServiceRequest.prototype.validateOnly = false; - - /** - * DeleteServiceRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @instance - */ - DeleteServiceRequest.prototype.etag = ""; - - /** - * Creates a new DeleteServiceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {google.cloud.run.v2.IDeleteServiceRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest instance - */ - DeleteServiceRequest.create = function create(properties) { - return new DeleteServiceRequest(properties); - }; - - /** - * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {google.cloud.run.v2.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteServiceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {google.cloud.run.v2.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteServiceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteServiceRequest message. - * @function verify - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteServiceRequest} DeleteServiceRequest - */ - DeleteServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteServiceRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteServiceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {google.cloud.run.v2.DeleteServiceRequest} message DeleteServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteServiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteServiceRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteServiceRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.DeleteServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.DeleteServiceRequest"; - }; - - return DeleteServiceRequest; - })(); - - v2.Service = (function() { - - /** - * Properties of a Service. - * @memberof google.cloud.run.v2 - * @interface IService - * @property {string|null} [name] Service name - * @property {string|null} [description] Service description - * @property {string|null} [uid] Service uid - * @property {number|Long|null} [generation] Service generation - * @property {Object.|null} [labels] Service labels - * @property {Object.|null} [annotations] Service annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Service createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Service updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Service deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Service expireTime - * @property {string|null} [creator] Service creator - * @property {string|null} [lastModifier] Service lastModifier - * @property {string|null} [client] Service client - * @property {string|null} [clientVersion] Service clientVersion - * @property {google.cloud.run.v2.IngressTraffic|null} [ingress] Service ingress - * @property {google.api.LaunchStage|null} [launchStage] Service launchStage - * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Service binaryAuthorization - * @property {google.cloud.run.v2.IRevisionTemplate|null} [template] Service template - * @property {Array.|null} [traffic] Service traffic - * @property {google.cloud.run.v2.IServiceScaling|null} [scaling] Service scaling - * @property {boolean|null} [invokerIamDisabled] Service invokerIamDisabled - * @property {boolean|null} [defaultUriDisabled] Service defaultUriDisabled - * @property {Array.|null} [urls] Service urls - * @property {boolean|null} [iapEnabled] Service iapEnabled - * @property {google.cloud.run.v2.Service.IMultiRegionSettings|null} [multiRegionSettings] Service multiRegionSettings - * @property {Array.|null} [customAudiences] Service customAudiences - * @property {number|Long|null} [observedGeneration] Service observedGeneration - * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Service terminalCondition - * @property {Array.|null} [conditions] Service conditions - * @property {string|null} [latestReadyRevision] Service latestReadyRevision - * @property {string|null} [latestCreatedRevision] Service latestCreatedRevision - * @property {Array.|null} [trafficStatuses] Service trafficStatuses - * @property {string|null} [uri] Service uri - * @property {boolean|null} [satisfiesPzs] Service satisfiesPzs - * @property {boolean|null} [threatDetectionEnabled] Service threatDetectionEnabled - * @property {google.cloud.run.v2.IBuildConfig|null} [buildConfig] Service buildConfig - * @property {boolean|null} [reconciling] Service reconciling - * @property {string|null} [etag] Service etag - */ - - /** - * Constructs a new Service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Service. - * @implements IService - * @constructor - * @param {google.cloud.run.v2.IService=} [properties] Properties to set - */ - function Service(properties) { - this.labels = {}; - this.annotations = {}; - this.traffic = []; - this.urls = []; - this.customAudiences = []; - this.conditions = []; - this.trafficStatuses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Service name. - * @member {string} name - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.name = ""; - - /** - * Service description. - * @member {string} description - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.description = ""; - - /** - * Service uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.uid = ""; - - /** - * Service generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Service labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.labels = $util.emptyObject; - - /** - * Service annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.annotations = $util.emptyObject; - - /** - * Service createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.createTime = null; - - /** - * Service updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.updateTime = null; - - /** - * Service deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.deleteTime = null; - - /** - * Service expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.expireTime = null; - - /** - * Service creator. - * @member {string} creator - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.creator = ""; - - /** - * Service lastModifier. - * @member {string} lastModifier - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.lastModifier = ""; - - /** - * Service client. - * @member {string} client - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.client = ""; - - /** - * Service clientVersion. - * @member {string} clientVersion - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.clientVersion = ""; - - /** - * Service ingress. - * @member {google.cloud.run.v2.IngressTraffic} ingress - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.ingress = 0; - - /** - * Service launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.launchStage = 0; - - /** - * Service binaryAuthorization. - * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.binaryAuthorization = null; - - /** - * Service template. - * @member {google.cloud.run.v2.IRevisionTemplate|null|undefined} template - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.template = null; - - /** - * Service traffic. - * @member {Array.} traffic - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.traffic = $util.emptyArray; - - /** - * Service scaling. - * @member {google.cloud.run.v2.IServiceScaling|null|undefined} scaling - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.scaling = null; - - /** - * Service invokerIamDisabled. - * @member {boolean} invokerIamDisabled - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.invokerIamDisabled = false; - - /** - * Service defaultUriDisabled. - * @member {boolean} defaultUriDisabled - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.defaultUriDisabled = false; - - /** - * Service urls. - * @member {Array.} urls - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.urls = $util.emptyArray; - - /** - * Service iapEnabled. - * @member {boolean} iapEnabled - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.iapEnabled = false; - - /** - * Service multiRegionSettings. - * @member {google.cloud.run.v2.Service.IMultiRegionSettings|null|undefined} multiRegionSettings - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.multiRegionSettings = null; - - /** - * Service customAudiences. - * @member {Array.} customAudiences - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.customAudiences = $util.emptyArray; - - /** - * Service observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Service terminalCondition. - * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.terminalCondition = null; - - /** - * Service conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.conditions = $util.emptyArray; - - /** - * Service latestReadyRevision. - * @member {string} latestReadyRevision - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.latestReadyRevision = ""; - - /** - * Service latestCreatedRevision. - * @member {string} latestCreatedRevision - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.latestCreatedRevision = ""; - - /** - * Service trafficStatuses. - * @member {Array.} trafficStatuses - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.trafficStatuses = $util.emptyArray; - - /** - * Service uri. - * @member {string} uri - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.uri = ""; - - /** - * Service satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.satisfiesPzs = false; - - /** - * Service threatDetectionEnabled. - * @member {boolean} threatDetectionEnabled - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.threatDetectionEnabled = false; - - /** - * Service buildConfig. - * @member {google.cloud.run.v2.IBuildConfig|null|undefined} buildConfig - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.buildConfig = null; - - /** - * Service reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.reconciling = false; - - /** - * Service etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Service - * @instance - */ - Service.prototype.etag = ""; - - /** - * Creates a new Service instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Service - * @static - * @param {google.cloud.run.v2.IService=} [properties] Properties to set - * @returns {google.cloud.run.v2.Service} Service instance - */ - Service.create = function create(properties) { - return new Service(properties); - }; - - /** - * Encodes the specified Service message. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Service - * @static - * @param {google.cloud.run.v2.IService} message Service message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Service.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.generation); - 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.creator); - if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.lastModifier); - if (message.client != null && Object.hasOwnProperty.call(message, "client")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.client); - if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.clientVersion); - if (message.ingress != null && Object.hasOwnProperty.call(message, "ingress")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.ingress); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); - if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) - $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.run.v2.RevisionTemplate.encode(message.template, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.traffic != null && message.traffic.length) - for (var i = 0; i < message.traffic.length; ++i) - $root.google.cloud.run.v2.TrafficTarget.encode(message.traffic[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) - $root.google.cloud.run.v2.ServiceScaling.encode(message.scaling, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.invokerIamDisabled != null && Object.hasOwnProperty.call(message, "invokerIamDisabled")) - writer.uint32(/* id 21, wireType 0 =*/168).bool(message.invokerIamDisabled); - if (message.defaultUriDisabled != null && Object.hasOwnProperty.call(message, "defaultUriDisabled")) - writer.uint32(/* id 22, wireType 0 =*/176).bool(message.defaultUriDisabled); - if (message.urls != null && message.urls.length) - for (var i = 0; i < message.urls.length; ++i) - writer.uint32(/* id 24, wireType 2 =*/194).string(message.urls[i]); - if (message.iapEnabled != null && Object.hasOwnProperty.call(message, "iapEnabled")) - writer.uint32(/* id 25, wireType 0 =*/200).bool(message.iapEnabled); - if (message.multiRegionSettings != null && Object.hasOwnProperty.call(message, "multiRegionSettings")) - $root.google.cloud.run.v2.Service.MultiRegionSettings.encode(message.multiRegionSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 30, wireType 0 =*/240).int64(message.observedGeneration); - if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) - $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.latestReadyRevision != null && Object.hasOwnProperty.call(message, "latestReadyRevision")) - writer.uint32(/* id 33, wireType 2 =*/266).string(message.latestReadyRevision); - if (message.latestCreatedRevision != null && Object.hasOwnProperty.call(message, "latestCreatedRevision")) - writer.uint32(/* id 34, wireType 2 =*/274).string(message.latestCreatedRevision); - if (message.trafficStatuses != null && message.trafficStatuses.length) - for (var i = 0; i < message.trafficStatuses.length; ++i) - $root.google.cloud.run.v2.TrafficTargetStatus.encode(message.trafficStatuses[i], writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.uri); - if (message.customAudiences != null && message.customAudiences.length) - for (var i = 0; i < message.customAudiences.length; ++i) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.customAudiences[i]); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 38, wireType 0 =*/304).bool(message.satisfiesPzs); - if (message.threatDetectionEnabled != null && Object.hasOwnProperty.call(message, "threatDetectionEnabled")) - writer.uint32(/* id 40, wireType 0 =*/320).bool(message.threatDetectionEnabled); - if (message.buildConfig != null && Object.hasOwnProperty.call(message, "buildConfig")) - $root.google.cloud.run.v2.BuildConfig.encode(message.buildConfig, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Service message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Service - * @static - * @param {google.cloud.run.v2.IService} message Service message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Service.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Service message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Service - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Service} Service - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Service.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Service(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.generation = reader.int64(); - 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.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.creator = reader.string(); - break; - } - case 12: { - message.lastModifier = reader.string(); - break; - } - case 13: { - message.client = reader.string(); - break; - } - case 14: { - message.clientVersion = reader.string(); - break; - } - case 15: { - message.ingress = reader.int32(); - break; - } - case 16: { - message.launchStage = reader.int32(); - break; - } - case 17: { - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); - break; - } - case 18: { - message.template = $root.google.cloud.run.v2.RevisionTemplate.decode(reader, reader.uint32()); - break; - } - case 19: { - if (!(message.traffic && message.traffic.length)) - message.traffic = []; - message.traffic.push($root.google.cloud.run.v2.TrafficTarget.decode(reader, reader.uint32())); - break; - } - case 20: { - message.scaling = $root.google.cloud.run.v2.ServiceScaling.decode(reader, reader.uint32()); - break; - } - case 21: { - message.invokerIamDisabled = reader.bool(); - break; - } - case 22: { - message.defaultUriDisabled = reader.bool(); - break; - } - case 24: { - if (!(message.urls && message.urls.length)) - message.urls = []; - message.urls.push(reader.string()); - break; - } - case 25: { - message.iapEnabled = reader.bool(); - break; - } - case 26: { - message.multiRegionSettings = $root.google.cloud.run.v2.Service.MultiRegionSettings.decode(reader, reader.uint32()); - break; - } - case 37: { - if (!(message.customAudiences && message.customAudiences.length)) - message.customAudiences = []; - message.customAudiences.push(reader.string()); - break; - } - case 30: { - message.observedGeneration = reader.int64(); - break; - } - case 31: { - message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); - break; - } - case 32: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 33: { - message.latestReadyRevision = reader.string(); - break; - } - case 34: { - message.latestCreatedRevision = reader.string(); - break; - } - case 35: { - if (!(message.trafficStatuses && message.trafficStatuses.length)) - message.trafficStatuses = []; - message.trafficStatuses.push($root.google.cloud.run.v2.TrafficTargetStatus.decode(reader, reader.uint32())); - break; - } - case 36: { - message.uri = reader.string(); - break; - } - case 38: { - message.satisfiesPzs = reader.bool(); - break; - } - case 40: { - message.threatDetectionEnabled = reader.bool(); - break; - } - case 41: { - message.buildConfig = $root.google.cloud.run.v2.BuildConfig.decode(reader, reader.uint32()); - break; - } - case 98: { - message.reconciling = reader.bool(); - break; - } - case 99: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Service message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Service - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Service} Service - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Service.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Service message. - * @function verify - * @memberof google.cloud.run.v2.Service - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Service.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - if (!$util.isString(message.lastModifier)) - return "lastModifier: string expected"; - if (message.client != null && message.hasOwnProperty("client")) - if (!$util.isString(message.client)) - return "client: string expected"; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - if (!$util.isString(message.clientVersion)) - return "clientVersion: string expected"; - if (message.ingress != null && message.hasOwnProperty("ingress")) - switch (message.ingress) { - default: - return "ingress: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { - var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); - if (error) - return "binaryAuthorization." + error; - } - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.run.v2.RevisionTemplate.verify(message.template); - if (error) - return "template." + error; - } - if (message.traffic != null && message.hasOwnProperty("traffic")) { - if (!Array.isArray(message.traffic)) - return "traffic: array expected"; - for (var i = 0; i < message.traffic.length; ++i) { - var error = $root.google.cloud.run.v2.TrafficTarget.verify(message.traffic[i]); - if (error) - return "traffic." + error; - } - } - if (message.scaling != null && message.hasOwnProperty("scaling")) { - var error = $root.google.cloud.run.v2.ServiceScaling.verify(message.scaling); - if (error) - return "scaling." + error; - } - if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) - if (typeof message.invokerIamDisabled !== "boolean") - return "invokerIamDisabled: boolean expected"; - if (message.defaultUriDisabled != null && message.hasOwnProperty("defaultUriDisabled")) - if (typeof message.defaultUriDisabled !== "boolean") - return "defaultUriDisabled: boolean expected"; - if (message.urls != null && message.hasOwnProperty("urls")) { - if (!Array.isArray(message.urls)) - return "urls: array expected"; - for (var i = 0; i < message.urls.length; ++i) - if (!$util.isString(message.urls[i])) - return "urls: string[] expected"; - } - if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) - if (typeof message.iapEnabled !== "boolean") - return "iapEnabled: boolean expected"; - if (message.multiRegionSettings != null && message.hasOwnProperty("multiRegionSettings")) { - var error = $root.google.cloud.run.v2.Service.MultiRegionSettings.verify(message.multiRegionSettings); - if (error) - return "multiRegionSettings." + error; - } - if (message.customAudiences != null && message.hasOwnProperty("customAudiences")) { - if (!Array.isArray(message.customAudiences)) - return "customAudiences: array expected"; - for (var i = 0; i < message.customAudiences.length; ++i) - if (!$util.isString(message.customAudiences[i])) - return "customAudiences: string[] expected"; - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { - var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); - if (error) - return "terminalCondition." + error; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) - if (!$util.isString(message.latestReadyRevision)) - return "latestReadyRevision: string expected"; - if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) - if (!$util.isString(message.latestCreatedRevision)) - return "latestCreatedRevision: string expected"; - if (message.trafficStatuses != null && message.hasOwnProperty("trafficStatuses")) { - if (!Array.isArray(message.trafficStatuses)) - return "trafficStatuses: array expected"; - for (var i = 0; i < message.trafficStatuses.length; ++i) { - var error = $root.google.cloud.run.v2.TrafficTargetStatus.verify(message.trafficStatuses[i]); - if (error) - return "trafficStatuses." + error; - } - } - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) - if (typeof message.threatDetectionEnabled !== "boolean") - return "threatDetectionEnabled: boolean expected"; - if (message.buildConfig != null && message.hasOwnProperty("buildConfig")) { - var error = $root.google.cloud.run.v2.BuildConfig.verify(message.buildConfig); - if (error) - return "buildConfig." + error; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Service message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Service - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Service} Service - */ - Service.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Service) - return object; - var message = new $root.google.cloud.run.v2.Service(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.Service.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Service.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.Service.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.run.v2.Service.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Service.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Service.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.lastModifier != null) - message.lastModifier = String(object.lastModifier); - if (object.client != null) - message.client = String(object.client); - if (object.clientVersion != null) - message.clientVersion = String(object.clientVersion); - switch (object.ingress) { - default: - if (typeof object.ingress === "number") { - message.ingress = object.ingress; - break; - } - break; - case "INGRESS_TRAFFIC_UNSPECIFIED": - case 0: - message.ingress = 0; - break; - case "INGRESS_TRAFFIC_ALL": - case 1: - message.ingress = 1; - break; - case "INGRESS_TRAFFIC_INTERNAL_ONLY": - case 2: - message.ingress = 2; - break; - case "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": - case 3: - message.ingress = 3; - break; - case "INGRESS_TRAFFIC_NONE": - case 4: - message.ingress = 4; - break; - } - 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.binaryAuthorization != null) { - if (typeof object.binaryAuthorization !== "object") - throw TypeError(".google.cloud.run.v2.Service.binaryAuthorization: object expected"); - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); - } - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.run.v2.Service.template: object expected"); - message.template = $root.google.cloud.run.v2.RevisionTemplate.fromObject(object.template); - } - if (object.traffic) { - if (!Array.isArray(object.traffic)) - throw TypeError(".google.cloud.run.v2.Service.traffic: array expected"); - message.traffic = []; - for (var i = 0; i < object.traffic.length; ++i) { - if (typeof object.traffic[i] !== "object") - throw TypeError(".google.cloud.run.v2.Service.traffic: object expected"); - message.traffic[i] = $root.google.cloud.run.v2.TrafficTarget.fromObject(object.traffic[i]); - } - } - if (object.scaling != null) { - if (typeof object.scaling !== "object") - throw TypeError(".google.cloud.run.v2.Service.scaling: object expected"); - message.scaling = $root.google.cloud.run.v2.ServiceScaling.fromObject(object.scaling); - } - if (object.invokerIamDisabled != null) - message.invokerIamDisabled = Boolean(object.invokerIamDisabled); - if (object.defaultUriDisabled != null) - message.defaultUriDisabled = Boolean(object.defaultUriDisabled); - if (object.urls) { - if (!Array.isArray(object.urls)) - throw TypeError(".google.cloud.run.v2.Service.urls: array expected"); - message.urls = []; - for (var i = 0; i < object.urls.length; ++i) - message.urls[i] = String(object.urls[i]); - } - if (object.iapEnabled != null) - message.iapEnabled = Boolean(object.iapEnabled); - if (object.multiRegionSettings != null) { - if (typeof object.multiRegionSettings !== "object") - throw TypeError(".google.cloud.run.v2.Service.multiRegionSettings: object expected"); - message.multiRegionSettings = $root.google.cloud.run.v2.Service.MultiRegionSettings.fromObject(object.multiRegionSettings); - } - if (object.customAudiences) { - if (!Array.isArray(object.customAudiences)) - throw TypeError(".google.cloud.run.v2.Service.customAudiences: array expected"); - message.customAudiences = []; - for (var i = 0; i < object.customAudiences.length; ++i) - message.customAudiences[i] = String(object.customAudiences[i]); - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.terminalCondition != null) { - if (typeof object.terminalCondition !== "object") - throw TypeError(".google.cloud.run.v2.Service.terminalCondition: object expected"); - message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Service.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Service.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.latestReadyRevision != null) - message.latestReadyRevision = String(object.latestReadyRevision); - if (object.latestCreatedRevision != null) - message.latestCreatedRevision = String(object.latestCreatedRevision); - if (object.trafficStatuses) { - if (!Array.isArray(object.trafficStatuses)) - throw TypeError(".google.cloud.run.v2.Service.trafficStatuses: array expected"); - message.trafficStatuses = []; - for (var i = 0; i < object.trafficStatuses.length; ++i) { - if (typeof object.trafficStatuses[i] !== "object") - throw TypeError(".google.cloud.run.v2.Service.trafficStatuses: object expected"); - message.trafficStatuses[i] = $root.google.cloud.run.v2.TrafficTargetStatus.fromObject(object.trafficStatuses[i]); - } - } - if (object.uri != null) - message.uri = String(object.uri); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.threatDetectionEnabled != null) - message.threatDetectionEnabled = Boolean(object.threatDetectionEnabled); - if (object.buildConfig != null) { - if (typeof object.buildConfig !== "object") - throw TypeError(".google.cloud.run.v2.Service.buildConfig: object expected"); - message.buildConfig = $root.google.cloud.run.v2.BuildConfig.fromObject(object.buildConfig); - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Service message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Service - * @static - * @param {google.cloud.run.v2.Service} message Service - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Service.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.traffic = []; - object.urls = []; - object.conditions = []; - object.trafficStatuses = []; - object.customAudiences = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.description = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.creator = ""; - object.lastModifier = ""; - object.client = ""; - object.clientVersion = ""; - object.ingress = options.enums === String ? "INGRESS_TRAFFIC_UNSPECIFIED" : 0; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.binaryAuthorization = null; - object.template = null; - object.scaling = null; - object.invokerIamDisabled = false; - object.defaultUriDisabled = false; - object.iapEnabled = false; - object.multiRegionSettings = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.terminalCondition = null; - object.latestReadyRevision = ""; - object.latestCreatedRevision = ""; - object.uri = ""; - object.satisfiesPzs = false; - object.threatDetectionEnabled = false; - object.buildConfig = null; - object.reconciling = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - object.lastModifier = message.lastModifier; - if (message.client != null && message.hasOwnProperty("client")) - object.client = message.client; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - object.clientVersion = message.clientVersion; - if (message.ingress != null && message.hasOwnProperty("ingress")) - object.ingress = options.enums === String ? $root.google.cloud.run.v2.IngressTraffic[message.ingress] === undefined ? message.ingress : $root.google.cloud.run.v2.IngressTraffic[message.ingress] : message.ingress; - 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) - object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.run.v2.RevisionTemplate.toObject(message.template, options); - if (message.traffic && message.traffic.length) { - object.traffic = []; - for (var j = 0; j < message.traffic.length; ++j) - object.traffic[j] = $root.google.cloud.run.v2.TrafficTarget.toObject(message.traffic[j], options); - } - if (message.scaling != null && message.hasOwnProperty("scaling")) - object.scaling = $root.google.cloud.run.v2.ServiceScaling.toObject(message.scaling, options); - if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) - object.invokerIamDisabled = message.invokerIamDisabled; - if (message.defaultUriDisabled != null && message.hasOwnProperty("defaultUriDisabled")) - object.defaultUriDisabled = message.defaultUriDisabled; - if (message.urls && message.urls.length) { - object.urls = []; - for (var j = 0; j < message.urls.length; ++j) - object.urls[j] = message.urls[j]; - } - if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) - object.iapEnabled = message.iapEnabled; - if (message.multiRegionSettings != null && message.hasOwnProperty("multiRegionSettings")) - object.multiRegionSettings = $root.google.cloud.run.v2.Service.MultiRegionSettings.toObject(message.multiRegionSettings, options); - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) - object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) - object.latestReadyRevision = message.latestReadyRevision; - if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) - object.latestCreatedRevision = message.latestCreatedRevision; - if (message.trafficStatuses && message.trafficStatuses.length) { - object.trafficStatuses = []; - for (var j = 0; j < message.trafficStatuses.length; ++j) - object.trafficStatuses[j] = $root.google.cloud.run.v2.TrafficTargetStatus.toObject(message.trafficStatuses[j], options); - } - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - if (message.customAudiences && message.customAudiences.length) { - object.customAudiences = []; - for (var j = 0; j < message.customAudiences.length; ++j) - object.customAudiences[j] = message.customAudiences[j]; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) - object.threatDetectionEnabled = message.threatDetectionEnabled; - if (message.buildConfig != null && message.hasOwnProperty("buildConfig")) - object.buildConfig = $root.google.cloud.run.v2.BuildConfig.toObject(message.buildConfig, options); - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Service to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Service - * @instance - * @returns {Object.} JSON object - */ - Service.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Service - * @function getTypeUrl - * @memberof google.cloud.run.v2.Service - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Service.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Service"; - }; - - Service.MultiRegionSettings = (function() { - - /** - * Properties of a MultiRegionSettings. - * @memberof google.cloud.run.v2.Service - * @interface IMultiRegionSettings - * @property {Array.|null} [regions] MultiRegionSettings regions - * @property {string|null} [multiRegionId] MultiRegionSettings multiRegionId - */ - - /** - * Constructs a new MultiRegionSettings. - * @memberof google.cloud.run.v2.Service - * @classdesc Represents a MultiRegionSettings. - * @implements IMultiRegionSettings - * @constructor - * @param {google.cloud.run.v2.Service.IMultiRegionSettings=} [properties] Properties to set - */ - function MultiRegionSettings(properties) { - this.regions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MultiRegionSettings regions. - * @member {Array.} regions - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @instance - */ - MultiRegionSettings.prototype.regions = $util.emptyArray; - - /** - * MultiRegionSettings multiRegionId. - * @member {string} multiRegionId - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @instance - */ - MultiRegionSettings.prototype.multiRegionId = ""; - - /** - * Creates a new MultiRegionSettings instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {google.cloud.run.v2.Service.IMultiRegionSettings=} [properties] Properties to set - * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings instance - */ - MultiRegionSettings.create = function create(properties) { - return new MultiRegionSettings(properties); - }; - - /** - * Encodes the specified MultiRegionSettings message. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {google.cloud.run.v2.Service.IMultiRegionSettings} message MultiRegionSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiRegionSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.regions != null && message.regions.length) - for (var i = 0; i < message.regions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.regions[i]); - if (message.multiRegionId != null && Object.hasOwnProperty.call(message, "multiRegionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.multiRegionId); - return writer; - }; - - /** - * Encodes the specified MultiRegionSettings message, length delimited. Does not implicitly {@link google.cloud.run.v2.Service.MultiRegionSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {google.cloud.run.v2.Service.IMultiRegionSettings} message MultiRegionSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiRegionSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MultiRegionSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiRegionSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Service.MultiRegionSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.regions && message.regions.length)) - message.regions = []; - message.regions.push(reader.string()); - break; - } - case 2: { - message.multiRegionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MultiRegionSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiRegionSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MultiRegionSettings message. - * @function verify - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MultiRegionSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.regions != null && message.hasOwnProperty("regions")) { - if (!Array.isArray(message.regions)) - return "regions: array expected"; - for (var i = 0; i < message.regions.length; ++i) - if (!$util.isString(message.regions[i])) - return "regions: string[] expected"; - } - if (message.multiRegionId != null && message.hasOwnProperty("multiRegionId")) - if (!$util.isString(message.multiRegionId)) - return "multiRegionId: string expected"; - return null; - }; - - /** - * Creates a MultiRegionSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Service.MultiRegionSettings} MultiRegionSettings - */ - MultiRegionSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Service.MultiRegionSettings) - return object; - var message = new $root.google.cloud.run.v2.Service.MultiRegionSettings(); - if (object.regions) { - if (!Array.isArray(object.regions)) - throw TypeError(".google.cloud.run.v2.Service.MultiRegionSettings.regions: array expected"); - message.regions = []; - for (var i = 0; i < object.regions.length; ++i) - message.regions[i] = String(object.regions[i]); - } - if (object.multiRegionId != null) - message.multiRegionId = String(object.multiRegionId); - return message; - }; - - /** - * Creates a plain object from a MultiRegionSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {google.cloud.run.v2.Service.MultiRegionSettings} message MultiRegionSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MultiRegionSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.regions = []; - if (options.defaults) - object.multiRegionId = ""; - if (message.regions && message.regions.length) { - object.regions = []; - for (var j = 0; j < message.regions.length; ++j) - object.regions[j] = message.regions[j]; - } - if (message.multiRegionId != null && message.hasOwnProperty("multiRegionId")) - object.multiRegionId = message.multiRegionId; - return object; - }; - - /** - * Converts this MultiRegionSettings to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @instance - * @returns {Object.} JSON object - */ - MultiRegionSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MultiRegionSettings - * @function getTypeUrl - * @memberof google.cloud.run.v2.Service.MultiRegionSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MultiRegionSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.Service.MultiRegionSettings"; - }; - - return MultiRegionSettings; - })(); - - return Service; - })(); - - v2.TrafficTarget = (function() { - - /** - * Properties of a TrafficTarget. - * @memberof google.cloud.run.v2 - * @interface ITrafficTarget - * @property {google.cloud.run.v2.TrafficTargetAllocationType|null} [type] TrafficTarget type - * @property {string|null} [revision] TrafficTarget revision - * @property {number|null} [percent] TrafficTarget percent - * @property {string|null} [tag] TrafficTarget tag - */ - - /** - * Constructs a new TrafficTarget. - * @memberof google.cloud.run.v2 - * @classdesc Represents a TrafficTarget. - * @implements ITrafficTarget - * @constructor - * @param {google.cloud.run.v2.ITrafficTarget=} [properties] Properties to set - */ - function TrafficTarget(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrafficTarget type. - * @member {google.cloud.run.v2.TrafficTargetAllocationType} type - * @memberof google.cloud.run.v2.TrafficTarget - * @instance - */ - TrafficTarget.prototype.type = 0; - - /** - * TrafficTarget revision. - * @member {string} revision - * @memberof google.cloud.run.v2.TrafficTarget - * @instance - */ - TrafficTarget.prototype.revision = ""; - - /** - * TrafficTarget percent. - * @member {number} percent - * @memberof google.cloud.run.v2.TrafficTarget - * @instance - */ - TrafficTarget.prototype.percent = 0; - - /** - * TrafficTarget tag. - * @member {string} tag - * @memberof google.cloud.run.v2.TrafficTarget - * @instance - */ - TrafficTarget.prototype.tag = ""; - - /** - * Creates a new TrafficTarget instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {google.cloud.run.v2.ITrafficTarget=} [properties] Properties to set - * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget instance - */ - TrafficTarget.create = function create(properties) { - return new TrafficTarget(properties); - }; - - /** - * Encodes the specified TrafficTarget message. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {google.cloud.run.v2.ITrafficTarget} message TrafficTarget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrafficTarget.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.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); - if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tag); - return writer; - }; - - /** - * Encodes the specified TrafficTarget message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTarget.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {google.cloud.run.v2.ITrafficTarget} message TrafficTarget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrafficTarget.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrafficTarget message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrafficTarget.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TrafficTarget(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.revision = reader.string(); - break; - } - case 3: { - message.percent = reader.int32(); - break; - } - case 4: { - message.tag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrafficTarget message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrafficTarget.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrafficTarget message. - * @function verify - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrafficTarget.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.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.percent != null && message.hasOwnProperty("percent")) - if (!$util.isInteger(message.percent)) - return "percent: integer expected"; - if (message.tag != null && message.hasOwnProperty("tag")) - if (!$util.isString(message.tag)) - return "tag: string expected"; - return null; - }; - - /** - * Creates a TrafficTarget message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.TrafficTarget} TrafficTarget - */ - TrafficTarget.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.TrafficTarget) - return object; - var message = new $root.google.cloud.run.v2.TrafficTarget(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST": - case 1: - message.type = 1; - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION": - case 2: - message.type = 2; - break; - } - if (object.revision != null) - message.revision = String(object.revision); - if (object.percent != null) - message.percent = object.percent | 0; - if (object.tag != null) - message.tag = String(object.tag); - return message; - }; - - /** - * Creates a plain object from a TrafficTarget message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {google.cloud.run.v2.TrafficTarget} message TrafficTarget - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrafficTarget.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED" : 0; - object.revision = ""; - object.percent = 0; - object.tag = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] : message.type; - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.percent != null && message.hasOwnProperty("percent")) - object.percent = message.percent; - if (message.tag != null && message.hasOwnProperty("tag")) - object.tag = message.tag; - return object; - }; - - /** - * Converts this TrafficTarget to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.TrafficTarget - * @instance - * @returns {Object.} JSON object - */ - TrafficTarget.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrafficTarget - * @function getTypeUrl - * @memberof google.cloud.run.v2.TrafficTarget - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrafficTarget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.TrafficTarget"; - }; - - return TrafficTarget; - })(); - - v2.TrafficTargetStatus = (function() { - - /** - * Properties of a TrafficTargetStatus. - * @memberof google.cloud.run.v2 - * @interface ITrafficTargetStatus - * @property {google.cloud.run.v2.TrafficTargetAllocationType|null} [type] TrafficTargetStatus type - * @property {string|null} [revision] TrafficTargetStatus revision - * @property {number|null} [percent] TrafficTargetStatus percent - * @property {string|null} [tag] TrafficTargetStatus tag - * @property {string|null} [uri] TrafficTargetStatus uri - */ - - /** - * Constructs a new TrafficTargetStatus. - * @memberof google.cloud.run.v2 - * @classdesc Represents a TrafficTargetStatus. - * @implements ITrafficTargetStatus - * @constructor - * @param {google.cloud.run.v2.ITrafficTargetStatus=} [properties] Properties to set - */ - function TrafficTargetStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrafficTargetStatus type. - * @member {google.cloud.run.v2.TrafficTargetAllocationType} type - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - */ - TrafficTargetStatus.prototype.type = 0; - - /** - * TrafficTargetStatus revision. - * @member {string} revision - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - */ - TrafficTargetStatus.prototype.revision = ""; - - /** - * TrafficTargetStatus percent. - * @member {number} percent - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - */ - TrafficTargetStatus.prototype.percent = 0; - - /** - * TrafficTargetStatus tag. - * @member {string} tag - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - */ - TrafficTargetStatus.prototype.tag = ""; - - /** - * TrafficTargetStatus uri. - * @member {string} uri - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - */ - TrafficTargetStatus.prototype.uri = ""; - - /** - * Creates a new TrafficTargetStatus instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {google.cloud.run.v2.ITrafficTargetStatus=} [properties] Properties to set - * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus instance - */ - TrafficTargetStatus.create = function create(properties) { - return new TrafficTargetStatus(properties); - }; - - /** - * Encodes the specified TrafficTargetStatus message. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {google.cloud.run.v2.ITrafficTargetStatus} message TrafficTargetStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrafficTargetStatus.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.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revision); - if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.percent); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tag); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.uri); - return writer; - }; - - /** - * Encodes the specified TrafficTargetStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.TrafficTargetStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {google.cloud.run.v2.ITrafficTargetStatus} message TrafficTargetStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrafficTargetStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrafficTargetStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrafficTargetStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TrafficTargetStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.revision = reader.string(); - break; - } - case 3: { - message.percent = reader.int32(); - break; - } - case 4: { - message.tag = reader.string(); - break; - } - case 5: { - message.uri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrafficTargetStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrafficTargetStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrafficTargetStatus message. - * @function verify - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrafficTargetStatus.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.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.percent != null && message.hasOwnProperty("percent")) - if (!$util.isInteger(message.percent)) - return "percent: integer expected"; - if (message.tag != null && message.hasOwnProperty("tag")) - if (!$util.isString(message.tag)) - return "tag: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; - - /** - * Creates a TrafficTargetStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.TrafficTargetStatus} TrafficTargetStatus - */ - TrafficTargetStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.TrafficTargetStatus) - return object; - var message = new $root.google.cloud.run.v2.TrafficTargetStatus(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST": - case 1: - message.type = 1; - break; - case "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION": - case 2: - message.type = 2; - break; - } - if (object.revision != null) - message.revision = String(object.revision); - if (object.percent != null) - message.percent = object.percent | 0; - if (object.tag != null) - message.tag = String(object.tag); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; - - /** - * Creates a plain object from a TrafficTargetStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {google.cloud.run.v2.TrafficTargetStatus} message TrafficTargetStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrafficTargetStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED" : 0; - object.revision = ""; - object.percent = 0; - object.tag = ""; - object.uri = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] === undefined ? message.type : $root.google.cloud.run.v2.TrafficTargetAllocationType[message.type] : message.type; - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.percent != null && message.hasOwnProperty("percent")) - object.percent = message.percent; - if (message.tag != null && message.hasOwnProperty("tag")) - object.tag = message.tag; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; - - /** - * Converts this TrafficTargetStatus to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @instance - * @returns {Object.} JSON object - */ - TrafficTargetStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrafficTargetStatus - * @function getTypeUrl - * @memberof google.cloud.run.v2.TrafficTargetStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrafficTargetStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.TrafficTargetStatus"; - }; - - return TrafficTargetStatus; - })(); - - /** - * TrafficTargetAllocationType enum. - * @name google.cloud.run.v2.TrafficTargetAllocationType - * @enum {number} - * @property {number} TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED=0 TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED value - * @property {number} TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST=1 TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST value - * @property {number} TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION=2 TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION value - */ - v2.TrafficTargetAllocationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"] = 1; - values[valuesById[2] = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"] = 2; - return values; - })(); - - v2.Tasks = (function() { - - /** - * Constructs a new Tasks service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Tasks - * @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 Tasks(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Tasks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Tasks; - - /** - * Creates new Tasks service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.Tasks - * @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 {Tasks} RPC service. Useful where requests and/or responses are streamed. - */ - Tasks.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.Tasks|getTask}. - * @memberof google.cloud.run.v2.Tasks - * @typedef GetTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.Task} [response] Task - */ - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.run.v2.Tasks - * @instance - * @param {google.cloud.run.v2.IGetTaskRequest} request GetTaskRequest message or plain object - * @param {google.cloud.run.v2.Tasks.GetTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Tasks.prototype.getTask = function getTask(request, callback) { - return this.rpcCall(getTask, $root.google.cloud.run.v2.GetTaskRequest, $root.google.cloud.run.v2.Task, request, callback); - }, "name", { value: "GetTask" }); - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.run.v2.Tasks - * @instance - * @param {google.cloud.run.v2.IGetTaskRequest} request GetTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.Tasks|listTasks}. - * @memberof google.cloud.run.v2.Tasks - * @typedef ListTasksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListTasksResponse} [response] ListTasksResponse - */ - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.run.v2.Tasks - * @instance - * @param {google.cloud.run.v2.IListTasksRequest} request ListTasksRequest message or plain object - * @param {google.cloud.run.v2.Tasks.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Tasks.prototype.listTasks = function listTasks(request, callback) { - return this.rpcCall(listTasks, $root.google.cloud.run.v2.ListTasksRequest, $root.google.cloud.run.v2.ListTasksResponse, request, callback); - }, "name", { value: "ListTasks" }); - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.run.v2.Tasks - * @instance - * @param {google.cloud.run.v2.IListTasksRequest} request ListTasksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Tasks; - })(); - - v2.GetTaskRequest = (function() { - - /** - * Properties of a GetTaskRequest. - * @memberof google.cloud.run.v2 - * @interface IGetTaskRequest - * @property {string|null} [name] GetTaskRequest name - */ - - /** - * Constructs a new GetTaskRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetTaskRequest. - * @implements IGetTaskRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.name = ""; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetTaskRequest - * @static - * @param {google.cloud.run.v2.IGetTaskRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetTaskRequest} GetTaskRequest instance - */ - GetTaskRequest.create = function create(properties) { - return new GetTaskRequest(properties); - }; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.run.v2.GetTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetTaskRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.GetTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetTaskRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.GetTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetTaskRequest} GetTaskRequest - */ - GetTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetTaskRequest) - return object; - var message = new $root.google.cloud.run.v2.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.run.v2.GetTaskRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.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.run.v2.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.run.v2.GetTaskRequest"; - }; - - return GetTaskRequest; - })(); - - v2.ListTasksRequest = (function() { - - /** - * Properties of a ListTasksRequest. - * @memberof google.cloud.run.v2 - * @interface IListTasksRequest - * @property {string|null} [parent] ListTasksRequest parent - * @property {number|null} [pageSize] ListTasksRequest pageSize - * @property {string|null} [pageToken] ListTasksRequest pageToken - * @property {boolean|null} [showDeleted] ListTasksRequest showDeleted - */ - - /** - * Constructs a new ListTasksRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListTasksRequest. - * @implements IListTasksRequest - * @constructor - * @param {google.cloud.run.v2.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.run.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.parent = ""; - - /** - * ListTasksRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageSize = 0; - - /** - * ListTasksRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageToken = ""; - - /** - * ListTasksRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.showDeleted = false; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListTasksRequest - * @static - * @param {google.cloud.run.v2.IListTasksRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListTasksRequest} ListTasksRequest instance - */ - ListTasksRequest.create = function create(properties) { - return new ListTasksRequest(properties); - }; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.run.v2.ListTasksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListTasksRequest - * @static - * @param {google.cloud.run.v2.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.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListTasksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListTasksRequest - * @static - * @param {google.cloud.run.v2.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.run.v2.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListTasksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - 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.run.v2.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListTasksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListTasksRequest} ListTasksRequest - */ - ListTasksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListTasksRequest) - return object; - var message = new $root.google.cloud.run.v2.ListTasksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListTasksRequest - * @static - * @param {google.cloud.run.v2.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.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListTasksRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListTasksRequest"; - }; - - return ListTasksRequest; - })(); - - v2.ListTasksResponse = (function() { - - /** - * Properties of a ListTasksResponse. - * @memberof google.cloud.run.v2 - * @interface IListTasksResponse - * @property {Array.|null} [tasks] ListTasksResponse tasks - * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken - */ - - /** - * Constructs a new ListTasksResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListTasksResponse. - * @implements IListTasksResponse - * @constructor - * @param {google.cloud.run.v2.IListTasksResponse=} [properties] Properties to set - */ - function ListTasksResponse(properties) { - this.tasks = []; - if (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.run.v2.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.tasks = $util.emptyArray; - - /** - * ListTasksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListTasksResponse - * @static - * @param {google.cloud.run.v2.IListTasksResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListTasksResponse} ListTasksResponse instance - */ - ListTasksResponse.create = function create(properties) { - return new ListTasksResponse(properties); - }; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.run.v2.ListTasksResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListTasksResponse - * @static - * @param {google.cloud.run.v2.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.run.v2.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); - return writer; - }; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListTasksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListTasksResponse - * @static - * @param {google.cloud.run.v2.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.run.v2.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListTasksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.tasks && message.tasks.length)) - message.tasks = []; - message.tasks.push($root.google.cloud.run.v2.Task.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = 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.run.v2.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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.run.v2.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"; - return null; - }; - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListTasksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListTasksResponse} ListTasksResponse - */ - ListTasksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListTasksResponse) - return object; - var message = new $root.google.cloud.run.v2.ListTasksResponse(); - if (object.tasks) { - if (!Array.isArray(object.tasks)) - throw TypeError(".google.cloud.run.v2.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.run.v2.ListTasksResponse.tasks: object expected"); - message.tasks[i] = $root.google.cloud.run.v2.Task.fromObject(object.tasks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListTasksResponse - * @static - * @param {google.cloud.run.v2.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 = []; - 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.run.v2.Task.toObject(message.tasks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListTasksResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.ListTasksResponse"; - }; - - return ListTasksResponse; - })(); - - v2.Task = (function() { - - /** - * Properties of a Task. - * @memberof google.cloud.run.v2 - * @interface ITask - * @property {string|null} [name] Task name - * @property {string|null} [uid] Task uid - * @property {number|Long|null} [generation] Task generation - * @property {Object.|null} [labels] Task labels - * @property {Object.|null} [annotations] Task annotations - * @property {google.protobuf.ITimestamp|null} [createTime] Task createTime - * @property {google.protobuf.ITimestamp|null} [scheduledTime] Task scheduledTime - * @property {google.protobuf.ITimestamp|null} [startTime] Task startTime - * @property {google.protobuf.ITimestamp|null} [completionTime] Task completionTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Task updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Task deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] Task expireTime - * @property {string|null} [job] Task job - * @property {string|null} [execution] Task execution - * @property {Array.|null} [containers] Task containers - * @property {Array.|null} [volumes] Task volumes - * @property {number|null} [maxRetries] Task maxRetries - * @property {google.protobuf.IDuration|null} [timeout] Task timeout - * @property {string|null} [serviceAccount] Task serviceAccount - * @property {google.cloud.run.v2.ExecutionEnvironment|null} [executionEnvironment] Task executionEnvironment - * @property {boolean|null} [reconciling] Task reconciling - * @property {Array.|null} [conditions] Task conditions - * @property {number|Long|null} [observedGeneration] Task observedGeneration - * @property {number|null} [index] Task index - * @property {number|null} [retried] Task retried - * @property {google.cloud.run.v2.ITaskAttemptResult|null} [lastAttemptResult] Task lastAttemptResult - * @property {string|null} [encryptionKey] Task encryptionKey - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Task vpcAccess - * @property {string|null} [logUri] Task logUri - * @property {boolean|null} [satisfiesPzs] Task satisfiesPzs - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Task nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] Task gpuZonalRedundancyDisabled - * @property {string|null} [etag] Task etag - */ - - /** - * Constructs a new Task. - * @memberof google.cloud.run.v2 - * @classdesc Represents a Task. - * @implements ITask - * @constructor - * @param {google.cloud.run.v2.ITask=} [properties] Properties to set - */ - function Task(properties) { - this.labels = {}; - this.annotations = {}; - this.containers = []; - this.volumes = []; - this.conditions = []; - if (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.run.v2.Task - * @instance - */ - Task.prototype.name = ""; - - /** - * Task uid. - * @member {string} uid - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.uid = ""; - - /** - * Task generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Task labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.labels = $util.emptyObject; - - /** - * Task annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.annotations = $util.emptyObject; - - /** - * Task createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.createTime = null; - - /** - * Task scheduledTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduledTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.scheduledTime = null; - - /** - * Task startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.startTime = null; - - /** - * Task completionTime. - * @member {google.protobuf.ITimestamp|null|undefined} completionTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.completionTime = null; - - /** - * Task updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.updateTime = null; - - /** - * Task deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.deleteTime = null; - - /** - * Task expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.expireTime = null; - - /** - * Task job. - * @member {string} job - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.job = ""; - - /** - * Task execution. - * @member {string} execution - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.execution = ""; - - /** - * Task containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.containers = $util.emptyArray; - - /** - * Task volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.volumes = $util.emptyArray; - - /** - * Task maxRetries. - * @member {number} maxRetries - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.maxRetries = 0; - - /** - * Task timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.timeout = null; - - /** - * Task serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.serviceAccount = ""; - - /** - * Task executionEnvironment. - * @member {google.cloud.run.v2.ExecutionEnvironment} executionEnvironment - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.executionEnvironment = 0; - - /** - * Task reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.reconciling = false; - - /** - * Task conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.conditions = $util.emptyArray; - - /** - * Task observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Task index. - * @member {number} index - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.index = 0; - - /** - * Task retried. - * @member {number} retried - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.retried = 0; - - /** - * Task lastAttemptResult. - * @member {google.cloud.run.v2.ITaskAttemptResult|null|undefined} lastAttemptResult - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.lastAttemptResult = null; - - /** - * Task encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.encryptionKey = ""; - - /** - * Task vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.vpcAccess = null; - - /** - * Task logUri. - * @member {string} logUri - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.logUri = ""; - - /** - * Task satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.satisfiesPzs = false; - - /** - * Task nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.nodeSelector = null; - - /** - * Task gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.gpuZonalRedundancyDisabled = null; - - /** - * Task etag. - * @member {string} etag - * @memberof google.cloud.run.v2.Task - * @instance - */ - Task.prototype.etag = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Task.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Task instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.Task - * @static - * @param {google.cloud.run.v2.ITask=} [properties] Properties to set - * @returns {google.cloud.run.v2.Task} Task instance - */ - Task.create = function create(properties) { - return new Task(properties); - }; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.run.v2.Task.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.Task - * @static - * @param {google.cloud.run.v2.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.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime")) - $root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.job); - if (message.execution != null && Object.hasOwnProperty.call(message, "execution")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.execution); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.maxRetries != null && Object.hasOwnProperty.call(message, "maxRetries")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.maxRetries); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.serviceAccount); - if (message.executionEnvironment != null && Object.hasOwnProperty.call(message, "executionEnvironment")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.executionEnvironment); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 21, wireType 0 =*/168).bool(message.reconciling); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 23, wireType 0 =*/184).int64(message.observedGeneration); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.index); - if (message.retried != null && Object.hasOwnProperty.call(message, "retried")) - writer.uint32(/* id 25, wireType 0 =*/200).int32(message.retried); - if (message.lastAttemptResult != null && Object.hasOwnProperty.call(message, "lastAttemptResult")) - $root.google.cloud.run.v2.TaskAttemptResult.encode(message.lastAttemptResult, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 28, wireType 2 =*/226).string(message.encryptionKey); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) - writer.uint32(/* id 32, wireType 2 =*/258).string(message.logUri); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.satisfiesPzs); - if (message.scheduledTime != null && Object.hasOwnProperty.call(message, "scheduledTime")) - $root.google.protobuf.Timestamp.encode(message.scheduledTime, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 37, wireType 0 =*/296).bool(message.gpuZonalRedundancyDisabled); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.run.v2.Task.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.Task - * @static - * @param {google.cloud.run.v2.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.run.v2.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Task(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.generation = reader.int64(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 5: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 34: { - message.scheduledTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 27: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.job = reader.string(); - break; - } - case 13: { - message.execution = reader.string(); - break; - } - case 14: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 15: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 16: { - message.maxRetries = reader.int32(); - break; - } - case 17: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 18: { - message.serviceAccount = reader.string(); - break; - } - case 20: { - message.executionEnvironment = reader.int32(); - break; - } - case 21: { - message.reconciling = reader.bool(); - break; - } - case 22: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 23: { - message.observedGeneration = reader.int64(); - break; - } - case 24: { - message.index = reader.int32(); - break; - } - case 25: { - message.retried = reader.int32(); - break; - } - case 26: { - message.lastAttemptResult = $root.google.cloud.run.v2.TaskAttemptResult.decode(reader, reader.uint32()); - break; - } - case 28: { - message.encryptionKey = reader.string(); - break; - } - case 29: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 32: { - message.logUri = reader.string(); - break; - } - case 33: { - message.satisfiesPzs = reader.bool(); - break; - } - case 36: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 37: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - case 99: { - message.etag = reader.string(); - 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.run.v2.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.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.run.v2.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"; - var properties = {}; - 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.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.scheduledTime != null && message.hasOwnProperty("scheduledTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduledTime); - if (error) - return "scheduledTime." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.completionTime != null && message.hasOwnProperty("completionTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.completionTime); - if (error) - return "completionTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.job != null && message.hasOwnProperty("job")) - if (!$util.isString(message.job)) - return "job: string expected"; - if (message.execution != null && message.hasOwnProperty("execution")) - if (!$util.isString(message.execution)) - return "execution: string expected"; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) - if (!$util.isInteger(message.maxRetries)) - return "maxRetries: integer expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - switch (message.executionEnvironment) { - default: - return "executionEnvironment: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.retried != null && message.hasOwnProperty("retried")) - if (!$util.isInteger(message.retried)) - return "retried: integer expected"; - if (message.lastAttemptResult != null && message.hasOwnProperty("lastAttemptResult")) { - var error = $root.google.cloud.run.v2.TaskAttemptResult.verify(message.lastAttemptResult); - if (error) - return "lastAttemptResult." + error; - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.logUri != null && message.hasOwnProperty("logUri")) - if (!$util.isString(message.logUri)) - return "logUri: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.Task - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.Task} Task - */ - Task.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.Task) - return object; - var message = new $root.google.cloud.run.v2.Task(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.Task.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.Task.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.scheduledTime != null) { - if (typeof object.scheduledTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.scheduledTime: object expected"); - message.scheduledTime = $root.google.protobuf.Timestamp.fromObject(object.scheduledTime); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.completionTime != null) { - if (typeof object.completionTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.completionTime: object expected"); - message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.Task.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.job != null) - message.job = String(object.job); - if (object.execution != null) - message.execution = String(object.execution); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.Task.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.Task.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.Task.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.Task.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - if (object.maxRetries != null) - message.maxRetries = object.maxRetries | 0; - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.run.v2.Task.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - switch (object.executionEnvironment) { - default: - if (typeof object.executionEnvironment === "number") { - message.executionEnvironment = object.executionEnvironment; - break; - } - break; - case "EXECUTION_ENVIRONMENT_UNSPECIFIED": - case 0: - message.executionEnvironment = 0; - break; - case "EXECUTION_ENVIRONMENT_GEN1": - case 1: - message.executionEnvironment = 1; - break; - case "EXECUTION_ENVIRONMENT_GEN2": - case 2: - message.executionEnvironment = 2; - break; - } - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.Task.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.Task.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.index != null) - message.index = object.index | 0; - if (object.retried != null) - message.retried = object.retried | 0; - if (object.lastAttemptResult != null) { - if (typeof object.lastAttemptResult !== "object") - throw TypeError(".google.cloud.run.v2.Task.lastAttemptResult: object expected"); - message.lastAttemptResult = $root.google.cloud.run.v2.TaskAttemptResult.fromObject(object.lastAttemptResult); - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.Task.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.logUri != null) - message.logUri = String(object.logUri); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.Task.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.Task - * @static - * @param {google.cloud.run.v2.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.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - object.conditions = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.completionTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.job = ""; - object.execution = ""; - object.maxRetries = 0; - object.timeout = null; - object.serviceAccount = ""; - object.executionEnvironment = options.enums === String ? "EXECUTION_ENVIRONMENT_UNSPECIFIED" : 0; - object.reconciling = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.index = 0; - object.retried = 0; - object.lastAttemptResult = null; - object.startTime = null; - object.encryptionKey = ""; - object.vpcAccess = null; - object.logUri = ""; - object.satisfiesPzs = false; - object.scheduledTime = null; - object.nodeSelector = null; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.completionTime != null && message.hasOwnProperty("completionTime")) - object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.job != null && message.hasOwnProperty("job")) - object.job = message.job; - if (message.execution != null && message.hasOwnProperty("execution")) - object.execution = message.execution; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) - object.maxRetries = message.maxRetries; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.executionEnvironment != null && message.hasOwnProperty("executionEnvironment")) - object.executionEnvironment = options.enums === String ? $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] === undefined ? message.executionEnvironment : $root.google.cloud.run.v2.ExecutionEnvironment[message.executionEnvironment] : message.executionEnvironment; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.retried != null && message.hasOwnProperty("retried")) - object.retried = message.retried; - if (message.lastAttemptResult != null && message.hasOwnProperty("lastAttemptResult")) - object.lastAttemptResult = $root.google.cloud.run.v2.TaskAttemptResult.toObject(message.lastAttemptResult, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.logUri != null && message.hasOwnProperty("logUri")) - object.logUri = message.logUri; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.scheduledTime != null && message.hasOwnProperty("scheduledTime")) - object.scheduledTime = $root.google.protobuf.Timestamp.toObject(message.scheduledTime, options); - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this Task to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.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.run.v2.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.run.v2.Task"; - }; - - return Task; - })(); - - v2.TaskAttemptResult = (function() { - - /** - * Properties of a TaskAttemptResult. - * @memberof google.cloud.run.v2 - * @interface ITaskAttemptResult - * @property {google.rpc.IStatus|null} [status] TaskAttemptResult status - * @property {number|null} [exitCode] TaskAttemptResult exitCode - * @property {number|null} [termSignal] TaskAttemptResult termSignal - */ - - /** - * Constructs a new TaskAttemptResult. - * @memberof google.cloud.run.v2 - * @classdesc Represents a TaskAttemptResult. - * @implements ITaskAttemptResult - * @constructor - * @param {google.cloud.run.v2.ITaskAttemptResult=} [properties] Properties to set - */ - function TaskAttemptResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskAttemptResult status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.cloud.run.v2.TaskAttemptResult - * @instance - */ - TaskAttemptResult.prototype.status = null; - - /** - * TaskAttemptResult exitCode. - * @member {number} exitCode - * @memberof google.cloud.run.v2.TaskAttemptResult - * @instance - */ - TaskAttemptResult.prototype.exitCode = 0; - - /** - * TaskAttemptResult termSignal. - * @member {number} termSignal - * @memberof google.cloud.run.v2.TaskAttemptResult - * @instance - */ - TaskAttemptResult.prototype.termSignal = 0; - - /** - * Creates a new TaskAttemptResult instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {google.cloud.run.v2.ITaskAttemptResult=} [properties] Properties to set - * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult instance - */ - TaskAttemptResult.create = function create(properties) { - return new TaskAttemptResult(properties); - }; - - /** - * Encodes the specified TaskAttemptResult message. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {google.cloud.run.v2.ITaskAttemptResult} message TaskAttemptResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskAttemptResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.exitCode); - if (message.termSignal != null && Object.hasOwnProperty.call(message, "termSignal")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.termSignal); - return writer; - }; - - /** - * Encodes the specified TaskAttemptResult message, length delimited. Does not implicitly {@link google.cloud.run.v2.TaskAttemptResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {google.cloud.run.v2.ITaskAttemptResult} message TaskAttemptResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskAttemptResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskAttemptResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskAttemptResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.TaskAttemptResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 2: { - message.exitCode = reader.int32(); - break; - } - case 3: { - message.termSignal = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskAttemptResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskAttemptResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskAttemptResult message. - * @function verify - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskAttemptResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - if (!$util.isInteger(message.exitCode)) - return "exitCode: integer expected"; - if (message.termSignal != null && message.hasOwnProperty("termSignal")) - if (!$util.isInteger(message.termSignal)) - return "termSignal: integer expected"; - return null; - }; - - /** - * Creates a TaskAttemptResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.TaskAttemptResult} TaskAttemptResult - */ - TaskAttemptResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.TaskAttemptResult) - return object; - var message = new $root.google.cloud.run.v2.TaskAttemptResult(); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.run.v2.TaskAttemptResult.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.exitCode != null) - message.exitCode = object.exitCode | 0; - if (object.termSignal != null) - message.termSignal = object.termSignal | 0; - return message; - }; - - /** - * Creates a plain object from a TaskAttemptResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {google.cloud.run.v2.TaskAttemptResult} message TaskAttemptResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskAttemptResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.status = null; - object.exitCode = 0; - object.termSignal = 0; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - object.exitCode = message.exitCode; - if (message.termSignal != null && message.hasOwnProperty("termSignal")) - object.termSignal = message.termSignal; - return object; - }; - - /** - * Converts this TaskAttemptResult to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.TaskAttemptResult - * @instance - * @returns {Object.} JSON object - */ - TaskAttemptResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskAttemptResult - * @function getTypeUrl - * @memberof google.cloud.run.v2.TaskAttemptResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskAttemptResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.TaskAttemptResult"; - }; - - return TaskAttemptResult; - })(); - - v2.WorkerPools = (function() { - - /** - * Constructs a new WorkerPools service. - * @memberof google.cloud.run.v2 - * @classdesc Represents a WorkerPools - * @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 WorkerPools(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (WorkerPools.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WorkerPools; - - /** - * Creates new WorkerPools service using the specified rpc implementation. - * @function create - * @memberof google.cloud.run.v2.WorkerPools - * @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 {WorkerPools} RPC service. Useful where requests and/or responses are streamed. - */ - WorkerPools.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|createWorkerPool}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef CreateWorkerPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateWorkerPool. - * @function createWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} request CreateWorkerPoolRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.CreateWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.createWorkerPool = function createWorkerPool(request, callback) { - return this.rpcCall(createWorkerPool, $root.google.cloud.run.v2.CreateWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateWorkerPool" }); - - /** - * Calls CreateWorkerPool. - * @function createWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} request CreateWorkerPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|getWorkerPool}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef GetWorkerPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.WorkerPool} [response] WorkerPool - */ - - /** - * Calls GetWorkerPool. - * @function getWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IGetWorkerPoolRequest} request GetWorkerPoolRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.GetWorkerPoolCallback} callback Node-style callback called with the error, if any, and WorkerPool - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.getWorkerPool = function getWorkerPool(request, callback) { - return this.rpcCall(getWorkerPool, $root.google.cloud.run.v2.GetWorkerPoolRequest, $root.google.cloud.run.v2.WorkerPool, request, callback); - }, "name", { value: "GetWorkerPool" }); - - /** - * Calls GetWorkerPool. - * @function getWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IGetWorkerPoolRequest} request GetWorkerPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|listWorkerPools}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef ListWorkerPoolsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.run.v2.ListWorkerPoolsResponse} [response] ListWorkerPoolsResponse - */ - - /** - * Calls ListWorkerPools. - * @function listWorkerPools - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IListWorkerPoolsRequest} request ListWorkerPoolsRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.ListWorkerPoolsCallback} callback Node-style callback called with the error, if any, and ListWorkerPoolsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.listWorkerPools = function listWorkerPools(request, callback) { - return this.rpcCall(listWorkerPools, $root.google.cloud.run.v2.ListWorkerPoolsRequest, $root.google.cloud.run.v2.ListWorkerPoolsResponse, request, callback); - }, "name", { value: "ListWorkerPools" }); - - /** - * Calls ListWorkerPools. - * @function listWorkerPools - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IListWorkerPoolsRequest} request ListWorkerPoolsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|updateWorkerPool}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef UpdateWorkerPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateWorkerPool. - * @function updateWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} request UpdateWorkerPoolRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.UpdateWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.updateWorkerPool = function updateWorkerPool(request, callback) { - return this.rpcCall(updateWorkerPool, $root.google.cloud.run.v2.UpdateWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateWorkerPool" }); - - /** - * Calls UpdateWorkerPool. - * @function updateWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} request UpdateWorkerPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|deleteWorkerPool}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef DeleteWorkerPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteWorkerPool. - * @function deleteWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} request DeleteWorkerPoolRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.DeleteWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.deleteWorkerPool = function deleteWorkerPool(request, callback) { - return this.rpcCall(deleteWorkerPool, $root.google.cloud.run.v2.DeleteWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteWorkerPool" }); - - /** - * Calls DeleteWorkerPool. - * @function deleteWorkerPool - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} request DeleteWorkerPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|getIamPolicy}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|setIamPolicy}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.run.v2.WorkerPools|testIamPermissions}. - * @memberof google.cloud.run.v2.WorkerPools - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.run.v2.WorkerPools.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkerPools.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.run.v2.WorkerPools - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return WorkerPools; - })(); - - v2.CreateWorkerPoolRequest = (function() { - - /** - * Properties of a CreateWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @interface ICreateWorkerPoolRequest - * @property {string|null} [parent] CreateWorkerPoolRequest parent - * @property {google.cloud.run.v2.IWorkerPool|null} [workerPool] CreateWorkerPoolRequest workerPool - * @property {string|null} [workerPoolId] CreateWorkerPoolRequest workerPoolId - * @property {boolean|null} [validateOnly] CreateWorkerPoolRequest validateOnly - */ - - /** - * Constructs a new CreateWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a CreateWorkerPoolRequest. - * @implements ICreateWorkerPoolRequest - * @constructor - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest=} [properties] Properties to set - */ - function CreateWorkerPoolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateWorkerPoolRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @instance - */ - CreateWorkerPoolRequest.prototype.parent = ""; - - /** - * CreateWorkerPoolRequest workerPool. - * @member {google.cloud.run.v2.IWorkerPool|null|undefined} workerPool - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @instance - */ - CreateWorkerPoolRequest.prototype.workerPool = null; - - /** - * CreateWorkerPoolRequest workerPoolId. - * @member {string} workerPoolId - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @instance - */ - CreateWorkerPoolRequest.prototype.workerPoolId = ""; - - /** - * CreateWorkerPoolRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @instance - */ - CreateWorkerPoolRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateWorkerPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest instance - */ - CreateWorkerPoolRequest.create = function create(properties) { - return new CreateWorkerPoolRequest(properties); - }; - - /** - * Encodes the specified CreateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateWorkerPoolRequest.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.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - $root.google.cloud.run.v2.WorkerPool.encode(message.workerPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.workerPoolId != null && Object.hasOwnProperty.call(message, "workerPoolId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.workerPoolId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateWorkerPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateWorkerPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateWorkerPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.workerPool = $root.google.cloud.run.v2.WorkerPool.decode(reader, reader.uint32()); - break; - } - case 3: { - message.workerPoolId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateWorkerPoolRequest message. - * @function verify - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateWorkerPoolRequest.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.workerPool != null && message.hasOwnProperty("workerPool")) { - var error = $root.google.cloud.run.v2.WorkerPool.verify(message.workerPool); - if (error) - return "workerPool." + error; - } - if (message.workerPoolId != null && message.hasOwnProperty("workerPoolId")) - if (!$util.isString(message.workerPoolId)) - return "workerPoolId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.CreateWorkerPoolRequest} CreateWorkerPoolRequest - */ - CreateWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.CreateWorkerPoolRequest) - return object; - var message = new $root.google.cloud.run.v2.CreateWorkerPoolRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.workerPool != null) { - if (typeof object.workerPool !== "object") - throw TypeError(".google.cloud.run.v2.CreateWorkerPoolRequest.workerPool: object expected"); - message.workerPool = $root.google.cloud.run.v2.WorkerPool.fromObject(object.workerPool); - } - if (object.workerPoolId != null) - message.workerPoolId = String(object.workerPoolId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateWorkerPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.CreateWorkerPoolRequest} message CreateWorkerPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateWorkerPoolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.workerPool = null; - object.workerPoolId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - object.workerPool = $root.google.cloud.run.v2.WorkerPool.toObject(message.workerPool, options); - if (message.workerPoolId != null && message.hasOwnProperty("workerPoolId")) - object.workerPoolId = message.workerPoolId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateWorkerPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @instance - * @returns {Object.} JSON object - */ - CreateWorkerPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateWorkerPoolRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.CreateWorkerPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.CreateWorkerPoolRequest"; - }; - - return CreateWorkerPoolRequest; - })(); - - v2.UpdateWorkerPoolRequest = (function() { - - /** - * Properties of an UpdateWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @interface IUpdateWorkerPoolRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkerPoolRequest updateMask - * @property {google.cloud.run.v2.IWorkerPool|null} [workerPool] UpdateWorkerPoolRequest workerPool - * @property {boolean|null} [validateOnly] UpdateWorkerPoolRequest validateOnly - * @property {boolean|null} [allowMissing] UpdateWorkerPoolRequest allowMissing - * @property {boolean|null} [forceNewRevision] UpdateWorkerPoolRequest forceNewRevision - */ - - /** - * Constructs a new UpdateWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents an UpdateWorkerPoolRequest. - * @implements IUpdateWorkerPoolRequest - * @constructor - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest=} [properties] Properties to set - */ - function UpdateWorkerPoolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateWorkerPoolRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - */ - UpdateWorkerPoolRequest.prototype.updateMask = null; - - /** - * UpdateWorkerPoolRequest workerPool. - * @member {google.cloud.run.v2.IWorkerPool|null|undefined} workerPool - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - */ - UpdateWorkerPoolRequest.prototype.workerPool = null; - - /** - * UpdateWorkerPoolRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - */ - UpdateWorkerPoolRequest.prototype.validateOnly = false; - - /** - * UpdateWorkerPoolRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - */ - UpdateWorkerPoolRequest.prototype.allowMissing = false; - - /** - * UpdateWorkerPoolRequest forceNewRevision. - * @member {boolean} forceNewRevision - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - */ - UpdateWorkerPoolRequest.prototype.forceNewRevision = false; - - /** - * Creates a new UpdateWorkerPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest instance - */ - UpdateWorkerPoolRequest.create = function create(properties) { - return new UpdateWorkerPoolRequest(properties); - }; - - /** - * Encodes the specified UpdateWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateWorkerPoolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - $root.google.cloud.run.v2.WorkerPool.encode(message.workerPool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); - if (message.forceNewRevision != null && Object.hasOwnProperty.call(message, "forceNewRevision")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.forceNewRevision); - return writer; - }; - - /** - * Encodes the specified UpdateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.UpdateWorkerPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateWorkerPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.UpdateWorkerPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 1: { - message.workerPool = $root.google.cloud.run.v2.WorkerPool.decode(reader, reader.uint32()); - break; - } - case 3: { - message.validateOnly = reader.bool(); - break; - } - case 4: { - message.allowMissing = reader.bool(); - break; - } - case 5: { - message.forceNewRevision = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateWorkerPoolRequest message. - * @function verify - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateWorkerPoolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.workerPool != null && message.hasOwnProperty("workerPool")) { - var error = $root.google.cloud.run.v2.WorkerPool.verify(message.workerPool); - if (error) - return "workerPool." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - if (message.forceNewRevision != null && message.hasOwnProperty("forceNewRevision")) - if (typeof message.forceNewRevision !== "boolean") - return "forceNewRevision: boolean expected"; - return null; - }; - - /** - * Creates an UpdateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest - */ - UpdateWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.UpdateWorkerPoolRequest) - return object; - var message = new $root.google.cloud.run.v2.UpdateWorkerPoolRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.run.v2.UpdateWorkerPoolRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.workerPool != null) { - if (typeof object.workerPool !== "object") - throw TypeError(".google.cloud.run.v2.UpdateWorkerPoolRequest.workerPool: object expected"); - message.workerPool = $root.google.cloud.run.v2.WorkerPool.fromObject(object.workerPool); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - if (object.forceNewRevision != null) - message.forceNewRevision = Boolean(object.forceNewRevision); - return message; - }; - - /** - * Creates a plain object from an UpdateWorkerPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.UpdateWorkerPoolRequest} message UpdateWorkerPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateWorkerPoolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.workerPool = null; - object.updateMask = null; - object.validateOnly = false; - object.allowMissing = false; - object.forceNewRevision = false; - } - if (message.workerPool != null && message.hasOwnProperty("workerPool")) - object.workerPool = $root.google.cloud.run.v2.WorkerPool.toObject(message.workerPool, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - if (message.forceNewRevision != null && message.hasOwnProperty("forceNewRevision")) - object.forceNewRevision = message.forceNewRevision; - return object; - }; - - /** - * Converts this UpdateWorkerPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateWorkerPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateWorkerPoolRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.UpdateWorkerPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.UpdateWorkerPoolRequest"; - }; - - return UpdateWorkerPoolRequest; - })(); - - v2.ListWorkerPoolsRequest = (function() { - - /** - * Properties of a ListWorkerPoolsRequest. - * @memberof google.cloud.run.v2 - * @interface IListWorkerPoolsRequest - * @property {string|null} [parent] ListWorkerPoolsRequest parent - * @property {number|null} [pageSize] ListWorkerPoolsRequest pageSize - * @property {string|null} [pageToken] ListWorkerPoolsRequest pageToken - * @property {boolean|null} [showDeleted] ListWorkerPoolsRequest showDeleted - */ - - /** - * Constructs a new ListWorkerPoolsRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListWorkerPoolsRequest. - * @implements IListWorkerPoolsRequest - * @constructor - * @param {google.cloud.run.v2.IListWorkerPoolsRequest=} [properties] Properties to set - */ - function ListWorkerPoolsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListWorkerPoolsRequest parent. - * @member {string} parent - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @instance - */ - ListWorkerPoolsRequest.prototype.parent = ""; - - /** - * ListWorkerPoolsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @instance - */ - ListWorkerPoolsRequest.prototype.pageSize = 0; - - /** - * ListWorkerPoolsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @instance - */ - ListWorkerPoolsRequest.prototype.pageToken = ""; - - /** - * ListWorkerPoolsRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @instance - */ - ListWorkerPoolsRequest.prototype.showDeleted = false; - - /** - * Creates a new ListWorkerPoolsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest instance - */ - ListWorkerPoolsRequest.create = function create(properties) { - return new ListWorkerPoolsRequest(properties); - }; - - /** - * Encodes the specified ListWorkerPoolsRequest message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkerPoolsRequest.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.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); - return writer; - }; - - /** - * Encodes the specified ListWorkerPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkerPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkerPoolsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListWorkerPoolsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.showDeleted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkerPoolsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListWorkerPoolsRequest message. - * @function verify - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListWorkerPoolsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; - return null; - }; - - /** - * Creates a ListWorkerPoolsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListWorkerPoolsRequest} ListWorkerPoolsRequest - */ - ListWorkerPoolsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListWorkerPoolsRequest) - return object; - var message = new $root.google.cloud.run.v2.ListWorkerPoolsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); - return message; - }; - - /** - * Creates a plain object from a ListWorkerPoolsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {google.cloud.run.v2.ListWorkerPoolsRequest} message ListWorkerPoolsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListWorkerPoolsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.showDeleted = false; - } - 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.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; - return object; - }; - - /** - * Converts this ListWorkerPoolsRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @instance - * @returns {Object.} JSON object - */ - ListWorkerPoolsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListWorkerPoolsRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListWorkerPoolsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListWorkerPoolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListWorkerPoolsRequest"; - }; - - return ListWorkerPoolsRequest; - })(); - - v2.ListWorkerPoolsResponse = (function() { - - /** - * Properties of a ListWorkerPoolsResponse. - * @memberof google.cloud.run.v2 - * @interface IListWorkerPoolsResponse - * @property {Array.|null} [workerPools] ListWorkerPoolsResponse workerPools - * @property {string|null} [nextPageToken] ListWorkerPoolsResponse nextPageToken - */ - - /** - * Constructs a new ListWorkerPoolsResponse. - * @memberof google.cloud.run.v2 - * @classdesc Represents a ListWorkerPoolsResponse. - * @implements IListWorkerPoolsResponse - * @constructor - * @param {google.cloud.run.v2.IListWorkerPoolsResponse=} [properties] Properties to set - */ - function ListWorkerPoolsResponse(properties) { - this.workerPools = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListWorkerPoolsResponse workerPools. - * @member {Array.} workerPools - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @instance - */ - ListWorkerPoolsResponse.prototype.workerPools = $util.emptyArray; - - /** - * ListWorkerPoolsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @instance - */ - ListWorkerPoolsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListWorkerPoolsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsResponse=} [properties] Properties to set - * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse instance - */ - ListWorkerPoolsResponse.create = function create(properties) { - return new ListWorkerPoolsResponse(properties); - }; - - /** - * Encodes the specified ListWorkerPoolsResponse message. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkerPoolsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.workerPools != null && message.workerPools.length) - for (var i = 0; i < message.workerPools.length; ++i) - $root.google.cloud.run.v2.WorkerPool.encode(message.workerPools[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 ListWorkerPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListWorkerPoolsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {google.cloud.run.v2.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkerPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkerPoolsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListWorkerPoolsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.workerPools && message.workerPools.length)) - message.workerPools = []; - message.workerPools.push($root.google.cloud.run.v2.WorkerPool.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkerPoolsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListWorkerPoolsResponse message. - * @function verify - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListWorkerPoolsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.workerPools != null && message.hasOwnProperty("workerPools")) { - if (!Array.isArray(message.workerPools)) - return "workerPools: array expected"; - for (var i = 0; i < message.workerPools.length; ++i) { - var error = $root.google.cloud.run.v2.WorkerPool.verify(message.workerPools[i]); - if (error) - return "workerPools." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListWorkerPoolsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.ListWorkerPoolsResponse} ListWorkerPoolsResponse - */ - ListWorkerPoolsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.ListWorkerPoolsResponse) - return object; - var message = new $root.google.cloud.run.v2.ListWorkerPoolsResponse(); - if (object.workerPools) { - if (!Array.isArray(object.workerPools)) - throw TypeError(".google.cloud.run.v2.ListWorkerPoolsResponse.workerPools: array expected"); - message.workerPools = []; - for (var i = 0; i < object.workerPools.length; ++i) { - if (typeof object.workerPools[i] !== "object") - throw TypeError(".google.cloud.run.v2.ListWorkerPoolsResponse.workerPools: object expected"); - message.workerPools[i] = $root.google.cloud.run.v2.WorkerPool.fromObject(object.workerPools[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListWorkerPoolsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {google.cloud.run.v2.ListWorkerPoolsResponse} message ListWorkerPoolsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListWorkerPoolsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.workerPools = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.workerPools && message.workerPools.length) { - object.workerPools = []; - for (var j = 0; j < message.workerPools.length; ++j) - object.workerPools[j] = $root.google.cloud.run.v2.WorkerPool.toObject(message.workerPools[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListWorkerPoolsResponse to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @instance - * @returns {Object.} JSON object - */ - ListWorkerPoolsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListWorkerPoolsResponse - * @function getTypeUrl - * @memberof google.cloud.run.v2.ListWorkerPoolsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListWorkerPoolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.ListWorkerPoolsResponse"; - }; - - return ListWorkerPoolsResponse; - })(); - - v2.GetWorkerPoolRequest = (function() { - - /** - * Properties of a GetWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @interface IGetWorkerPoolRequest - * @property {string|null} [name] GetWorkerPoolRequest name - */ - - /** - * Constructs a new GetWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a GetWorkerPoolRequest. - * @implements IGetWorkerPoolRequest - * @constructor - * @param {google.cloud.run.v2.IGetWorkerPoolRequest=} [properties] Properties to set - */ - function GetWorkerPoolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetWorkerPoolRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @instance - */ - GetWorkerPoolRequest.prototype.name = ""; - - /** - * Creates a new GetWorkerPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IGetWorkerPoolRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest instance - */ - GetWorkerPoolRequest.create = function create(properties) { - return new GetWorkerPoolRequest(properties); - }; - - /** - * Encodes the specified GetWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetWorkerPoolRequest.encode = function encode(message, writer) { - 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 GetWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetWorkerPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetWorkerPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetWorkerPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetWorkerPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetWorkerPoolRequest message. - * @function verify - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetWorkerPoolRequest.verify = function verify(message) { - if (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 GetWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.GetWorkerPoolRequest} GetWorkerPoolRequest - */ - GetWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.GetWorkerPoolRequest) - return object; - var message = new $root.google.cloud.run.v2.GetWorkerPoolRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetWorkerPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.GetWorkerPoolRequest} message GetWorkerPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetWorkerPoolRequest.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 GetWorkerPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @instance - * @returns {Object.} JSON object - */ - GetWorkerPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetWorkerPoolRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.GetWorkerPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.GetWorkerPoolRequest"; - }; - - return GetWorkerPoolRequest; - })(); - - v2.DeleteWorkerPoolRequest = (function() { - - /** - * Properties of a DeleteWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @interface IDeleteWorkerPoolRequest - * @property {string|null} [name] DeleteWorkerPoolRequest name - * @property {boolean|null} [validateOnly] DeleteWorkerPoolRequest validateOnly - * @property {string|null} [etag] DeleteWorkerPoolRequest etag - */ - - /** - * Constructs a new DeleteWorkerPoolRequest. - * @memberof google.cloud.run.v2 - * @classdesc Represents a DeleteWorkerPoolRequest. - * @implements IDeleteWorkerPoolRequest - * @constructor - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest=} [properties] Properties to set - */ - function DeleteWorkerPoolRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteWorkerPoolRequest name. - * @member {string} name - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @instance - */ - DeleteWorkerPoolRequest.prototype.name = ""; - - /** - * DeleteWorkerPoolRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @instance - */ - DeleteWorkerPoolRequest.prototype.validateOnly = false; - - /** - * DeleteWorkerPoolRequest etag. - * @member {string} etag - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @instance - */ - DeleteWorkerPoolRequest.prototype.etag = ""; - - /** - * Creates a new DeleteWorkerPoolRequest instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest=} [properties] Properties to set - * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest instance - */ - DeleteWorkerPoolRequest.create = function create(properties) { - return new DeleteWorkerPoolRequest(properties); - }; - - /** - * Encodes the specified DeleteWorkerPoolRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteWorkerPoolRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - return writer; - }; - - /** - * Encodes the specified DeleteWorkerPoolRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteWorkerPoolRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteWorkerPoolRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteWorkerPoolRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.validateOnly = reader.bool(); - break; - } - case 3: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteWorkerPoolRequest message. - * @function verify - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteWorkerPoolRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a DeleteWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest - */ - DeleteWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.DeleteWorkerPoolRequest) - return object; - var message = new $root.google.cloud.run.v2.DeleteWorkerPoolRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a DeleteWorkerPoolRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {google.cloud.run.v2.DeleteWorkerPoolRequest} message DeleteWorkerPoolRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteWorkerPoolRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.validateOnly = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this DeleteWorkerPoolRequest to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteWorkerPoolRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteWorkerPoolRequest - * @function getTypeUrl - * @memberof google.cloud.run.v2.DeleteWorkerPoolRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.DeleteWorkerPoolRequest"; - }; - - return DeleteWorkerPoolRequest; - })(); - - v2.WorkerPool = (function() { - - /** - * Properties of a WorkerPool. - * @memberof google.cloud.run.v2 - * @interface IWorkerPool - * @property {string|null} [name] WorkerPool name - * @property {string|null} [description] WorkerPool description - * @property {string|null} [uid] WorkerPool uid - * @property {number|Long|null} [generation] WorkerPool generation - * @property {Object.|null} [labels] WorkerPool labels - * @property {Object.|null} [annotations] WorkerPool annotations - * @property {google.protobuf.ITimestamp|null} [createTime] WorkerPool createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] WorkerPool updateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] WorkerPool deleteTime - * @property {google.protobuf.ITimestamp|null} [expireTime] WorkerPool expireTime - * @property {string|null} [creator] WorkerPool creator - * @property {string|null} [lastModifier] WorkerPool lastModifier - * @property {string|null} [client] WorkerPool client - * @property {string|null} [clientVersion] WorkerPool clientVersion - * @property {google.api.LaunchStage|null} [launchStage] WorkerPool launchStage - * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] WorkerPool binaryAuthorization - * @property {google.cloud.run.v2.IWorkerPoolRevisionTemplate|null} [template] WorkerPool template - * @property {Array.|null} [instanceSplits] WorkerPool instanceSplits - * @property {google.cloud.run.v2.IWorkerPoolScaling|null} [scaling] WorkerPool scaling - * @property {number|Long|null} [observedGeneration] WorkerPool observedGeneration - * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] WorkerPool terminalCondition - * @property {Array.|null} [conditions] WorkerPool conditions - * @property {string|null} [latestReadyRevision] WorkerPool latestReadyRevision - * @property {string|null} [latestCreatedRevision] WorkerPool latestCreatedRevision - * @property {Array.|null} [instanceSplitStatuses] WorkerPool instanceSplitStatuses - * @property {boolean|null} [threatDetectionEnabled] WorkerPool threatDetectionEnabled - * @property {Array.|null} [customAudiences] WorkerPool customAudiences - * @property {boolean|null} [satisfiesPzs] WorkerPool satisfiesPzs - * @property {boolean|null} [reconciling] WorkerPool reconciling - * @property {string|null} [etag] WorkerPool etag - */ - - /** - * Constructs a new WorkerPool. - * @memberof google.cloud.run.v2 - * @classdesc Represents a WorkerPool. - * @implements IWorkerPool - * @constructor - * @param {google.cloud.run.v2.IWorkerPool=} [properties] Properties to set - */ - function WorkerPool(properties) { - this.labels = {}; - this.annotations = {}; - this.instanceSplits = []; - this.conditions = []; - this.instanceSplitStatuses = []; - this.customAudiences = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkerPool name. - * @member {string} name - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.name = ""; - - /** - * WorkerPool description. - * @member {string} description - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.description = ""; - - /** - * WorkerPool uid. - * @member {string} uid - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.uid = ""; - - /** - * WorkerPool generation. - * @member {number|Long} generation - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * WorkerPool labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.labels = $util.emptyObject; - - /** - * WorkerPool annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.annotations = $util.emptyObject; - - /** - * WorkerPool createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.createTime = null; - - /** - * WorkerPool updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.updateTime = null; - - /** - * WorkerPool deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.deleteTime = null; - - /** - * WorkerPool expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.expireTime = null; - - /** - * WorkerPool creator. - * @member {string} creator - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.creator = ""; - - /** - * WorkerPool lastModifier. - * @member {string} lastModifier - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.lastModifier = ""; - - /** - * WorkerPool client. - * @member {string} client - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.client = ""; - - /** - * WorkerPool clientVersion. - * @member {string} clientVersion - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.clientVersion = ""; - - /** - * WorkerPool launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.launchStage = 0; - - /** - * WorkerPool binaryAuthorization. - * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.binaryAuthorization = null; - - /** - * WorkerPool template. - * @member {google.cloud.run.v2.IWorkerPoolRevisionTemplate|null|undefined} template - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.template = null; - - /** - * WorkerPool instanceSplits. - * @member {Array.} instanceSplits - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.instanceSplits = $util.emptyArray; - - /** - * WorkerPool scaling. - * @member {google.cloud.run.v2.IWorkerPoolScaling|null|undefined} scaling - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.scaling = null; - - /** - * WorkerPool observedGeneration. - * @member {number|Long} observedGeneration - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * WorkerPool terminalCondition. - * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.terminalCondition = null; - - /** - * WorkerPool conditions. - * @member {Array.} conditions - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.conditions = $util.emptyArray; - - /** - * WorkerPool latestReadyRevision. - * @member {string} latestReadyRevision - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.latestReadyRevision = ""; - - /** - * WorkerPool latestCreatedRevision. - * @member {string} latestCreatedRevision - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.latestCreatedRevision = ""; - - /** - * WorkerPool instanceSplitStatuses. - * @member {Array.} instanceSplitStatuses - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.instanceSplitStatuses = $util.emptyArray; - - /** - * WorkerPool threatDetectionEnabled. - * @member {boolean} threatDetectionEnabled - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.threatDetectionEnabled = false; - - /** - * WorkerPool customAudiences. - * @member {Array.} customAudiences - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.customAudiences = $util.emptyArray; - - /** - * WorkerPool satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.satisfiesPzs = false; - - /** - * WorkerPool reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.reconciling = false; - - /** - * WorkerPool etag. - * @member {string} etag - * @memberof google.cloud.run.v2.WorkerPool - * @instance - */ - WorkerPool.prototype.etag = ""; - - /** - * Creates a new WorkerPool instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {google.cloud.run.v2.IWorkerPool=} [properties] Properties to set - * @returns {google.cloud.run.v2.WorkerPool} WorkerPool instance - */ - WorkerPool.create = function create(properties) { - return new WorkerPool(properties); - }; - - /** - * Encodes the specified WorkerPool message. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {google.cloud.run.v2.IWorkerPool} message WorkerPool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPool.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); - if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.generation); - 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.creator); - if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.lastModifier); - if (message.client != null && Object.hasOwnProperty.call(message, "client")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.client); - if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.clientVersion); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); - if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) - $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.encode(message.template, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.scaling != null && Object.hasOwnProperty.call(message, "scaling")) - $root.google.cloud.run.v2.WorkerPoolScaling.encode(message.scaling, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.instanceSplits != null && message.instanceSplits.length) - for (var i = 0; i < message.instanceSplits.length; ++i) - $root.google.cloud.run.v2.InstanceSplit.encode(message.instanceSplits[i], writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.instanceSplitStatuses != null && message.instanceSplitStatuses.length) - for (var i = 0; i < message.instanceSplitStatuses.length; ++i) - $root.google.cloud.run.v2.InstanceSplitStatus.encode(message.instanceSplitStatuses[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.threatDetectionEnabled != null && Object.hasOwnProperty.call(message, "threatDetectionEnabled")) - writer.uint32(/* id 28, wireType 0 =*/224).bool(message.threatDetectionEnabled); - if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) - writer.uint32(/* id 30, wireType 0 =*/240).int64(message.observedGeneration); - if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) - $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.latestReadyRevision != null && Object.hasOwnProperty.call(message, "latestReadyRevision")) - writer.uint32(/* id 33, wireType 2 =*/266).string(message.latestReadyRevision); - if (message.latestCreatedRevision != null && Object.hasOwnProperty.call(message, "latestCreatedRevision")) - writer.uint32(/* id 34, wireType 2 =*/274).string(message.latestCreatedRevision); - if (message.customAudiences != null && message.customAudiences.length) - for (var i = 0; i < message.customAudiences.length; ++i) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.customAudiences[i]); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 38, wireType 0 =*/304).bool(message.satisfiesPzs); - if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) - writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); - return writer; - }; - - /** - * Encodes the specified WorkerPool message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPool.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {google.cloud.run.v2.IWorkerPool} message WorkerPool message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPool.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkerPool message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.WorkerPool} WorkerPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPool.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.WorkerPool(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.uid = reader.string(); - break; - } - case 4: { - message.generation = reader.int64(); - 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.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.creator = reader.string(); - break; - } - case 12: { - message.lastModifier = reader.string(); - break; - } - case 13: { - message.client = reader.string(); - break; - } - case 14: { - message.clientVersion = reader.string(); - break; - } - case 16: { - message.launchStage = reader.int32(); - break; - } - case 17: { - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); - break; - } - case 18: { - message.template = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.decode(reader, reader.uint32()); - break; - } - case 26: { - if (!(message.instanceSplits && message.instanceSplits.length)) - message.instanceSplits = []; - message.instanceSplits.push($root.google.cloud.run.v2.InstanceSplit.decode(reader, reader.uint32())); - break; - } - case 20: { - message.scaling = $root.google.cloud.run.v2.WorkerPoolScaling.decode(reader, reader.uint32()); - break; - } - case 30: { - message.observedGeneration = reader.int64(); - break; - } - case 31: { - message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); - break; - } - case 32: { - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); - break; - } - case 33: { - message.latestReadyRevision = reader.string(); - break; - } - case 34: { - message.latestCreatedRevision = reader.string(); - break; - } - case 27: { - if (!(message.instanceSplitStatuses && message.instanceSplitStatuses.length)) - message.instanceSplitStatuses = []; - message.instanceSplitStatuses.push($root.google.cloud.run.v2.InstanceSplitStatus.decode(reader, reader.uint32())); - break; - } - case 28: { - message.threatDetectionEnabled = reader.bool(); - break; - } - case 37: { - if (!(message.customAudiences && message.customAudiences.length)) - message.customAudiences = []; - message.customAudiences.push(reader.string()); - break; - } - case 38: { - message.satisfiesPzs = reader.bool(); - break; - } - case 98: { - message.reconciling = reader.bool(); - break; - } - case 99: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkerPool message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.WorkerPool} WorkerPool - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPool.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkerPool message. - * @function verify - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkerPool.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.generation != null && message.hasOwnProperty("generation")) - if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) - return "generation: integer|Long expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - if (!$util.isString(message.lastModifier)) - return "lastModifier: string expected"; - if (message.client != null && message.hasOwnProperty("client")) - if (!$util.isString(message.client)) - return "client: string expected"; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - if (!$util.isString(message.clientVersion)) - return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { - var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); - if (error) - return "binaryAuthorization." + error; - } - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.verify(message.template); - if (error) - return "template." + error; - } - if (message.instanceSplits != null && message.hasOwnProperty("instanceSplits")) { - if (!Array.isArray(message.instanceSplits)) - return "instanceSplits: array expected"; - for (var i = 0; i < message.instanceSplits.length; ++i) { - var error = $root.google.cloud.run.v2.InstanceSplit.verify(message.instanceSplits[i]); - if (error) - return "instanceSplits." + error; - } - } - if (message.scaling != null && message.hasOwnProperty("scaling")) { - var error = $root.google.cloud.run.v2.WorkerPoolScaling.verify(message.scaling); - if (error) - return "scaling." + error; - } - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) - return "observedGeneration: integer|Long expected"; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { - var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); - if (error) - return "terminalCondition." + error; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) - if (!$util.isString(message.latestReadyRevision)) - return "latestReadyRevision: string expected"; - if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) - if (!$util.isString(message.latestCreatedRevision)) - return "latestCreatedRevision: string expected"; - if (message.instanceSplitStatuses != null && message.hasOwnProperty("instanceSplitStatuses")) { - if (!Array.isArray(message.instanceSplitStatuses)) - return "instanceSplitStatuses: array expected"; - for (var i = 0; i < message.instanceSplitStatuses.length; ++i) { - var error = $root.google.cloud.run.v2.InstanceSplitStatus.verify(message.instanceSplitStatuses[i]); - if (error) - return "instanceSplitStatuses." + error; - } - } - if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) - if (typeof message.threatDetectionEnabled !== "boolean") - return "threatDetectionEnabled: boolean expected"; - if (message.customAudiences != null && message.hasOwnProperty("customAudiences")) { - if (!Array.isArray(message.customAudiences)) - return "customAudiences: array expected"; - for (var i = 0; i < message.customAudiences.length; ++i) - if (!$util.isString(message.customAudiences[i])) - return "customAudiences: string[] expected"; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - if (typeof message.reconciling !== "boolean") - return "reconciling: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a WorkerPool message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.WorkerPool} WorkerPool - */ - WorkerPool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.WorkerPool) - return object; - var message = new $root.google.cloud.run.v2.WorkerPool(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.uid != null) - message.uid = String(object.uid); - if (object.generation != null) - if ($util.Long) - (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; - else if (typeof object.generation === "string") - message.generation = parseInt(object.generation, 10); - else if (typeof object.generation === "number") - message.generation = object.generation; - else if (typeof object.generation === "object") - message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.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.run.v2.WorkerPool.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.lastModifier != null) - message.lastModifier = String(object.lastModifier); - if (object.client != null) - message.client = String(object.client); - if (object.clientVersion != null) - message.clientVersion = String(object.clientVersion); - 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.binaryAuthorization != null) { - if (typeof object.binaryAuthorization !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.binaryAuthorization: object expected"); - message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); - } - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.template: object expected"); - message.template = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.fromObject(object.template); - } - if (object.instanceSplits) { - if (!Array.isArray(object.instanceSplits)) - throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplits: array expected"); - message.instanceSplits = []; - for (var i = 0; i < object.instanceSplits.length; ++i) { - if (typeof object.instanceSplits[i] !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplits: object expected"); - message.instanceSplits[i] = $root.google.cloud.run.v2.InstanceSplit.fromObject(object.instanceSplits[i]); - } - } - if (object.scaling != null) { - if (typeof object.scaling !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.scaling: object expected"); - message.scaling = $root.google.cloud.run.v2.WorkerPoolScaling.fromObject(object.scaling); - } - if (object.observedGeneration != null) - if ($util.Long) - (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; - else if (typeof object.observedGeneration === "string") - message.observedGeneration = parseInt(object.observedGeneration, 10); - else if (typeof object.observedGeneration === "number") - message.observedGeneration = object.observedGeneration; - else if (typeof object.observedGeneration === "object") - message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); - if (object.terminalCondition != null) { - if (typeof object.terminalCondition !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.terminalCondition: object expected"); - message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.cloud.run.v2.WorkerPool.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.conditions: object expected"); - message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); - } - } - if (object.latestReadyRevision != null) - message.latestReadyRevision = String(object.latestReadyRevision); - if (object.latestCreatedRevision != null) - message.latestCreatedRevision = String(object.latestCreatedRevision); - if (object.instanceSplitStatuses) { - if (!Array.isArray(object.instanceSplitStatuses)) - throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplitStatuses: array expected"); - message.instanceSplitStatuses = []; - for (var i = 0; i < object.instanceSplitStatuses.length; ++i) { - if (typeof object.instanceSplitStatuses[i] !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPool.instanceSplitStatuses: object expected"); - message.instanceSplitStatuses[i] = $root.google.cloud.run.v2.InstanceSplitStatus.fromObject(object.instanceSplitStatuses[i]); - } - } - if (object.threatDetectionEnabled != null) - message.threatDetectionEnabled = Boolean(object.threatDetectionEnabled); - if (object.customAudiences) { - if (!Array.isArray(object.customAudiences)) - throw TypeError(".google.cloud.run.v2.WorkerPool.customAudiences: array expected"); - message.customAudiences = []; - for (var i = 0; i < object.customAudiences.length; ++i) - message.customAudiences[i] = String(object.customAudiences[i]); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.reconciling != null) - message.reconciling = Boolean(object.reconciling); - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a WorkerPool message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {google.cloud.run.v2.WorkerPool} message WorkerPool - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkerPool.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instanceSplits = []; - object.instanceSplitStatuses = []; - object.conditions = []; - object.customAudiences = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.description = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.generation = options.longs === String ? "0" : 0; - object.createTime = null; - object.updateTime = null; - object.deleteTime = null; - object.expireTime = null; - object.creator = ""; - object.lastModifier = ""; - object.client = ""; - object.clientVersion = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.binaryAuthorization = null; - object.template = null; - object.scaling = null; - object.threatDetectionEnabled = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.observedGeneration = options.longs === String ? "0" : 0; - object.terminalCondition = null; - object.latestReadyRevision = ""; - object.latestCreatedRevision = ""; - object.satisfiesPzs = false; - object.reconciling = false; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.generation != null && message.hasOwnProperty("generation")) - if (typeof message.generation === "number") - object.generation = options.longs === String ? String(message.generation) : message.generation; - else - object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - 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.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) - object.lastModifier = message.lastModifier; - if (message.client != null && message.hasOwnProperty("client")) - object.client = message.client; - if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) - object.clientVersion = message.clientVersion; - 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) - object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.run.v2.WorkerPoolRevisionTemplate.toObject(message.template, options); - if (message.scaling != null && message.hasOwnProperty("scaling")) - object.scaling = $root.google.cloud.run.v2.WorkerPoolScaling.toObject(message.scaling, options); - if (message.instanceSplits && message.instanceSplits.length) { - object.instanceSplits = []; - for (var j = 0; j < message.instanceSplits.length; ++j) - object.instanceSplits[j] = $root.google.cloud.run.v2.InstanceSplit.toObject(message.instanceSplits[j], options); - } - if (message.instanceSplitStatuses && message.instanceSplitStatuses.length) { - object.instanceSplitStatuses = []; - for (var j = 0; j < message.instanceSplitStatuses.length; ++j) - object.instanceSplitStatuses[j] = $root.google.cloud.run.v2.InstanceSplitStatus.toObject(message.instanceSplitStatuses[j], options); - } - if (message.threatDetectionEnabled != null && message.hasOwnProperty("threatDetectionEnabled")) - object.threatDetectionEnabled = message.threatDetectionEnabled; - if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) - if (typeof message.observedGeneration === "number") - object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; - else - object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; - if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) - object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); - } - if (message.latestReadyRevision != null && message.hasOwnProperty("latestReadyRevision")) - object.latestReadyRevision = message.latestReadyRevision; - if (message.latestCreatedRevision != null && message.hasOwnProperty("latestCreatedRevision")) - object.latestCreatedRevision = message.latestCreatedRevision; - if (message.customAudiences && message.customAudiences.length) { - object.customAudiences = []; - for (var j = 0; j < message.customAudiences.length; ++j) - object.customAudiences[j] = message.customAudiences[j]; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) - object.reconciling = message.reconciling; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this WorkerPool to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.WorkerPool - * @instance - * @returns {Object.} JSON object - */ - WorkerPool.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkerPool - * @function getTypeUrl - * @memberof google.cloud.run.v2.WorkerPool - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkerPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.WorkerPool"; - }; - - return WorkerPool; - })(); - - v2.WorkerPoolRevisionTemplate = (function() { - - /** - * Properties of a WorkerPoolRevisionTemplate. - * @memberof google.cloud.run.v2 - * @interface IWorkerPoolRevisionTemplate - * @property {string|null} [revision] WorkerPoolRevisionTemplate revision - * @property {Object.|null} [labels] WorkerPoolRevisionTemplate labels - * @property {Object.|null} [annotations] WorkerPoolRevisionTemplate annotations - * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] WorkerPoolRevisionTemplate vpcAccess - * @property {string|null} [serviceAccount] WorkerPoolRevisionTemplate serviceAccount - * @property {Array.|null} [containers] WorkerPoolRevisionTemplate containers - * @property {Array.|null} [volumes] WorkerPoolRevisionTemplate volumes - * @property {string|null} [encryptionKey] WorkerPoolRevisionTemplate encryptionKey - * @property {google.cloud.run.v2.IServiceMesh|null} [serviceMesh] WorkerPoolRevisionTemplate serviceMesh - * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] WorkerPoolRevisionTemplate encryptionKeyRevocationAction - * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] WorkerPoolRevisionTemplate encryptionKeyShutdownDuration - * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] WorkerPoolRevisionTemplate nodeSelector - * @property {boolean|null} [gpuZonalRedundancyDisabled] WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled - */ - - /** - * Constructs a new WorkerPoolRevisionTemplate. - * @memberof google.cloud.run.v2 - * @classdesc Represents a WorkerPoolRevisionTemplate. - * @implements IWorkerPoolRevisionTemplate - * @constructor - * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate=} [properties] Properties to set - */ - function WorkerPoolRevisionTemplate(properties) { - this.labels = {}; - this.annotations = {}; - this.containers = []; - 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]]; - } - - /** - * WorkerPoolRevisionTemplate revision. - * @member {string} revision - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.revision = ""; - - /** - * WorkerPoolRevisionTemplate labels. - * @member {Object.} labels - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.labels = $util.emptyObject; - - /** - * WorkerPoolRevisionTemplate annotations. - * @member {Object.} annotations - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.annotations = $util.emptyObject; - - /** - * WorkerPoolRevisionTemplate vpcAccess. - * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.vpcAccess = null; - - /** - * WorkerPoolRevisionTemplate serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.serviceAccount = ""; - - /** - * WorkerPoolRevisionTemplate containers. - * @member {Array.} containers - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.containers = $util.emptyArray; - - /** - * WorkerPoolRevisionTemplate volumes. - * @member {Array.} volumes - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.volumes = $util.emptyArray; - - /** - * WorkerPoolRevisionTemplate encryptionKey. - * @member {string} encryptionKey - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.encryptionKey = ""; - - /** - * WorkerPoolRevisionTemplate serviceMesh. - * @member {google.cloud.run.v2.IServiceMesh|null|undefined} serviceMesh - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.serviceMesh = null; - - /** - * WorkerPoolRevisionTemplate encryptionKeyRevocationAction. - * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.encryptionKeyRevocationAction = 0; - - /** - * WorkerPoolRevisionTemplate encryptionKeyShutdownDuration. - * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.encryptionKeyShutdownDuration = null; - - /** - * WorkerPoolRevisionTemplate nodeSelector. - * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.nodeSelector = null; - - /** - * WorkerPoolRevisionTemplate gpuZonalRedundancyDisabled. - * @member {boolean|null|undefined} gpuZonalRedundancyDisabled - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - */ - WorkerPoolRevisionTemplate.prototype.gpuZonalRedundancyDisabled = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(WorkerPoolRevisionTemplate.prototype, "_gpuZonalRedundancyDisabled", { - get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WorkerPoolRevisionTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate=} [properties] Properties to set - * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate instance - */ - WorkerPoolRevisionTemplate.create = function create(properties) { - return new WorkerPoolRevisionTemplate(properties); - }; - - /** - * Encodes the specified WorkerPoolRevisionTemplate message. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate} message WorkerPoolRevisionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPoolRevisionTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.revision); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).ldelim(); - if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) - $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); - if (message.containers != null && message.containers.length) - for (var i = 0; i < message.containers.length; ++i) - $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.encryptionKey); - if (message.serviceMesh != null && Object.hasOwnProperty.call(message, "serviceMesh")) - $root.google.cloud.run.v2.ServiceMesh.encode(message.serviceMesh, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.encryptionKeyRevocationAction); - if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) - $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) - $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.gpuZonalRedundancyDisabled); - return writer; - }; - - /** - * Encodes the specified WorkerPoolRevisionTemplate message, length delimited. Does not implicitly {@link google.cloud.run.v2.WorkerPoolRevisionTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {google.cloud.run.v2.IWorkerPoolRevisionTemplate} message WorkerPoolRevisionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkerPoolRevisionTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPoolRevisionTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.WorkerPoolRevisionTemplate(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revision = reader.string(); - break; - } - case 2: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 3: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - 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.annotations[key] = value; - break; - } - case 4: { - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); - break; - } - case 5: { - message.serviceAccount = reader.string(); - break; - } - case 6: { - if (!(message.containers && message.containers.length)) - message.containers = []; - message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); - break; - } - case 8: { - message.encryptionKey = reader.string(); - break; - } - case 9: { - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.decode(reader, reader.uint32()); - break; - } - case 10: { - message.encryptionKeyRevocationAction = reader.int32(); - break; - } - case 11: { - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 13: { - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); - break; - } - case 16: { - message.gpuZonalRedundancyDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkerPoolRevisionTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkerPoolRevisionTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkerPoolRevisionTemplate message. - * @function verify - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkerPoolRevisionTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { - var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); - if (error) - return "vpcAccess." + error; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.containers != null && message.hasOwnProperty("containers")) { - if (!Array.isArray(message.containers)) - return "containers: array expected"; - for (var i = 0; i < message.containers.length; ++i) { - var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); - if (error) - return "containers." + error; - } - } - 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.run.v2.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - if (!$util.isString(message.encryptionKey)) - return "encryptionKey: string expected"; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) { - var error = $root.google.cloud.run.v2.ServiceMesh.verify(message.serviceMesh); - if (error) - return "serviceMesh." + error; - } - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - switch (message.encryptionKeyRevocationAction) { - default: - return "encryptionKeyRevocationAction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { - var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); - if (error) - return "encryptionKeyShutdownDuration." + error; - } - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { - var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); - if (error) - return "nodeSelector." + error; - } - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - properties._gpuZonalRedundancyDisabled = 1; - if (typeof message.gpuZonalRedundancyDisabled !== "boolean") - return "gpuZonalRedundancyDisabled: boolean expected"; - } - return null; - }; - - /** - * Creates a WorkerPoolRevisionTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.run.v2.WorkerPoolRevisionTemplate} WorkerPoolRevisionTemplate - */ - WorkerPoolRevisionTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.run.v2.WorkerPoolRevisionTemplate) - return object; - var message = new $root.google.cloud.run.v2.WorkerPoolRevisionTemplate(); - if (object.revision != null) - message.revision = String(object.revision); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.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.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - if (object.vpcAccess != null) { - if (typeof object.vpcAccess !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.vpcAccess: object expected"); - message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.containers) { - if (!Array.isArray(object.containers)) - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.containers: array expected"); - message.containers = []; - for (var i = 0; i < object.containers.length; ++i) { - if (typeof object.containers[i] !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.containers: object expected"); - message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); - } - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.volumes: object expected"); - message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); - } - } - if (object.encryptionKey != null) - message.encryptionKey = String(object.encryptionKey); - if (object.serviceMesh != null) { - if (typeof object.serviceMesh !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.serviceMesh: object expected"); - message.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.fromObject(object.serviceMesh); - } - switch (object.encryptionKeyRevocationAction) { - default: - if (typeof object.encryptionKeyRevocationAction === "number") { - message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; - break; - } - break; - case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": - case 0: - message.encryptionKeyRevocationAction = 0; - break; - case "PREVENT_NEW": - case 1: - message.encryptionKeyRevocationAction = 1; - break; - case "SHUTDOWN": - case 2: - message.encryptionKeyRevocationAction = 2; - break; - } - if (object.encryptionKeyShutdownDuration != null) { - if (typeof object.encryptionKeyShutdownDuration !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.encryptionKeyShutdownDuration: object expected"); - message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); - } - if (object.nodeSelector != null) { - if (typeof object.nodeSelector !== "object") - throw TypeError(".google.cloud.run.v2.WorkerPoolRevisionTemplate.nodeSelector: object expected"); - message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); - } - if (object.gpuZonalRedundancyDisabled != null) - message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); - return message; - }; - - /** - * Creates a plain object from a WorkerPoolRevisionTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {google.cloud.run.v2.WorkerPoolRevisionTemplate} message WorkerPoolRevisionTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkerPoolRevisionTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.containers = []; - object.volumes = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.revision = ""; - object.vpcAccess = null; - object.serviceAccount = ""; - object.encryptionKey = ""; - object.serviceMesh = null; - object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; - object.encryptionKeyShutdownDuration = null; - object.nodeSelector = null; - } - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - 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.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) - object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.containers && message.containers.length) { - object.containers = []; - for (var j = 0; j < message.containers.length; ++j) - object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); - } - if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) - object.encryptionKey = message.encryptionKey; - if (message.serviceMesh != null && message.hasOwnProperty("serviceMesh")) - object.serviceMesh = $root.google.cloud.run.v2.ServiceMesh.toObject(message.serviceMesh, options); - if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) - object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; - if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) - object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); - if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) - object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); - if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { - object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; - if (options.oneofs) - object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; - } - return object; - }; - - /** - * Converts this WorkerPoolRevisionTemplate to JSON. - * @function toJSON - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @instance - * @returns {Object.} JSON object - */ - WorkerPoolRevisionTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkerPoolRevisionTemplate - * @function getTypeUrl - * @memberof google.cloud.run.v2.WorkerPoolRevisionTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkerPoolRevisionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.run.v2.WorkerPoolRevisionTemplate"; - }; - - return WorkerPoolRevisionTemplate; - })(); - - return v2; - })(); - - return run; - })(); - - 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, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - api.RoutingRule = (function() { - - /** - * Properties of a RoutingRule. - * @memberof google.api - * @interface IRoutingRule - * @property {Array.|null} [routingParameters] RoutingRule routingParameters - */ - - /** - * Constructs a new RoutingRule. - * @memberof google.api - * @classdesc Represents a RoutingRule. - * @implements IRoutingRule - * @constructor - * @param {google.api.IRoutingRule=} [properties] Properties to set - */ - function RoutingRule(properties) { - this.routingParameters = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingRule routingParameters. - * @member {Array.} routingParameters - * @memberof google.api.RoutingRule - * @instance - */ - RoutingRule.prototype.routingParameters = $util.emptyArray; - - /** - * Creates a new RoutingRule instance using the specified properties. - * @function create - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule=} [properties] Properties to set - * @returns {google.api.RoutingRule} RoutingRule instance - */ - RoutingRule.create = function create(properties) { - return new RoutingRule(properties); - }; - - /** - * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @function encode - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.routingParameters != null && message.routingParameters.length) - for (var i = 0; i < message.routingParameters.length; ++i) - $root.google.api.RoutingParameter.encode(message.routingParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.RoutingRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RoutingRule} RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.routingParameters && message.routingParameters.length)) - message.routingParameters = []; - message.routingParameters.push($root.google.api.RoutingParameter.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RoutingRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RoutingRule} RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingRule message. - * @function verify - * @memberof google.api.RoutingRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { - if (!Array.isArray(message.routingParameters)) - return "routingParameters: array expected"; - for (var i = 0; i < message.routingParameters.length; ++i) { - var error = $root.google.api.RoutingParameter.verify(message.routingParameters[i]); - if (error) - return "routingParameters." + error; - } - } - return null; - }; - - /** - * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RoutingRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.RoutingRule} RoutingRule - */ - RoutingRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RoutingRule) - return object; - var message = new $root.google.api.RoutingRule(); - if (object.routingParameters) { - if (!Array.isArray(object.routingParameters)) - throw TypeError(".google.api.RoutingRule.routingParameters: array expected"); - message.routingParameters = []; - for (var i = 0; i < object.routingParameters.length; ++i) { - if (typeof object.routingParameters[i] !== "object") - throw TypeError(".google.api.RoutingRule.routingParameters: object expected"); - message.routingParameters[i] = $root.google.api.RoutingParameter.fromObject(object.routingParameters[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RoutingRule - * @static - * @param {google.api.RoutingRule} message RoutingRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.routingParameters = []; - if (message.routingParameters && message.routingParameters.length) { - object.routingParameters = []; - for (var j = 0; j < message.routingParameters.length; ++j) - object.routingParameters[j] = $root.google.api.RoutingParameter.toObject(message.routingParameters[j], options); - } - return object; - }; - - /** - * Converts this RoutingRule to JSON. - * @function toJSON - * @memberof google.api.RoutingRule - * @instance - * @returns {Object.} JSON object - */ - RoutingRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingRule - * @function getTypeUrl - * @memberof google.api.RoutingRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RoutingRule"; - }; - - return RoutingRule; - })(); - - api.RoutingParameter = (function() { - - /** - * Properties of a RoutingParameter. - * @memberof google.api - * @interface IRoutingParameter - * @property {string|null} [field] RoutingParameter field - * @property {string|null} [pathTemplate] RoutingParameter pathTemplate - */ - - /** - * Constructs a new RoutingParameter. - * @memberof google.api - * @classdesc Represents a RoutingParameter. - * @implements IRoutingParameter - * @constructor - * @param {google.api.IRoutingParameter=} [properties] Properties to set - */ - function RoutingParameter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingParameter field. - * @member {string} field - * @memberof google.api.RoutingParameter - * @instance - */ - RoutingParameter.prototype.field = ""; - - /** - * RoutingParameter pathTemplate. - * @member {string} pathTemplate - * @memberof google.api.RoutingParameter - * @instance - */ - RoutingParameter.prototype.pathTemplate = ""; - - /** - * Creates a new RoutingParameter instance using the specified properties. - * @function create - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter=} [properties] Properties to set - * @returns {google.api.RoutingParameter} RoutingParameter instance - */ - RoutingParameter.create = function create(properties) { - return new RoutingParameter(properties); - }; - - /** - * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @function encode - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingParameter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.field != null && Object.hasOwnProperty.call(message, "field")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); - if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pathTemplate); - return writer; - }; - - /** - * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingParameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer. - * @function decode - * @memberof google.api.RoutingParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RoutingParameter} RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingParameter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingParameter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.field = reader.string(); - break; - } - case 2: { - message.pathTemplate = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RoutingParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RoutingParameter} RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingParameter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingParameter message. - * @function verify - * @memberof google.api.RoutingParameter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingParameter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.field != null && message.hasOwnProperty("field")) - if (!$util.isString(message.field)) - return "field: string expected"; - if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) - if (!$util.isString(message.pathTemplate)) - return "pathTemplate: string expected"; - return null; - }; - - /** - * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RoutingParameter - * @static - * @param {Object.} object Plain object - * @returns {google.api.RoutingParameter} RoutingParameter - */ - RoutingParameter.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RoutingParameter) - return object; - var message = new $root.google.api.RoutingParameter(); - if (object.field != null) - message.field = String(object.field); - if (object.pathTemplate != null) - message.pathTemplate = String(object.pathTemplate); - return message; - }; - - /** - * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.RoutingParameter} message RoutingParameter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingParameter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.field = ""; - object.pathTemplate = ""; - } - if (message.field != null && message.hasOwnProperty("field")) - object.field = message.field; - if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) - object.pathTemplate = message.pathTemplate; - return object; - }; - - /** - * Converts this RoutingParameter to JSON. - * @function toJSON - * @memberof google.api.RoutingParameter - * @instance - * @returns {Object.} JSON object - */ - RoutingParameter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingParameter - * @function getTypeUrl - * @memberof google.api.RoutingParameter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RoutingParameter"; - }; - - return RoutingParameter; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.api.IRoutingRule|null} [".google.api.routing"] MethodOptions .google.api.routing - * @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.api.routing. - * @member {google.api.IRoutingRule|null|undefined} .google.api.routing - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.routing"] = null; - - /** - * 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(); - if (message[".google.api.routing"] != null && Object.hasOwnProperty.call(message, ".google.api.routing")) - $root.google.api.RoutingRule.encode(message[".google.api.routing"], writer.uint32(/* id 72295729, wireType 2 =*/578365834).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 72295729: { - message[".google.api.routing"] = $root.google.api.RoutingRule.decode(reader, reader.uint32()); - 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.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { - var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"]); - if (error) - return ".google.api.routing." + error; - } - 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.api.routing"] != null) { - if (typeof object[".google.api.routing"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.routing: object expected"); - message[".google.api.routing"] = $root.google.api.RoutingRule.fromObject(object[".google.api.routing"]); - } - 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; - object[".google.api.routing"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) - object[".google.api.routing"] = $root.google.api.RoutingRule.toObject(message[".google.api.routing"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - return protobuf; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - google.iam = (function() { - - /** - * Namespace iam. - * @memberof google - * @namespace - */ - var iam = {}; - - iam.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.iam - * @namespace - */ - var v1 = {}; - - v1.IAMPolicy = (function() { - - /** - * Constructs a new IAMPolicy service. - * @memberof google.iam.v1 - * @classdesc Represents a IAMPolicy - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @function create - * @memberof google.iam.v1.IAMPolicy - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. - */ - IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @memberof google.iam.v1.IAMPolicy - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return IAMPolicy; - })(); - - v1.SetIamPolicyRequest = (function() { - - /** - * Properties of a SetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface ISetIamPolicyRequest - * @property {string|null} [resource] SetIamPolicyRequest resource - * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy - * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask - */ - - /** - * Constructs a new SetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a SetIamPolicyRequest. - * @implements ISetIamPolicyRequest - * @constructor - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - */ - function SetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.resource = ""; - - /** - * SetIamPolicyRequest policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.policy = null; - - /** - * SetIamPolicyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.updateMask = null; - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance - */ - SetIamPolicyRequest.create = function create(properties) { - return new SetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - } - case 3: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - */ - SetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.SetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.policy = null; - object.updateMask = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - SetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; - }; - - return SetIamPolicyRequest; - })(); - - v1.GetIamPolicyRequest = (function() { - - /** - * Properties of a GetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface IGetIamPolicyRequest - * @property {string|null} [resource] GetIamPolicyRequest resource - * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options - */ - - /** - * Constructs a new GetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a GetIamPolicyRequest. - * @implements IGetIamPolicyRequest - * @constructor - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - */ - function GetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.resource = ""; - - /** - * GetIamPolicyRequest options. - * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.options = null; - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance - */ - GetIamPolicyRequest.create = function create(properties) { - return new GetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - */ - GetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.GetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); - message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.options = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - GetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; - }; - - return GetIamPolicyRequest; - })(); - - v1.TestIamPermissionsRequest = (function() { - - /** - * Properties of a TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsRequest - * @property {string|null} [resource] TestIamPermissionsRequest resource - * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions - */ - - /** - * Constructs a new TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsRequest. - * @implements ITestIamPermissionsRequest - * @constructor - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - */ - function TestIamPermissionsRequest(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsRequest resource. - * @member {string} resource - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.resource = ""; - - /** - * TestIamPermissionsRequest permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance - */ - TestIamPermissionsRequest.create = function create(properties) { - return new TestIamPermissionsRequest(properties); - }; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsRequest message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - */ - TestIamPermissionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (options.defaults) - object.resource = ""; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; - }; - - return TestIamPermissionsRequest; - })(); - - v1.TestIamPermissionsResponse = (function() { - - /** - * Properties of a TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsResponse - * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions - */ - - /** - * Constructs a new TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsResponse. - * @implements ITestIamPermissionsResponse - * @constructor - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - */ - function TestIamPermissionsResponse(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsResponse permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - */ - TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance - */ - TestIamPermissionsResponse.create = function create(properties) { - return new TestIamPermissionsResponse(properties); - }; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsResponse message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - */ - TestIamPermissionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsResponse(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; - }; - - return TestIamPermissionsResponse; - })(); - - v1.GetPolicyOptions = (function() { - - /** - * Properties of a GetPolicyOptions. - * @memberof google.iam.v1 - * @interface IGetPolicyOptions - * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion - */ - - /** - * Constructs a new GetPolicyOptions. - * @memberof google.iam.v1 - * @classdesc Represents a GetPolicyOptions. - * @implements IGetPolicyOptions - * @constructor - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - */ - function GetPolicyOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPolicyOptions requestedPolicyVersion. - * @member {number} requestedPolicyVersion - * @memberof google.iam.v1.GetPolicyOptions - * @instance - */ - GetPolicyOptions.prototype.requestedPolicyVersion = 0; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance - */ - GetPolicyOptions.create = function create(properties) { - return new GetPolicyOptions(properties); - }; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); - return writer; - }; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.requestedPolicyVersion = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPolicyOptions message. - * @function verify - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPolicyOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - if (!$util.isInteger(message.requestedPolicyVersion)) - return "requestedPolicyVersion: integer expected"; - return null; - }; - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - */ - GetPolicyOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetPolicyOptions) - return object; - var message = new $root.google.iam.v1.GetPolicyOptions(); - if (object.requestedPolicyVersion != null) - message.requestedPolicyVersion = object.requestedPolicyVersion | 0; - return message; - }; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPolicyOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.requestedPolicyVersion = 0; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - object.requestedPolicyVersion = message.requestedPolicyVersion; - return object; - }; - - /** - * Converts this GetPolicyOptions to JSON. - * @function toJSON - * @memberof google.iam.v1.GetPolicyOptions - * @instance - * @returns {Object.} JSON object - */ - GetPolicyOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetPolicyOptions - * @function getTypeUrl - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; - }; - - return GetPolicyOptions; - })(); - - v1.Policy = (function() { - - /** - * Properties of a Policy. - * @memberof google.iam.v1 - * @interface IPolicy - * @property {number|null} [version] Policy version - * @property {Array.|null} [bindings] Policy bindings - * @property {Array.|null} [auditConfigs] Policy auditConfigs - * @property {Uint8Array|null} [etag] Policy etag - */ - - /** - * Constructs a new Policy. - * @memberof google.iam.v1 - * @classdesc Represents a Policy. - * @implements IPolicy - * @constructor - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - */ - function Policy(properties) { - this.bindings = []; - this.auditConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Policy version. - * @member {number} version - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.version = 0; - - /** - * Policy bindings. - * @member {Array.} bindings - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.bindings = $util.emptyArray; - - /** - * Policy auditConfigs. - * @member {Array.} auditConfigs - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.auditConfigs = $util.emptyArray; - - /** - * Policy etag. - * @member {Uint8Array} etag - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.etag = $util.newBuffer([]); - - /** - * Creates a new Policy instance using the specified properties. - * @function create - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - * @returns {google.iam.v1.Policy} Policy instance - */ - Policy.create = function create(properties) { - return new Policy(properties); - }; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.bindings != null && message.bindings.length) - for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.auditConfigs != null && message.auditConfigs.length) - for (var i = 0; i < message.auditConfigs.length; ++i) - $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.int32(); - break; - } - case 4: { - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.auditConfigs && message.auditConfigs.length)) - message.auditConfigs = []; - message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); - break; - } - case 3: { - message.etag = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Policy message. - * @function verify - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Policy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { - if (!Array.isArray(message.bindings)) - return "bindings: array expected"; - for (var i = 0; i < message.bindings.length; ++i) { - var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); - if (error) - return "bindings." + error; - } - } - if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { - if (!Array.isArray(message.auditConfigs)) - return "auditConfigs: array expected"; - for (var i = 0; i < message.auditConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); - if (error) - return "auditConfigs." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) - return "etag: buffer expected"; - return null; - }; - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Policy} Policy - */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Policy) - return object; - var message = new $root.google.iam.v1.Policy(); - if (object.version != null) - message.version = object.version | 0; - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.iam.v1.Policy.bindings: array expected"); - message.bindings = []; - for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") - throw TypeError(".google.iam.v1.Policy.bindings: object expected"); - message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); - } - } - if (object.auditConfigs) { - if (!Array.isArray(object.auditConfigs)) - throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); - message.auditConfigs = []; - for (var i = 0; i < object.auditConfigs.length; ++i) { - if (typeof object.auditConfigs[i] !== "object") - throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); - message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); - } - } - if (object.etag != null) - if (typeof object.etag === "string") - $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length >= 0) - message.etag = object.etag; - return message; - }; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.Policy} message Policy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Policy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindings = []; - object.auditConfigs = []; - } - if (options.defaults) { - object.version = 0; - if (options.bytes === String) - object.etag = ""; - else { - object.etag = []; - if (options.bytes !== Array) - object.etag = $util.newBuffer(object.etag); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; - if (message.bindings && message.bindings.length) { - object.bindings = []; - for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); - } - if (message.auditConfigs && message.auditConfigs.length) { - object.auditConfigs = []; - for (var j = 0; j < message.auditConfigs.length; ++j) - object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); - } - return object; - }; - - /** - * Converts this Policy to JSON. - * @function toJSON - * @memberof google.iam.v1.Policy - * @instance - * @returns {Object.} JSON object - */ - Policy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Policy - * @function getTypeUrl - * @memberof google.iam.v1.Policy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Policy"; - }; - - return Policy; - })(); - - v1.Binding = (function() { - - /** - * Properties of a Binding. - * @memberof google.iam.v1 - * @interface IBinding - * @property {string|null} [role] Binding role - * @property {Array.|null} [members] Binding members - * @property {google.type.IExpr|null} [condition] Binding condition - */ - - /** - * Constructs a new Binding. - * @memberof google.iam.v1 - * @classdesc Represents a Binding. - * @implements IBinding - * @constructor - * @param {google.iam.v1.IBinding=} [properties] Properties to set - */ - function Binding(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Binding role. - * @member {string} role - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.role = ""; - - /** - * Binding members. - * @member {Array.} members - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.members = $util.emptyArray; - - /** - * Binding condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.condition = null; - - /** - * Creates a new Binding instance using the specified properties. - * @function create - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding=} [properties] Properties to set - * @returns {google.iam.v1.Binding} Binding instance - */ - Binding.create = function create(properties) { - return new Binding(properties); - }; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.role = reader.string(); - break; - } - case 2: { - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - } - case 3: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Binding message. - * @function verify - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Binding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) - if (!$util.isString(message.members[i])) - return "members: string[] expected"; - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Binding} Binding - */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Binding) - return object; - var message = new $root.google.iam.v1.Binding(); - if (object.role != null) - message.role = String(object.role); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.iam.v1.Binding.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) - message.members[i] = String(object.members[i]); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.Binding.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.Binding} message Binding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Binding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.role = ""; - object.condition = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = message.members[j]; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this Binding to JSON. - * @function toJSON - * @memberof google.iam.v1.Binding - * @instance - * @returns {Object.} JSON object - */ - Binding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Binding - * @function getTypeUrl - * @memberof google.iam.v1.Binding - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Binding"; - }; - - return Binding; - })(); - - v1.AuditConfig = (function() { - - /** - * Properties of an AuditConfig. - * @memberof google.iam.v1 - * @interface IAuditConfig - * @property {string|null} [service] AuditConfig service - * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs - */ - - /** - * Constructs a new AuditConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfig. - * @implements IAuditConfig - * @constructor - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - */ - function AuditConfig(properties) { - this.auditLogConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfig service. - * @member {string} service - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.service = ""; - - /** - * AuditConfig auditLogConfigs. - * @member {Array.} auditLogConfigs - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.auditLogConfigs = $util.emptyArray; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfig} AuditConfig instance - */ - AuditConfig.create = function create(properties) { - return new AuditConfig(properties); - }; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - if (message.auditLogConfigs != null && message.auditLogConfigs.length) - for (var i = 0; i < message.auditLogConfigs.length; ++i) - $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - case 3: { - if (!(message.auditLogConfigs && message.auditLogConfigs.length)) - message.auditLogConfigs = []; - message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfig message. - * @function verify - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { - if (!Array.isArray(message.auditLogConfigs)) - return "auditLogConfigs: array expected"; - for (var i = 0; i < message.auditLogConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); - if (error) - return "auditLogConfigs." + error; - } - } - return null; - }; - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfig} AuditConfig - */ - AuditConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfig) - return object; - var message = new $root.google.iam.v1.AuditConfig(); - if (object.service != null) - message.service = String(object.service); - if (object.auditLogConfigs) { - if (!Array.isArray(object.auditLogConfigs)) - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); - message.auditLogConfigs = []; - for (var i = 0; i < object.auditLogConfigs.length; ++i) { - if (typeof object.auditLogConfigs[i] !== "object") - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); - message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.AuditConfig} message AuditConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.auditLogConfigs = []; - if (options.defaults) - object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.auditLogConfigs && message.auditLogConfigs.length) { - object.auditLogConfigs = []; - for (var j = 0; j < message.auditLogConfigs.length; ++j) - object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); - } - return object; - }; - - /** - * Converts this AuditConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfig - * @instance - * @returns {Object.} JSON object - */ - AuditConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfig"; - }; - - return AuditConfig; - })(); - - v1.AuditLogConfig = (function() { - - /** - * Properties of an AuditLogConfig. - * @memberof google.iam.v1 - * @interface IAuditLogConfig - * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType - * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers - */ - - /** - * Constructs a new AuditLogConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditLogConfig. - * @implements IAuditLogConfig - * @constructor - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - */ - function AuditLogConfig(properties) { - this.exemptedMembers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditLogConfig logType. - * @member {google.iam.v1.AuditLogConfig.LogType} logType - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.logType = 0; - - /** - * AuditLogConfig exemptedMembers. - * @member {Array.} exemptedMembers - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance - */ - AuditLogConfig.create = function create(properties) { - return new AuditLogConfig(properties); - }; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); - if (message.exemptedMembers != null && message.exemptedMembers.length) - for (var i = 0; i < message.exemptedMembers.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); - return writer; - }; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.logType = reader.int32(); - break; - } - case 2: { - if (!(message.exemptedMembers && message.exemptedMembers.length)) - message.exemptedMembers = []; - message.exemptedMembers.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditLogConfig message. - * @function verify - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditLogConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - switch (message.logType) { - default: - return "logType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { - if (!Array.isArray(message.exemptedMembers)) - return "exemptedMembers: array expected"; - for (var i = 0; i < message.exemptedMembers.length; ++i) - if (!$util.isString(message.exemptedMembers[i])) - return "exemptedMembers: string[] expected"; - } - return null; - }; - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - */ - AuditLogConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditLogConfig) - return object; - var message = new $root.google.iam.v1.AuditLogConfig(); - switch (object.logType) { - default: - if (typeof object.logType === "number") { - message.logType = object.logType; - break; - } - break; - case "LOG_TYPE_UNSPECIFIED": - case 0: - message.logType = 0; - break; - case "ADMIN_READ": - case 1: - message.logType = 1; - break; - case "DATA_WRITE": - case 2: - message.logType = 2; - break; - case "DATA_READ": - case 3: - message.logType = 3; - break; - } - if (object.exemptedMembers) { - if (!Array.isArray(object.exemptedMembers)) - throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); - message.exemptedMembers = []; - for (var i = 0; i < object.exemptedMembers.length; ++i) - message.exemptedMembers[i] = String(object.exemptedMembers[i]); - } - return message; - }; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditLogConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exemptedMembers = []; - if (options.defaults) - object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; - if (message.exemptedMembers && message.exemptedMembers.length) { - object.exemptedMembers = []; - for (var j = 0; j < message.exemptedMembers.length; ++j) - object.exemptedMembers[j] = message.exemptedMembers[j]; - } - return object; - }; - - /** - * Converts this AuditLogConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditLogConfig - * @instance - * @returns {Object.} JSON object - */ - AuditLogConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditLogConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; - }; - - /** - * LogType enum. - * @name google.iam.v1.AuditLogConfig.LogType - * @enum {number} - * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value - * @property {number} ADMIN_READ=1 ADMIN_READ value - * @property {number} DATA_WRITE=2 DATA_WRITE value - * @property {number} DATA_READ=3 DATA_READ value - */ - AuditLogConfig.LogType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADMIN_READ"] = 1; - values[valuesById[2] = "DATA_WRITE"] = 2; - values[valuesById[3] = "DATA_READ"] = 3; - return values; - })(); - - return AuditLogConfig; - })(); - - v1.PolicyDelta = (function() { - - /** - * Properties of a PolicyDelta. - * @memberof google.iam.v1 - * @interface IPolicyDelta - * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas - * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas - */ - - /** - * Constructs a new PolicyDelta. - * @memberof google.iam.v1 - * @classdesc Represents a PolicyDelta. - * @implements IPolicyDelta - * @constructor - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - */ - function PolicyDelta(properties) { - this.bindingDeltas = []; - this.auditConfigDeltas = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PolicyDelta bindingDeltas. - * @member {Array.} bindingDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.bindingDeltas = $util.emptyArray; - - /** - * PolicyDelta auditConfigDeltas. - * @member {Array.} auditConfigDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance - */ - PolicyDelta.create = function create(properties) { - return new PolicyDelta(properties); - }; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bindingDeltas != null && message.bindingDeltas.length) - for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) - for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolicyDelta message. - * @function verify - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { - if (!Array.isArray(message.bindingDeltas)) - return "bindingDeltas: array expected"; - for (var i = 0; i < message.bindingDeltas.length; ++i) { - var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); - if (error) - return "bindingDeltas." + error; - } - } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { - if (!Array.isArray(message.auditConfigDeltas)) - return "auditConfigDeltas: array expected"; - for (var i = 0; i < message.auditConfigDeltas.length; ++i) { - var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); - if (error) - return "auditConfigDeltas." + error; - } - } - return null; - }; - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - */ - PolicyDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.PolicyDelta) - return object; - var message = new $root.google.iam.v1.PolicyDelta(); - if (object.bindingDeltas) { - if (!Array.isArray(object.bindingDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); - message.bindingDeltas = []; - for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); - message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); - } - } - if (object.auditConfigDeltas) { - if (!Array.isArray(object.auditConfigDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); - message.auditConfigDeltas = []; - for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); - message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.PolicyDelta} message PolicyDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindingDeltas = []; - object.auditConfigDeltas = []; - } - if (message.bindingDeltas && message.bindingDeltas.length) { - object.bindingDeltas = []; - for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); - } - if (message.auditConfigDeltas && message.auditConfigDeltas.length) { - object.auditConfigDeltas = []; - for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); - } - return object; - }; - - /** - * Converts this PolicyDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.PolicyDelta - * @instance - * @returns {Object.} JSON object - */ - PolicyDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolicyDelta - * @function getTypeUrl - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; - }; - - return PolicyDelta; - })(); - - v1.BindingDelta = (function() { - - /** - * Properties of a BindingDelta. - * @memberof google.iam.v1 - * @interface IBindingDelta - * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action - * @property {string|null} [role] BindingDelta role - * @property {string|null} [member] BindingDelta member - * @property {google.type.IExpr|null} [condition] BindingDelta condition - */ - - /** - * Constructs a new BindingDelta. - * @memberof google.iam.v1 - * @classdesc Represents a BindingDelta. - * @implements IBindingDelta - * @constructor - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - */ - function BindingDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BindingDelta action. - * @member {google.iam.v1.BindingDelta.Action} action - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.action = 0; - - /** - * BindingDelta role. - * @member {string} role - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.role = ""; - - /** - * BindingDelta member. - * @member {string} member - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.member = ""; - - /** - * BindingDelta condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.condition = null; - - /** - * Creates a new BindingDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - * @returns {google.iam.v1.BindingDelta} BindingDelta instance - */ - BindingDelta.create = function create(properties) { - return new BindingDelta(properties); - }; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && Object.hasOwnProperty.call(message, "member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.role = reader.string(); - break; - } - case 3: { - message.member = reader.string(); - break; - } - case 4: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BindingDelta message. - * @function verify - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BindingDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.BindingDelta} BindingDelta - */ - BindingDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.BindingDelta) - return object; - var message = new $root.google.iam.v1.BindingDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.BindingDelta} message BindingDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BindingDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - object.condition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this BindingDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.BindingDelta - * @instance - * @returns {Object.} JSON object - */ - BindingDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BindingDelta - * @function getTypeUrl - * @memberof google.iam.v1.BindingDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.BindingDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.BindingDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - BindingDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return BindingDelta; - })(); - - v1.AuditConfigDelta = (function() { - - /** - * Properties of an AuditConfigDelta. - * @memberof google.iam.v1 - * @interface IAuditConfigDelta - * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action - * @property {string|null} [service] AuditConfigDelta service - * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember - * @property {string|null} [logType] AuditConfigDelta logType - */ - - /** - * Constructs a new AuditConfigDelta. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfigDelta. - * @implements IAuditConfigDelta - * @constructor - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - */ - function AuditConfigDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfigDelta action. - * @member {google.iam.v1.AuditConfigDelta.Action} action - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.action = 0; - - /** - * AuditConfigDelta service. - * @member {string} service - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.service = ""; - - /** - * AuditConfigDelta exemptedMember. - * @member {string} exemptedMember - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.exemptedMember = ""; - - /** - * AuditConfigDelta logType. - * @member {string} logType - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.logType = ""; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance - */ - AuditConfigDelta.create = function create(properties) { - return new AuditConfigDelta(properties); - }; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); - return writer; - }; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - case 3: { - message.exemptedMember = reader.string(); - break; - } - case 4: { - message.logType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfigDelta message. - * @function verify - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfigDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - if (!$util.isString(message.exemptedMember)) - return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - if (!$util.isString(message.logType)) - return "logType: string expected"; - return null; - }; - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - */ - AuditConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfigDelta) - return object; - var message = new $root.google.iam.v1.AuditConfigDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.service != null) - message.service = String(object.service); - if (object.exemptedMember != null) - message.exemptedMember = String(object.exemptedMember); - if (object.logType != null) - message.logType = String(object.logType); - return message; - }; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.service = ""; - object.exemptedMember = ""; - object.logType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = message.logType; - return object; - }; - - /** - * Converts this AuditConfigDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfigDelta - * @instance - * @returns {Object.} JSON object - */ - AuditConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfigDelta - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.AuditConfigDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - AuditConfigDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return AuditConfigDelta; - })(); - - return v1; - })(); - - return iam; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Expr = (function() { - - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ - - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; - - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; - - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; - - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; - - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.expression = reader.string(); - break; - } - case 2: { - message.title = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.location = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Expr - * @function getTypeUrl - * @memberof google.type.Expr - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Expr"; - }; - - return Expr; - })(); - - return type; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-run/protos/protos.json b/owl-bot-staging/google-cloud-run/protos/protos.json deleted file mode 100644 index cdebe0a282b..00000000000 --- a/owl-bot-staging/google-cloud-run/protos/protos.json +++ /dev/null @@ -1,7802 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "run": { - "nested": { - "v2": { - "options": { - "go_package": "cloud.google.com/go/run/apiv2/runpb;runpb", - "java_multiple_files": true, - "java_outer_classname": "WorkerPoolRevisionTemplateProto", - "java_package": "com.google.cloud.run.v2", - "(google.api.resource_definition).type": "cloudbuild.googleapis.com/Build", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/builds/{build}" - }, - "nested": { - "Builds": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "SubmitBuild": { - "requestType": "SubmitBuildRequest", - "responseType": "SubmitBuildResponse", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/builds:submit", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/builds:submit", - "body": "*" - } - } - ] - } - } - }, - "SubmitBuildRequest": { - "oneofs": { - "source": { - "oneof": [ - "storageSource" - ] - }, - "buildType": { - "oneof": [ - "buildpackBuild", - "dockerBuild" - ] - } - }, - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "storageSource": { - "type": "StorageSource", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "imageUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "buildpackBuild": { - "type": "BuildpacksBuild", - "id": 4 - }, - "dockerBuild": { - "type": "DockerBuild", - "id": 5 - }, - "serviceAccount": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "workerPool": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudbuild.googleapis.com/BuildWorkerPool" - } - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "machineType": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "releaseTrack": { - "type": "google.api.LaunchStage", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "client": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "DockerBuild": { - "fields": {} - }, - "BuildpacksBuild": { - "fields": { - "runtime": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "functionTarget": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cacheImageUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "baseImage": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "environmentVariables": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableAutomaticUpdates": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "projectDescriptor": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "SubmitBuildResponse": { - "fields": { - "buildOperation": { - "type": "google.longrunning.Operation", - "id": 1 - }, - "baseImageUri": { - "type": "string", - "id": 2 - }, - "baseImageWarning": { - "type": "string", - "id": 3 - } - } - }, - "StorageSource": { - "fields": { - "bucket": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "object": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Condition": { - "oneofs": { - "reasons": { - "oneof": [ - "reason", - "revisionReason", - "executionReason" - ] - } - }, - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "state": { - "type": "State", - "id": 2 - }, - "message": { - "type": "string", - "id": 3 - }, - "lastTransitionTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "severity": { - "type": "Severity", - "id": 5 - }, - "reason": { - "type": "CommonReason", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "revisionReason": { - "type": "RevisionReason", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executionReason": { - "type": "ExecutionReason", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CONDITION_PENDING": 1, - "CONDITION_RECONCILING": 2, - "CONDITION_FAILED": 3, - "CONDITION_SUCCEEDED": 4 - } - }, - "Severity": { - "values": { - "SEVERITY_UNSPECIFIED": 0, - "ERROR": 1, - "WARNING": 2, - "INFO": 3 - } - }, - "CommonReason": { - "values": { - "COMMON_REASON_UNDEFINED": 0, - "UNKNOWN": 1, - "REVISION_FAILED": 3, - "PROGRESS_DEADLINE_EXCEEDED": 4, - "CONTAINER_MISSING": 6, - "CONTAINER_PERMISSION_DENIED": 7, - "CONTAINER_IMAGE_UNAUTHORIZED": 8, - "CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED": 9, - "ENCRYPTION_KEY_PERMISSION_DENIED": 10, - "ENCRYPTION_KEY_CHECK_FAILED": 11, - "SECRETS_ACCESS_CHECK_FAILED": 12, - "WAITING_FOR_OPERATION": 13, - "IMMEDIATE_RETRY": 14, - "POSTPONED_RETRY": 15, - "INTERNAL": 16, - "VPC_NETWORK_NOT_FOUND": 17 - } - }, - "RevisionReason": { - "values": { - "REVISION_REASON_UNDEFINED": 0, - "PENDING": 1, - "RESERVE": 2, - "RETIRED": 3, - "RETIRING": 4, - "RECREATING": 5, - "HEALTH_CHECK_CONTAINER_ERROR": 6, - "CUSTOMIZED_PATH_RESPONSE_PENDING": 7, - "MIN_INSTANCES_NOT_PROVISIONED": 8, - "ACTIVE_REVISION_LIMIT_REACHED": 9, - "NO_DEPLOYMENT": 10, - "HEALTH_CHECK_SKIPPED": 11, - "MIN_INSTANCES_WARMING": 12 - } - }, - "ExecutionReason": { - "values": { - "EXECUTION_REASON_UNDEFINED": 0, - "JOB_STATUS_SERVICE_POLLING_ERROR": 1, - "NON_ZERO_EXIT_CODE": 2, - "CANCELLED": 3, - "CANCELLING": 4, - "DELETED": 5, - "DELAYED_START_PENDING": 6 - } - } - } - }, - "ContainerStatus": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "imageDigest": { - "type": "string", - "id": 2 - } - } - }, - "Executions": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GetExecution": { - "requestType": "GetExecutionRequest", - "responseType": "Execution", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListExecutions": { - "requestType": "ListExecutionsRequest", - "responseType": "ListExecutionsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*/jobs/*}/executions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*/jobs/*}/executions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteExecution": { - "requestType": "DeleteExecutionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Execution", - "(google.longrunning.operation_info).metadata_type": "Execution" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Execution", - "metadata_type": "Execution" - } - } - ] - }, - "CancelExecution": { - "requestType": "CancelExecutionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Execution", - "(google.longrunning.operation_info).metadata_type": "Execution" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Execution", - "metadata_type": "Execution" - } - } - ] - } - } - }, - "GetExecutionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Execution" - } - } - } - }, - "ListExecutionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Execution" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListExecutionsResponse": { - "fields": { - "executions": { - "rule": "repeated", - "type": "Execution", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteExecutionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Execution" - } - }, - "validateOnly": { - "type": "bool", - "id": 2 - }, - "etag": { - "type": "string", - "id": 3 - } - } - }, - "CancelExecutionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Execution" - } - }, - "validateOnly": { - "type": "bool", - "id": 2 - }, - "etag": { - "type": "string", - "id": 3 - } - } - }, - "Execution": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Execution", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "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" - } - }, - "creator": { - "type": "string", - "id": 32, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "completionTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 11 - }, - "job": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Job" - } - }, - "parallelism": { - "type": "int32", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "taskCount": { - "type": "int32", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "template": { - "type": "TaskTemplate", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "observedGeneration": { - "type": "int64", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "runningCount": { - "type": "int32", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "succeededCount": { - "type": "int32", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "failedCount": { - "type": "int32", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cancelledCount": { - "type": "int32", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "retriedCount": { - "type": "int32", - "id": 25, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logUri": { - "type": "string", - "id": 26, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 27, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "TaskTemplate": { - "oneofs": { - "retries": { - "oneof": [ - "maxRetries" - ] - }, - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "fields": { - "containers": { - "rule": "repeated", - "type": "Container", - "id": 1 - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxRetries": { - "type": "int32", - "id": 3 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "executionEnvironment": { - "type": "ExecutionEnvironment", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKey": { - "type": "string", - "id": 7, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "Container": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "image": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sourceCode": { - "type": "SourceCode", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "command": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "env": { - "rule": "repeated", - "type": "EnvVar", - "id": 5 - }, - "resources": { - "type": "ResourceRequirements", - "id": 6 - }, - "ports": { - "rule": "repeated", - "type": "ContainerPort", - "id": 7 - }, - "volumeMounts": { - "rule": "repeated", - "type": "VolumeMount", - "id": 8 - }, - "workingDir": { - "type": "string", - "id": 9 - }, - "livenessProbe": { - "type": "Probe", - "id": 10 - }, - "startupProbe": { - "type": "Probe", - "id": 11 - }, - "readinessProbe": { - "type": "Probe", - "id": 14 - }, - "dependsOn": { - "rule": "repeated", - "type": "string", - "id": 12 - }, - "baseImageUri": { - "type": "string", - "id": 13 - }, - "buildInfo": { - "type": "BuildInfo", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ResourceRequirements": { - "fields": { - "limits": { - "keyType": "string", - "type": "string", - "id": 1 - }, - "cpuIdle": { - "type": "bool", - "id": 2 - }, - "startupCpuBoost": { - "type": "bool", - "id": 3 - } - } - }, - "EnvVar": { - "oneofs": { - "values": { - "oneof": [ - "value", - "valueSource" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "value": { - "type": "string", - "id": 2 - }, - "valueSource": { - "type": "EnvVarSource", - "id": 3 - } - } - }, - "EnvVarSource": { - "fields": { - "secretKeyRef": { - "type": "SecretKeySelector", - "id": 1 - } - } - }, - "SecretKeySelector": { - "fields": { - "secret": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "secretmanager.googleapis.com/Secret" - } - }, - "version": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" - } - } - } - }, - "ContainerPort": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "containerPort": { - "type": "int32", - "id": 3 - } - } - }, - "VolumeMount": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "mountPath": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "subPath": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Volume": { - "oneofs": { - "volumeType": { - "oneof": [ - "secret", - "cloudSqlInstance", - "emptyDir", - "nfs", - "gcs" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "secret": { - "type": "SecretVolumeSource", - "id": 2 - }, - "cloudSqlInstance": { - "type": "CloudSqlInstance", - "id": 3 - }, - "emptyDir": { - "type": "EmptyDirVolumeSource", - "id": 4 - }, - "nfs": { - "type": "NFSVolumeSource", - "id": 5 - }, - "gcs": { - "type": "GCSVolumeSource", - "id": 6 - } - } - }, - "SecretVolumeSource": { - "fields": { - "secret": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "items": { - "rule": "repeated", - "type": "VersionToPath", - "id": 2 - }, - "defaultMode": { - "type": "int32", - "id": 3 - } - } - }, - "VersionToPath": { - "fields": { - "path": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "version": { - "type": "string", - "id": 2 - }, - "mode": { - "type": "int32", - "id": 3 - } - } - }, - "CloudSqlInstance": { - "fields": { - "instances": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "EmptyDirVolumeSource": { - "fields": { - "medium": { - "type": "Medium", - "id": 1 - }, - "sizeLimit": { - "type": "string", - "id": 2 - } - }, - "nested": { - "Medium": { - "values": { - "MEDIUM_UNSPECIFIED": 0, - "MEMORY": 1 - } - } - } - }, - "NFSVolumeSource": { - "fields": { - "server": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - }, - "readOnly": { - "type": "bool", - "id": 3 - } - } - }, - "GCSVolumeSource": { - "fields": { - "bucket": { - "type": "string", - "id": 1 - }, - "readOnly": { - "type": "bool", - "id": 2 - }, - "mountOptions": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "Probe": { - "oneofs": { - "probeType": { - "oneof": [ - "httpGet", - "tcpSocket", - "grpc" - ] - } - }, - "fields": { - "initialDelaySeconds": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeoutSeconds": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "periodSeconds": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "failureThreshold": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "httpGet": { - "type": "HTTPGetAction", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tcpSocket": { - "type": "TCPSocketAction", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "grpc": { - "type": "GRPCAction", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "HTTPGetAction": { - "fields": { - "path": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "httpHeaders": { - "rule": "repeated", - "type": "HTTPHeader", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "port": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "HTTPHeader": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "value": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "TCPSocketAction": { - "fields": { - "port": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GRPCAction": { - "fields": { - "port": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "service": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BuildInfo": { - "fields": { - "functionTarget": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sourceLocation": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "SourceCode": { - "oneofs": { - "sourceType": { - "oneof": [ - "cloudStorageSource" - ] - } - }, - "fields": { - "cloudStorageSource": { - "type": "CloudStorageSource", - "id": 1 - } - }, - "nested": { - "CloudStorageSource": { - "fields": { - "bucket": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "object": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "VpcAccess": { - "fields": { - "connector": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "vpcaccess.googleapis.com/Connector" - } - }, - "egress": { - "type": "VpcEgress", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkInterfaces": { - "rule": "repeated", - "type": "NetworkInterface", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "VpcEgress": { - "values": { - "VPC_EGRESS_UNSPECIFIED": 0, - "ALL_TRAFFIC": 1, - "PRIVATE_RANGES_ONLY": 2 - } - }, - "NetworkInterface": { - "fields": { - "network": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subnetwork": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "BinaryAuthorization": { - "oneofs": { - "binauthzMethod": { - "oneof": [ - "useDefault", - "policy" - ] - } - }, - "fields": { - "useDefault": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "policy": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "binaryauthorization.googleapis.com/Policy" - } - }, - "breakglassJustification": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RevisionScaling": { - "fields": { - "minInstanceCount": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxInstanceCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ServiceMesh": { - "fields": { - "mesh": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "networkservices.googleapis.com/Mesh" - } - } - } - }, - "ServiceScaling": { - "oneofs": { - "_manualInstanceCount": { - "oneof": [ - "manualInstanceCount" - ] - } - }, - "fields": { - "minInstanceCount": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scalingMode": { - "type": "ScalingMode", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxInstanceCount": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "manualInstanceCount": { - "type": "int32", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "ScalingMode": { - "values": { - "SCALING_MODE_UNSPECIFIED": 0, - "AUTOMATIC": 1, - "MANUAL": 2 - } - } - } - }, - "WorkerPoolScaling": { - "oneofs": { - "_manualInstanceCount": { - "oneof": [ - "manualInstanceCount" - ] - } - }, - "fields": { - "manualInstanceCount": { - "type": "int32", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "NodeSelector": { - "fields": { - "accelerator": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BuildConfig": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" - } - }, - "sourceLocation": { - "type": "string", - "id": 2 - }, - "functionTarget": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "imageUri": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "baseImage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableAutomaticUpdates": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "workerPool": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudbuild.googleapis.com/BuildWorkerPool" - } - }, - "environmentVariables": { - "keyType": "string", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "IngressTraffic": { - "values": { - "INGRESS_TRAFFIC_UNSPECIFIED": 0, - "INGRESS_TRAFFIC_ALL": 1, - "INGRESS_TRAFFIC_INTERNAL_ONLY": 2, - "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": 3, - "INGRESS_TRAFFIC_NONE": 4 - } - }, - "ExecutionEnvironment": { - "values": { - "EXECUTION_ENVIRONMENT_UNSPECIFIED": 0, - "EXECUTION_ENVIRONMENT_GEN1": 1, - "EXECUTION_ENVIRONMENT_GEN2": 2 - } - }, - "EncryptionKeyRevocationAction": { - "values": { - "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": 0, - "PREVENT_NEW": 1, - "SHUTDOWN": 2 - } - }, - "ExecutionTemplate": { - "fields": { - "labels": { - "keyType": "string", - "type": "string", - "id": 1 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "parallelism": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "taskCount": { - "type": "int32", - "id": 4 - }, - "template": { - "type": "TaskTemplate", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Instances": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateInstance": { - "requestType": "CreateInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/instances", - "(google.api.http).body": "instance", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent,instance", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "Instance" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/instances", - "body": "instance" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent,instance" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "Instance" - } - } - ] - }, - "DeleteInstance": { - "requestType": "DeleteInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/instances/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "Instance" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/instances/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "Instance" - } - } - ] - }, - "GetInstance": { - "requestType": "GetInstanceRequest", - "responseType": "Instance", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/instances/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/instances/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListInstances": { - "requestType": "ListInstancesRequest", - "responseType": "ListInstancesResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/instances", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*}/instances" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "StopInstance": { - "requestType": "StopInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/instances/*}:stop", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "Instance" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/instances/*}:stop", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "Instance" - } - } - ] - }, - "StartInstance": { - "requestType": "StartInstanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/instances/*}:start", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Instance", - "(google.longrunning.operation_info).metadata_type": "Instance" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/instances/*}:start", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Instance", - "metadata_type": "Instance" - } - } - ] - } - } - }, - "CreateInstanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Instance" - } - }, - "instance": { - "type": "Instance", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instanceId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Instance" - } - } - } - }, - "DeleteInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Instance" - } - }, - "validateOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Instance" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "showDeleted": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListInstancesResponse": { - "fields": { - "instances": { - "rule": "repeated", - "type": "Instance", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "StopInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Instance" - } - }, - "validateOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "StartInstanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Instance" - } - }, - "validateOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Instance": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Instance", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}", - "(google.api.resource).plural": "instances", - "(google.api.resource).singular": "instance" - }, - "oneofs": { - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 3 - }, - "uid": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generation": { - "type": "int64", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 7 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastModifier": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "client": { - "type": "string", - "id": 14 - }, - "clientVersion": { - "type": "string", - "id": 15 - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 16 - }, - "binaryAuthorization": { - "type": "BinaryAuthorization", - "id": 17 - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 19 - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 20, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 21 - }, - "encryptionKey": { - "type": "string", - "id": 22, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "encryptionKeyRevocationAction": { - "type": "EncryptionKeyRevocationAction", - "id": 24 - }, - "encryptionKeyShutdownDuration": { - "type": "google.protobuf.Duration", - "id": 25 - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 26, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "ingress": { - "type": "IngressTraffic", - "id": 28, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "invokerIamDisabled": { - "type": "bool", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "iapEnabled": { - "type": "bool", - "id": 30, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "observedGeneration": { - "type": "int64", - "id": 40, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logUri": { - "type": "string", - "id": 41, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "terminalCondition": { - "type": "Condition", - "id": 42, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 43, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "containerStatuses": { - "rule": "repeated", - "type": "ContainerStatus", - "id": 44, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 46, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "urls": { - "rule": "repeated", - "type": "string", - "id": 45, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 98, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstanceSplit": { - "fields": { - "type": { - "type": "InstanceSplitAllocationType", - "id": 1 - }, - "revision": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "percent": { - "type": "int32", - "id": 3 - } - } - }, - "InstanceSplitStatus": { - "fields": { - "type": { - "type": "InstanceSplitAllocationType", - "id": 1 - }, - "revision": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "percent": { - "type": "int32", - "id": 3 - } - } - }, - "InstanceSplitAllocationType": { - "values": { - "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED": 0, - "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST": 1, - "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION": 2 - } - }, - "Jobs": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateJob": { - "requestType": "CreateJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/jobs", - "(google.api.http).body": "job", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent,job,job_id", - "(google.longrunning.operation_info).response_type": "Job", - "(google.longrunning.operation_info).metadata_type": "Job" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/jobs", - "body": "job" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent,job,job_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Job", - "metadata_type": "Job" - } - } - ] - }, - "GetJob": { - "requestType": "GetJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/jobs/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListJobs": { - "requestType": "ListJobsRequest", - "responseType": "ListJobsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/jobs", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*}/jobs" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateJob": { - "requestType": "UpdateJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v2/{job.name=projects/*/locations/*/jobs/*}", - "(google.api.http).body": "job", - "(google.api.routing).routing_parameters.field": "job.name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "job", - "(google.longrunning.operation_info).response_type": "Job", - "(google.longrunning.operation_info).metadata_type": "Job" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{job.name=projects/*/locations/*/jobs/*}", - "body": "job" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "job.name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "job" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Job", - "metadata_type": "Job" - } - } - ] - }, - "DeleteJob": { - "requestType": "DeleteJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/jobs/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Job", - "(google.longrunning.operation_info).metadata_type": "Job" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Job", - "metadata_type": "Job" - } - } - ] - }, - "RunJob": { - "requestType": "RunJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/jobs/*}:run", - "(google.api.http).body": "*", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Execution", - "(google.longrunning.operation_info).metadata_type": "Execution" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/jobs/*}:run", - "body": "*" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Execution", - "metadata_type": "Execution" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).get": "/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{resource=projects/*/locations/*/jobs/*}:getIamPolicy" - } - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/jobs/*}:setIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/jobs/*}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "CreateJobRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Job" - } - }, - "job": { - "type": "Job", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "jobId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 4 - } - } - }, - "GetJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Job" - } - } - } - }, - "UpdateJobRequest": { - "fields": { - "job": { - "type": "Job", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 3 - }, - "allowMissing": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListJobsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Job" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListJobsResponse": { - "fields": { - "jobs": { - "rule": "repeated", - "type": "Job", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Job" - } - }, - "validateOnly": { - "type": "bool", - "id": 3 - }, - "etag": { - "type": "string", - "id": 4 - } - } - }, - "RunJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Job" - } - }, - "validateOnly": { - "type": "bool", - "id": 2 - }, - "etag": { - "type": "string", - "id": 3 - }, - "overrides": { - "type": "Overrides", - "id": 4 - } - }, - "nested": { - "Overrides": { - "fields": { - "containerOverrides": { - "rule": "repeated", - "type": "ContainerOverride", - "id": 1 - }, - "taskCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - }, - "nested": { - "ContainerOverride": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "env": { - "rule": "repeated", - "type": "EnvVar", - "id": 3 - }, - "clearArgs": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - } - } - }, - "Job": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Job", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "createExecution": { - "oneof": [ - "startExecutionToken", - "runExecutionToken" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "uid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4 - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 5 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastModifier": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "client": { - "type": "string", - "id": 12 - }, - "clientVersion": { - "type": "string", - "id": 13 - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 14 - }, - "binaryAuthorization": { - "type": "BinaryAuthorization", - "id": 15 - }, - "template": { - "type": "ExecutionTemplate", - "id": 16, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "observedGeneration": { - "type": "int64", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "terminalCondition": { - "type": "Condition", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executionCount": { - "type": "int32", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latestCreatedExecution": { - "type": "ExecutionReference", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 25, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startExecutionToken": { - "type": "string", - "id": 26 - }, - "runExecutionToken": { - "type": "string", - "id": 27 - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecutionReference": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "run.googleapis.com/Execution" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "completionTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "completionStatus": { - "type": "CompletionStatus", - "id": 4 - } - }, - "nested": { - "CompletionStatus": { - "values": { - "COMPLETION_STATUS_UNSPECIFIED": 0, - "EXECUTION_SUCCEEDED": 1, - "EXECUTION_FAILED": 2, - "EXECUTION_RUNNING": 3, - "EXECUTION_PENDING": 4, - "EXECUTION_CANCELLED": 5 - } - } - } - }, - "Revisions": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GetRevision": { - "requestType": "GetRevisionRequest", - "responseType": "Revision", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", - "additional_bindings": { - "get": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" - } - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListRevisions": { - "requestType": "ListRevisionsRequest", - "responseType": "ListRevisionsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*/services/*}/revisions", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*/workerPools/*}/revisions", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*/services/*}/revisions", - "additional_bindings": { - "get": "/v2/{parent=projects/*/locations/*/workerPools/*}/revisions" - } - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteRevision": { - "requestType": "DeleteRevisionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", - "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Revision", - "(google.longrunning.operation_info).metadata_type": "Revision" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/services/*/revisions/*}", - "additional_bindings": { - "delete": "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}" - } - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Revision", - "metadata_type": "Revision" - } - } - ] - } - } - }, - "GetRevisionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - } - } - }, - "ListRevisionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Revision" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListRevisionsResponse": { - "fields": { - "revisions": { - "rule": "repeated", - "type": "Revision", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteRevisionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "validateOnly": { - "type": "bool", - "id": 2 - }, - "etag": { - "type": "string", - "id": 3 - } - } - }, - "Revision": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Revision", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/services/{service}/revisions/{revision}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "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" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 10 - }, - "service": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Service" - } - }, - "scaling": { - "type": "RevisionScaling", - "id": 12 - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 13 - }, - "maxInstanceRequestConcurrency": { - "type": "int32", - "id": 34 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 15 - }, - "serviceAccount": { - "type": "string", - "id": 16 - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 17 - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 18 - }, - "executionEnvironment": { - "type": "ExecutionEnvironment", - "id": 20 - }, - "encryptionKey": { - "type": "string", - "id": 21, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "serviceMesh": { - "type": "ServiceMesh", - "id": 22 - }, - "encryptionKeyRevocationAction": { - "type": "EncryptionKeyRevocationAction", - "id": 23 - }, - "encryptionKeyShutdownDuration": { - "type": "google.protobuf.Duration", - "id": 24 - }, - "reconciling": { - "type": "bool", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 31, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "observedGeneration": { - "type": "int64", - "id": 32, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logUri": { - "type": "string", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 37, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sessionAffinity": { - "type": "bool", - "id": 38 - }, - "scalingStatus": { - "type": "RevisionScalingStatus", - "id": 39, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 40 - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 48, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "creator": { - "type": "string", - "id": 49, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "RevisionScalingStatus": { - "fields": { - "desiredMinInstanceCount": { - "type": "int32", - "id": 1 - } - } - }, - "RevisionTemplate": { - "oneofs": { - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "fields": { - "revision": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scaling": { - "type": "RevisionScaling", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 10 - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "executionEnvironment": { - "type": "ExecutionEnvironment", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKey": { - "type": "string", - "id": 14, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "maxInstanceRequestConcurrency": { - "type": "int32", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceMesh": { - "type": "ServiceMesh", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKeyRevocationAction": { - "type": "EncryptionKeyRevocationAction", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKeyShutdownDuration": { - "type": "google.protobuf.Duration", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sessionAffinity": { - "type": "bool", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "healthCheckDisabled": { - "type": "bool", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 21, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 24, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "Services": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateService": { - "requestType": "CreateServiceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/services", - "(google.api.http).body": "service", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent,service,service_id", - "(google.longrunning.operation_info).response_type": "Service", - "(google.longrunning.operation_info).metadata_type": "Service" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/services", - "body": "service" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent,service,service_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Service", - "metadata_type": "Service" - } - } - ] - }, - "GetService": { - "requestType": "GetServiceRequest", - "responseType": "Service", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/services/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/services/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListServices": { - "requestType": "ListServicesRequest", - "responseType": "ListServicesResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/services", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*}/services" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateService": { - "requestType": "UpdateServiceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v2/{service.name=projects/*/locations/*/services/*}", - "(google.api.http).body": "service", - "(google.api.routing).routing_parameters.field": "service.name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "service,update_mask", - "(google.longrunning.operation_info).response_type": "Service", - "(google.longrunning.operation_info).metadata_type": "Service" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{service.name=projects/*/locations/*/services/*}", - "body": "service" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "service.name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "service" - }, - { - "(google.api.method_signature)": "service,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Service", - "metadata_type": "Service" - } - } - ] - }, - "DeleteService": { - "requestType": "DeleteServiceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/services/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Service", - "(google.longrunning.operation_info).metadata_type": "Service" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/services/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Service", - "metadata_type": "Service" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).get": "/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{resource=projects/*/locations/*/services/*}:getIamPolicy" - } - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/services/*}:setIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/services/*}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "CreateServiceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Service" - } - }, - "service": { - "type": "Service", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "serviceId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 4 - } - } - }, - "UpdateServiceRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "service": { - "type": "Service", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 3 - }, - "allowMissing": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListServicesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Service" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListServicesResponse": { - "fields": { - "services": { - "rule": "repeated", - "type": "Service", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GetServiceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Service" - } - } - } - }, - "DeleteServiceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Service" - } - }, - "validateOnly": { - "type": "bool", - "id": 2 - }, - "etag": { - "type": "string", - "id": 3 - } - } - }, - "Service": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Service", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/services/{service}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "description": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generation": { - "type": "int64", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastModifier": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "client": { - "type": "string", - "id": 13 - }, - "clientVersion": { - "type": "string", - "id": 14 - }, - "ingress": { - "type": "IngressTraffic", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "binaryAuthorization": { - "type": "BinaryAuthorization", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "template": { - "type": "RevisionTemplate", - "id": 18, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "traffic": { - "rule": "repeated", - "type": "TrafficTarget", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scaling": { - "type": "ServiceScaling", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "invokerIamDisabled": { - "type": "bool", - "id": 21, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "defaultUriDisabled": { - "type": "bool", - "id": 22, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "urls": { - "rule": "repeated", - "type": "string", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "iapEnabled": { - "type": "bool", - "id": 25, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "multiRegionSettings": { - "type": "MultiRegionSettings", - "id": 26, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "customAudiences": { - "rule": "repeated", - "type": "string", - "id": 37 - }, - "observedGeneration": { - "type": "int64", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "terminalCondition": { - "type": "Condition", - "id": 31, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 32, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latestReadyRevision": { - "type": "string", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "latestCreatedRevision": { - "type": "string", - "id": 34, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "trafficStatuses": { - "rule": "repeated", - "type": "TrafficTargetStatus", - "id": 35, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "uri": { - "type": "string", - "id": 36, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 38, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "threatDetectionEnabled": { - "type": "bool", - "id": 40, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "buildConfig": { - "type": "BuildConfig", - "id": 41, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "reconciling": { - "type": "bool", - "id": 98, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "MultiRegionSettings": { - "fields": { - "regions": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "multiRegionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "TrafficTarget": { - "fields": { - "type": { - "type": "TrafficTargetAllocationType", - "id": 1 - }, - "revision": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "percent": { - "type": "int32", - "id": 3 - }, - "tag": { - "type": "string", - "id": 4 - } - } - }, - "TrafficTargetStatus": { - "fields": { - "type": { - "type": "TrafficTargetAllocationType", - "id": 1 - }, - "revision": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "percent": { - "type": "int32", - "id": 3 - }, - "tag": { - "type": "string", - "id": 4 - }, - "uri": { - "type": "string", - "id": 5 - } - } - }, - "TrafficTargetAllocationType": { - "values": { - "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED": 0, - "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST": 1, - "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION": 2 - } - }, - "Tasks": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "GetTask": { - "requestType": "GetTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/jobs/*/executions/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListTasks": { - "requestType": "ListTasksRequest", - "responseType": "ListTasksResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*/jobs/*/executions/*}/tasks" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "GetTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/Task" - } - } - } - }, - "ListTasksRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/Task" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListTasksResponse": { - "fields": { - "tasks": { - "rule": "repeated", - "type": "Task", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "Task": { - "options": { - "(google.api.resource).type": "run.googleapis.com/Task", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "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" - } - }, - "generation": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "scheduledTime": { - "type": "google.protobuf.Timestamp", - "id": 34, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 27, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "completionTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "job": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Job" - } - }, - "execution": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Execution" - } - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 14 - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 15 - }, - "maxRetries": { - "type": "int32", - "id": 16 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 17 - }, - "serviceAccount": { - "type": "string", - "id": 18 - }, - "executionEnvironment": { - "type": "ExecutionEnvironment", - "id": 20 - }, - "reconciling": { - "type": "bool", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "observedGeneration": { - "type": "int64", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "index": { - "type": "int32", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "retried": { - "type": "int32", - "id": 25, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastAttemptResult": { - "type": "TaskAttemptResult", - "id": 26, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "encryptionKey": { - "type": "string", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 29, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logUri": { - "type": "string", - "id": 32, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 36, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 37, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "TaskAttemptResult": { - "fields": { - "status": { - "type": "google.rpc.Status", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "exitCode": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "termSignal": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "WorkerPools": { - "options": { - "(google.api.default_host)": "run.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateWorkerPool": { - "requestType": "CreateWorkerPoolRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/workerPools", - "(google.api.http).body": "worker_pool", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent,worker_pool,worker_pool_id", - "(google.longrunning.operation_info).response_type": "WorkerPool", - "(google.longrunning.operation_info).metadata_type": "WorkerPool" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/workerPools", - "body": "worker_pool" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent,worker_pool,worker_pool_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "WorkerPool", - "metadata_type": "WorkerPool" - } - } - ] - }, - "GetWorkerPool": { - "requestType": "GetWorkerPoolRequest", - "responseType": "WorkerPool", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/workerPools/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/workerPools/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListWorkerPools": { - "requestType": "ListWorkerPoolsRequest", - "responseType": "ListWorkerPoolsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/workerPools", - "(google.api.routing).routing_parameters.field": "parent", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*}/workerPools" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "parent", - "path_template": "projects/*/locations/{location=*}" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateWorkerPool": { - "requestType": "UpdateWorkerPoolRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v2/{worker_pool.name=projects/*/locations/*/workerPools/*}", - "(google.api.http).body": "worker_pool", - "(google.api.routing).routing_parameters.field": "worker_pool.name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "worker_pool,update_mask", - "(google.longrunning.operation_info).response_type": "WorkerPool", - "(google.longrunning.operation_info).metadata_type": "WorkerPool" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{worker_pool.name=projects/*/locations/*/workerPools/*}", - "body": "worker_pool" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "worker_pool.name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "worker_pool" - }, - { - "(google.api.method_signature)": "worker_pool,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "WorkerPool", - "metadata_type": "WorkerPool" - } - } - ] - }, - "DeleteWorkerPool": { - "requestType": "DeleteWorkerPoolRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/workerPools/*}", - "(google.api.routing).routing_parameters.field": "name", - "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "WorkerPool", - "(google.longrunning.operation_info).metadata_type": "WorkerPool" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/workerPools/*}" - } - }, - { - "(google.api.routing)": { - "routing_parameters": { - "field": "name", - "path_template": "projects/*/locations/{location=*}/**" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "WorkerPool", - "metadata_type": "WorkerPool" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).get": "/v2/{resource=projects/*/locations/*/workerPools/*}:getIamPolicy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{resource=projects/*/locations/*/workerPools/*}:getIamPolicy" - } - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/workerPools/*}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/workerPools/*}:setIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/workerPools/*}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/workerPools/*}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "CreateWorkerPoolRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/WorkerPool" - } - }, - "workerPool": { - "type": "WorkerPool", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "workerPoolId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateWorkerPoolRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "workerPool": { - "type": "WorkerPool", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "validateOnly": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "forceNewRevision": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListWorkerPoolsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "run.googleapis.com/WorkerPool" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "showDeleted": { - "type": "bool", - "id": 4 - } - } - }, - "ListWorkerPoolsResponse": { - "fields": { - "workerPools": { - "rule": "repeated", - "type": "WorkerPool", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetWorkerPoolRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/WorkerPool" - } - } - } - }, - "DeleteWorkerPoolRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "run.googleapis.com/WorkerPool" - } - }, - "validateOnly": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 3 - } - } - }, - "WorkerPool": { - "options": { - "(google.api.resource).type": "run.googleapis.com/WorkerPool", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/workerPools/{worker_pool}", - "(google.api.resource).plural": "workerPools", - "(google.api.resource).singular": "workerPool", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - }, - "uid": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "generation": { - "type": "int64", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "creator": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastModifier": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "client": { - "type": "string", - "id": 13 - }, - "clientVersion": { - "type": "string", - "id": 14 - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "binaryAuthorization": { - "type": "BinaryAuthorization", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "template": { - "type": "WorkerPoolRevisionTemplate", - "id": 18, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "instanceSplits": { - "rule": "repeated", - "type": "InstanceSplit", - "id": 26, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scaling": { - "type": "WorkerPoolScaling", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "observedGeneration": { - "type": "int64", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "terminalCondition": { - "type": "Condition", - "id": 31, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "conditions": { - "rule": "repeated", - "type": "Condition", - "id": 32, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latestReadyRevision": { - "type": "string", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "latestCreatedRevision": { - "type": "string", - "id": 34, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "instanceSplitStatuses": { - "rule": "repeated", - "type": "InstanceSplitStatus", - "id": 27, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "threatDetectionEnabled": { - "type": "bool", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "customAudiences": { - "rule": "repeated", - "type": "string", - "id": 37 - }, - "satisfiesPzs": { - "type": "bool", - "id": 38, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reconciling": { - "type": "bool", - "id": 98, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "etag": { - "type": "string", - "id": 99, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "WorkerPoolRevisionTemplate": { - "oneofs": { - "_gpuZonalRedundancyDisabled": { - "oneof": [ - "gpuZonalRedundancyDisabled" - ] - } - }, - "fields": { - "revision": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "run.googleapis.com/Revision" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "vpcAccess": { - "type": "VpcAccess", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "containers": { - "rule": "repeated", - "type": "Container", - "id": 6 - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKey": { - "type": "string", - "id": 8, - "options": { - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - }, - "serviceMesh": { - "type": "ServiceMesh", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKeyRevocationAction": { - "type": "EncryptionKeyRevocationAction", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionKeyShutdownDuration": { - "type": "google.protobuf.Duration", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nodeSelector": { - "type": "NodeSelector", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gpuZonalRedundancyDisabled": { - "type": "bool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "RoutingProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "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 - } - }, - "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 - } - } - }, - "routing": { - "type": "google.api.RoutingRule", - "id": 72295729, - "extend": "google.protobuf.MethodOptions" - }, - "RoutingRule": { - "fields": { - "routingParameters": { - "rule": "repeated", - "type": "RoutingParameter", - "id": 2 - } - } - }, - "RoutingParameter": { - "fields": { - "field": { - "type": "string", - "id": 1 - }, - "pathTemplate": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - }, - "iam": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", - "java_multiple_files": true, - "java_outer_classname": "PolicyProto", - "java_package": "com.google.iam.v1", - "php_namespace": "Google\\Cloud\\Iam\\V1" - }, - "nested": { - "IAMPolicy": { - "options": { - "(google.api.default_host)": "iam-meta-api.googleapis.com" - }, - "methods": { - "SetIamPolicy": { - "requestType": "SetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:setIamPolicy", - "body": "*" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "GetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:getIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "TestIamPermissionsRequest", - "responseType": "TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "SetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "policy": { - "type": "Policy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 3 - } - } - }, - "GetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "options": { - "type": "GetPolicyOptions", - "id": 2 - } - } - }, - "TestIamPermissionsRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "permissions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TestIamPermissionsResponse": { - "fields": { - "permissions": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "GetPolicyOptions": { - "fields": { - "requestedPolicyVersion": { - "type": "int32", - "id": 1 - } - } - }, - "Policy": { - "fields": { - "version": { - "type": "int32", - "id": 1 - }, - "bindings": { - "rule": "repeated", - "type": "Binding", - "id": 4 - }, - "auditConfigs": { - "rule": "repeated", - "type": "AuditConfig", - "id": 6 - }, - "etag": { - "type": "bytes", - "id": 3 - } - } - }, - "Binding": { - "fields": { - "role": { - "type": "string", - "id": 1 - }, - "members": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "condition": { - "type": "google.type.Expr", - "id": 3 - } - } - }, - "AuditConfig": { - "fields": { - "service": { - "type": "string", - "id": 1 - }, - "auditLogConfigs": { - "rule": "repeated", - "type": "AuditLogConfig", - "id": 3 - } - } - }, - "AuditLogConfig": { - "fields": { - "logType": { - "type": "LogType", - "id": 1 - }, - "exemptedMembers": { - "rule": "repeated", - "type": "string", - "id": 2 - } - }, - "nested": { - "LogType": { - "values": { - "LOG_TYPE_UNSPECIFIED": 0, - "ADMIN_READ": 1, - "DATA_WRITE": 2, - "DATA_READ": 3 - } - } - } - }, - "PolicyDelta": { - "fields": { - "bindingDeltas": { - "rule": "repeated", - "type": "BindingDelta", - "id": 1 - }, - "auditConfigDeltas": { - "rule": "repeated", - "type": "AuditConfigDelta", - "id": 2 - } - } - }, - "BindingDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "role": { - "type": "string", - "id": 2 - }, - "member": { - "type": "string", - "id": 3 - }, - "condition": { - "type": "google.type.Expr", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - }, - "AuditConfigDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "service": { - "type": "string", - "id": 2 - }, - "exemptedMember": { - "type": "string", - "id": 3 - }, - "logType": { - "type": "string", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - } - } - } - } - }, - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", - "java_multiple_files": true, - "java_outer_classname": "ExprProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Expr": { - "fields": { - "expression": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js deleted file mode 100644 index c9e3c774387..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/builds.submit_build.js +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, storageSource, imageUri) { - // [START run_v2_generated_Builds_SubmitBuild_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 project and location to build in. Location must be a region, - * e.g., 'us-central1' or 'global' if the global builder is to be used. - * Format: - * `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Required. Source for the build. - */ - // const storageSource = {} - /** - * Required. Artifact Registry URI to store the built image. - */ - // const imageUri = 'abc123' - /** - * Build the source using Buildpacks. - */ - // const buildpackBuild = {} - /** - * Build the source using Docker. This means the source has a Dockerfile. - */ - // const dockerBuild = {} - /** - * Optional. The service account to use for the build. If not set, the default - * Cloud Build service account for the project will be used. - */ - // const serviceAccount = 'abc123' - /** - * Optional. Name of the Cloud Build Custom Worker Pool that should be used to - * build the function. The format of this field is - * `projects/{project}/locations/{region}/workerPools/{workerPool}` where - * `{project}` and `{region}` are the project id and region respectively where - * the worker pool is defined and `{workerPool}` is the short name of the - * worker pool. - */ - // const workerPool = 'abc123' - /** - * Optional. Additional tags to annotate the build. - */ - // const tags = ['abc','def'] - /** - * Optional. The machine type from default pool to use for the build. If left - * blank, cloudbuild will use a sensible default. Currently only E2_HIGHCPU_8 - * is supported. If worker_pool is set, this field will be ignored. - */ - // const machineType = 'abc123' - /** - * Optional. The release track of the client that initiated the build request. - */ - // const releaseTrack = {} - /** - * Optional. The client that initiated the build request. - */ - // const client = 'abc123' - - // Imports the Run library - const {BuildsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new BuildsClient(); - - async function callSubmitBuild() { - // Construct request - const request = { - parent, - storageSource, - imageUri, - }; - - // Run request - const response = await runClient.submitBuild(request); - console.log(response); - } - - callSubmitBuild(); - // [END run_v2_generated_Builds_SubmitBuild_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-run/samples/generated/v2/executions.cancel_execution.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.cancel_execution.js deleted file mode 100644 index e5d07e70ce6..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.cancel_execution.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Executions_CancelExecution_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 name of the Execution to cancel. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * cancelling any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {ExecutionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ExecutionsClient(); - - async function callCancelExecution() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.cancelExecution(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCancelExecution(); - // [END run_v2_generated_Executions_CancelExecution_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-run/samples/generated/v2/executions.delete_execution.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.delete_execution.js deleted file mode 100644 index 4cf6452e469..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.delete_execution.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Executions_DeleteExecution_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 name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {ExecutionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ExecutionsClient(); - - async function callDeleteExecution() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.deleteExecution(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteExecution(); - // [END run_v2_generated_Executions_DeleteExecution_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-run/samples/generated/v2/executions.get_execution.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.get_execution.js deleted file mode 100644 index d93f467a9d5..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.get_execution.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 run_v2_generated_Executions_GetExecution_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 full name of the Execution. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - */ - // const name = 'abc123' - - // Imports the Run library - const {ExecutionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ExecutionsClient(); - - async function callGetExecution() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getExecution(request); - console.log(response); - } - - callGetExecution(); - // [END run_v2_generated_Executions_GetExecution_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-run/samples/generated/v2/executions.list_executions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.list_executions.js deleted file mode 100644 index a7019ecc2e2..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/executions.list_executions.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_Executions_ListExecutions_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 Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - */ - // const parent = 'abc123' - /** - * Maximum number of Executions to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {ExecutionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ExecutionsClient(); - - async function callListExecutions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listExecutionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListExecutions(); - // [END run_v2_generated_Executions_ListExecutions_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-run/samples/generated/v2/jobs.create_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.create_job.js deleted file mode 100644 index f667a3423de..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.create_job.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, job, jobId) { - // [START run_v2_generated_Jobs_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 location and project in which this Job should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - */ - // const parent = 'abc123' - /** - * Required. The Job instance to create. - */ - // const job = {} - /** - * Required. The unique identifier for the Job. The name of the job becomes - * {parent}/jobs/{job_id}. - */ - // const jobId = 'abc123' - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - */ - // const validateOnly = true - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callCreateJob() { - // Construct request - const request = { - parent, - job, - jobId, - }; - - // Run request - const [operation] = await runClient.createJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateJob(); - // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.delete_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.delete_job.js deleted file mode 100644 index d1c47ab094f..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.delete_job.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Jobs_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. - */ - /** - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callDeleteJob() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.deleteJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteJob(); - // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.get_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js deleted file mode 100644 index b7a9ffdac4d..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource) { - // [START run_v2_generated_Jobs_GetIamPolicy_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 resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await runClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END run_v2_generated_Jobs_GetIamPolicy_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-run/samples/generated/v2/jobs.get_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_job.js deleted file mode 100644 index 14128597e57..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.get_job.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Jobs_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. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - */ - // const name = 'abc123' - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callGetJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getJob(request); - console.log(response); - } - - callGetJob(); - // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.list_jobs.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.list_jobs.js deleted file mode 100644 index 6841d7dd00f..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.list_jobs.js +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_Jobs_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. - */ - /** - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - */ - // const parent = 'abc123' - /** - * Maximum number of Jobs to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListJobs. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callListJobs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listJobsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListJobs(); - // [END run_v2_generated_Jobs_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-run/samples/generated/v2/jobs.run_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.run_job.js deleted file mode 100644 index 667b19a3569..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.run_job.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Jobs_RunJob_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 full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - /** - * Overrides specification for a given execution of a job. If provided, - * overrides will be applied to update the execution or task spec. - */ - // const overrides = {} - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callRunJob() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.runJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRunJob(); - // [END run_v2_generated_Jobs_RunJob_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-run/samples/generated/v2/jobs.set_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js deleted file mode 100644 index 252e9c83914..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, policy) { - // [START run_v2_generated_Jobs_SetIamPolicy_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 resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await runClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END run_v2_generated_Jobs_SetIamPolicy_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-run/samples/generated/v2/jobs.test_iam_permissions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js deleted file mode 100644 index 53cbddb3960..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, permissions) { - // [START run_v2_generated_Jobs_TestIamPermissions_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 resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = ['abc','def'] - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await runClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END run_v2_generated_Jobs_TestIamPermissions_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-run/samples/generated/v2/jobs.update_job.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.update_job.js deleted file mode 100644 index 3e18108e07c..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/jobs.update_job.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(job) { - // [START run_v2_generated_Jobs_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 be updated. - */ - // const job = {} - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - */ - // const validateOnly = true - /** - * Optional. If set to true, and if the Job does not exist, it will create a - * new one. Caller must have both create and update permissions for this call - * if this is set to true. - */ - // const allowMissing = true - - // Imports the Run library - const {JobsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new JobsClient(); - - async function callUpdateJob() { - // Construct request - const request = { - job, - }; - - // Run request - const [operation] = await runClient.updateJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateJob(); - // [END run_v2_generated_Jobs_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-run/samples/generated/v2/revisions.delete_revision.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.delete_revision.js deleted file mode 100644 index c8f2d93d6eb..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.delete_revision.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Revisions_DeleteRevision_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 name of the Revision to delete. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the - * resource. This may be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {RevisionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new RevisionsClient(); - - async function callDeleteRevision() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.deleteRevision(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteRevision(); - // [END run_v2_generated_Revisions_DeleteRevision_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-run/samples/generated/v2/revisions.get_revision.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.get_revision.js deleted file mode 100644 index c5388577b21..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.get_revision.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Revisions_GetRevision_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 full name of the Revision. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - */ - // const name = 'abc123' - - // Imports the Run library - const {RevisionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new RevisionsClient(); - - async function callGetRevision() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getRevision(request); - console.log(response); - } - - callGetRevision(); - // [END run_v2_generated_Revisions_GetRevision_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-run/samples/generated/v2/revisions.list_revisions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.list_revisions.js deleted file mode 100644 index 3ab293f98f7..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/revisions.list_revisions.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_Revisions_ListRevisions_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 Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - */ - // const parent = 'abc123' - /** - * Maximum number of revisions to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {RevisionsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new RevisionsClient(); - - async function callListRevisions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listRevisionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListRevisions(); - // [END run_v2_generated_Revisions_ListRevisions_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-run/samples/generated/v2/services.create_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.create_service.js deleted file mode 100644 index 6cec74a186b..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.create_service.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, service, serviceId) { - // [START run_v2_generated_Services_CreateService_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 location and project in which this service should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Only lowercase characters, digits, and hyphens. - */ - // const parent = 'abc123' - /** - * Required. The Service instance to create. - */ - // const service = {} - /** - * Required. The unique identifier for the Service. It must begin with letter, - * and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the service becomes {parent}/services/{service_id}. - */ - // const serviceId = 'abc123' - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - */ - // const validateOnly = true - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callCreateService() { - // Construct request - const request = { - parent, - service, - serviceId, - }; - - // Run request - const [operation] = await runClient.createService(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateService(); - // [END run_v2_generated_Services_CreateService_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-run/samples/generated/v2/services.delete_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.delete_service.js deleted file mode 100644 index 15fc933afbf..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.delete_service.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Services_DeleteService_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 full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - */ - // const name = 'abc123' - /** - * Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callDeleteService() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.deleteService(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteService(); - // [END run_v2_generated_Services_DeleteService_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-run/samples/generated/v2/services.get_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_iam_policy.js deleted file mode 100644 index 43c848a8036..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource) { - // [START run_v2_generated_Services_GetIamPolicy_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 resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await runClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END run_v2_generated_Services_GetIamPolicy_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-run/samples/generated/v2/services.get_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_service.js deleted file mode 100644 index 817c4f8129a..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.get_service.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Services_GetService_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 full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - */ - // const name = 'abc123' - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callGetService() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getService(request); - console.log(response); - } - - callGetService(); - // [END run_v2_generated_Services_GetService_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-run/samples/generated/v2/services.list_services.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.list_services.js deleted file mode 100644 index 609e3ca2e81..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.list_services.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_Services_ListServices_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 location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - */ - // const parent = 'abc123' - /** - * Maximum number of Services to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListServices. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callListServices() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listServicesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListServices(); - // [END run_v2_generated_Services_ListServices_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-run/samples/generated/v2/services.set_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.set_iam_policy.js deleted file mode 100644 index 64b239c5461..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, policy) { - // [START run_v2_generated_Services_SetIamPolicy_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 resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await runClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END run_v2_generated_Services_SetIamPolicy_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-run/samples/generated/v2/services.test_iam_permissions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js deleted file mode 100644 index d69dc7c7991..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, permissions) { - // [START run_v2_generated_Services_TestIamPermissions_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 resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = ['abc','def'] - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await runClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END run_v2_generated_Services_TestIamPermissions_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-run/samples/generated/v2/services.update_service.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/services.update_service.js deleted file mode 100644 index fff4ac4ad3f..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/services.update_service.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(service) { - // [START run_v2_generated_Services_UpdateService_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. - */ - /** - * Optional. The list of fields to be updated. - */ - // const updateMask = {} - /** - * Required. The Service to be updated. - */ - // const service = {} - /** - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - */ - // const validateOnly = true - /** - * Optional. If set to true, and if the Service does not exist, it will create - * a new one. The caller must have 'run.services.create' permissions if this - * is set to true and the Service does not exist. - */ - // const allowMissing = true - - // Imports the Run library - const {ServicesClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new ServicesClient(); - - async function callUpdateService() { - // Construct request - const request = { - service, - }; - - // Run request - const [operation] = await runClient.updateService(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateService(); - // [END run_v2_generated_Services_UpdateService_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-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json b/owl-bot-staging/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json deleted file mode 100644 index 4ff250fc8b5..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json +++ /dev/null @@ -1,1995 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-run", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.run.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "regionTag": "run_v2_generated_Builds_SubmitBuild_async", - "title": "Builds submitBuild Sample", - "origin": "API_DEFINITION", - "description": " Submits a build in a given project.", - "canonical": true, - "file": "builds.submit_build.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 106, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SubmitBuild", - "fullName": "google.cloud.run.v2.Builds.SubmitBuild", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "storage_source", - "type": ".google.cloud.run.v2.StorageSource" - }, - { - "name": "image_uri", - "type": "TYPE_STRING" - }, - { - "name": "buildpack_build", - "type": ".google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild" - }, - { - "name": "docker_build", - "type": ".google.cloud.run.v2.SubmitBuildRequest.DockerBuild" - }, - { - "name": "service_account", - "type": "TYPE_STRING" - }, - { - "name": "worker_pool", - "type": "TYPE_STRING" - }, - { - "name": "tags", - "type": "TYPE_STRING[]" - }, - { - "name": "machine_type", - "type": "TYPE_STRING" - }, - { - "name": "release_track", - "type": ".google.api.LaunchStage" - }, - { - "name": "client", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.SubmitBuildResponse", - "client": { - "shortName": "BuildsClient", - "fullName": "google.cloud.run.v2.BuildsClient" - }, - "method": { - "shortName": "SubmitBuild", - "fullName": "google.cloud.run.v2.Builds.SubmitBuild", - "service": { - "shortName": "Builds", - "fullName": "google.cloud.run.v2.Builds" - } - } - } - }, - { - "regionTag": "run_v2_generated_Executions_GetExecution_async", - "title": "Builds getExecution Sample", - "origin": "API_DEFINITION", - "description": " Gets information about an Execution.", - "canonical": true, - "file": "executions.get_execution.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetExecution", - "fullName": "google.cloud.run.v2.Executions.GetExecution", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Execution", - "client": { - "shortName": "ExecutionsClient", - "fullName": "google.cloud.run.v2.ExecutionsClient" - }, - "method": { - "shortName": "GetExecution", - "fullName": "google.cloud.run.v2.Executions.GetExecution", - "service": { - "shortName": "Executions", - "fullName": "google.cloud.run.v2.Executions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Executions_ListExecutions_async", - "title": "Builds listExecutions Sample", - "origin": "API_DEFINITION", - "description": " Lists Executions from a Job. Results are sorted by creation time, descending.", - "canonical": true, - "file": "executions.list_executions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListExecutions", - "fullName": "google.cloud.run.v2.Executions.ListExecutions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListExecutionsResponse", - "client": { - "shortName": "ExecutionsClient", - "fullName": "google.cloud.run.v2.ExecutionsClient" - }, - "method": { - "shortName": "ListExecutions", - "fullName": "google.cloud.run.v2.Executions.ListExecutions", - "service": { - "shortName": "Executions", - "fullName": "google.cloud.run.v2.Executions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Executions_DeleteExecution_async", - "title": "Builds deleteExecution Sample", - "origin": "API_DEFINITION", - "description": " Deletes an Execution.", - "canonical": true, - "file": "executions.delete_execution.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteExecution", - "fullName": "google.cloud.run.v2.Executions.DeleteExecution", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ExecutionsClient", - "fullName": "google.cloud.run.v2.ExecutionsClient" - }, - "method": { - "shortName": "DeleteExecution", - "fullName": "google.cloud.run.v2.Executions.DeleteExecution", - "service": { - "shortName": "Executions", - "fullName": "google.cloud.run.v2.Executions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Executions_CancelExecution_async", - "title": "Builds cancelExecution Sample", - "origin": "API_DEFINITION", - "description": " Cancels an Execution.", - "canonical": true, - "file": "executions.cancel_execution.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelExecution", - "fullName": "google.cloud.run.v2.Executions.CancelExecution", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ExecutionsClient", - "fullName": "google.cloud.run.v2.ExecutionsClient" - }, - "method": { - "shortName": "CancelExecution", - "fullName": "google.cloud.run.v2.Executions.CancelExecution", - "service": { - "shortName": "Executions", - "fullName": "google.cloud.run.v2.Executions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_CreateInstance_async", - "title": "Builds createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates an Instance.", - "canonical": true, - "file": "instances.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.run.v2.Instances.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.run.v2.Instance" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.run.v2.Instances.CreateInstance", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_DeleteInstance_async", - "title": "Builds deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes a Instance", - "canonical": true, - "file": "instances.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.run.v2.Instances.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.run.v2.Instances.DeleteInstance", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_GetInstance_async", - "title": "Builds getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets a Instance", - "canonical": true, - "file": "instances.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.run.v2.Instances.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Instance", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.run.v2.Instances.GetInstance", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_ListInstances_async", - "title": "Builds listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists Instances. Results are sorted by creation time, descending.", - "canonical": true, - "file": "instances.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.run.v2.Instances.ListInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListInstancesResponse", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.run.v2.Instances.ListInstances", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_StopInstance_async", - "title": "Builds stopInstance Sample", - "origin": "API_DEFINITION", - "description": " Stops an Instance.", - "canonical": true, - "file": "instances.stop_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StopInstance", - "fullName": "google.cloud.run.v2.Instances.StopInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "StopInstance", - "fullName": "google.cloud.run.v2.Instances.StopInstance", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Instances_StartInstance_async", - "title": "Builds startInstance Sample", - "origin": "API_DEFINITION", - "description": " Starts an Instance.", - "canonical": true, - "file": "instances.start_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StartInstance", - "fullName": "google.cloud.run.v2.Instances.StartInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "InstancesClient", - "fullName": "google.cloud.run.v2.InstancesClient" - }, - "method": { - "shortName": "StartInstance", - "fullName": "google.cloud.run.v2.Instances.StartInstance", - "service": { - "shortName": "Instances", - "fullName": "google.cloud.run.v2.Instances" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_CreateJob_async", - "title": "Builds createJob Sample", - "origin": "API_DEFINITION", - "description": " Creates a Job.", - "canonical": true, - "file": "jobs.create_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateJob", - "fullName": "google.cloud.run.v2.Jobs.CreateJob", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "job", - "type": ".google.cloud.run.v2.Job" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "CreateJob", - "fullName": "google.cloud.run.v2.Jobs.CreateJob", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_GetJob_async", - "title": "Builds getJob Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a Job.", - "canonical": true, - "file": "jobs.get_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJob", - "fullName": "google.cloud.run.v2.Jobs.GetJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Job", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "GetJob", - "fullName": "google.cloud.run.v2.Jobs.GetJob", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_ListJobs_async", - "title": "Builds listJobs Sample", - "origin": "API_DEFINITION", - "description": " Lists Jobs. Results are sorted by creation time, descending.", - "canonical": true, - "file": "jobs.list_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListJobs", - "fullName": "google.cloud.run.v2.Jobs.ListJobs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListJobsResponse", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "ListJobs", - "fullName": "google.cloud.run.v2.Jobs.ListJobs", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_UpdateJob_async", - "title": "Builds updateJob Sample", - "origin": "API_DEFINITION", - "description": " Updates a Job.", - "canonical": true, - "file": "jobs.update_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateJob", - "fullName": "google.cloud.run.v2.Jobs.UpdateJob", - "async": true, - "parameters": [ - { - "name": "job", - "type": ".google.cloud.run.v2.Job" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "UpdateJob", - "fullName": "google.cloud.run.v2.Jobs.UpdateJob", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_DeleteJob_async", - "title": "Builds deleteJob Sample", - "origin": "API_DEFINITION", - "description": " Deletes a Job.", - "canonical": true, - "file": "jobs.delete_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteJob", - "fullName": "google.cloud.run.v2.Jobs.DeleteJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "DeleteJob", - "fullName": "google.cloud.run.v2.Jobs.DeleteJob", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_RunJob_async", - "title": "Builds runJob Sample", - "origin": "API_DEFINITION", - "description": " Triggers creation of a new Execution of this Job.", - "canonical": true, - "file": "jobs.run_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunJob", - "fullName": "google.cloud.run.v2.Jobs.RunJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "overrides", - "type": ".google.cloud.run.v2.RunJobRequest.Overrides" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "RunJob", - "fullName": "google.cloud.run.v2.Jobs.RunJob", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_GetIamPolicy_async", - "title": "Builds getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the IAM Access Control policy currently in effect for the given Job. This result does not include any inherited policies.", - "canonical": true, - "file": "jobs.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.Jobs.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.Jobs.GetIamPolicy", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_SetIamPolicy_async", - "title": "Builds setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the IAM Access control policy for the specified Job. Overwrites any existing policy.", - "canonical": true, - "file": "jobs.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.Jobs.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.Jobs.SetIamPolicy", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Jobs_TestIamPermissions_async", - "title": "Builds testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.", - "canonical": true, - "file": "jobs.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.Jobs.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "JobsClient", - "fullName": "google.cloud.run.v2.JobsClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.Jobs.TestIamPermissions", - "service": { - "shortName": "Jobs", - "fullName": "google.cloud.run.v2.Jobs" - } - } - } - }, - { - "regionTag": "run_v2_generated_Revisions_GetRevision_async", - "title": "Builds getRevision Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a Revision.", - "canonical": true, - "file": "revisions.get_revision.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetRevision", - "fullName": "google.cloud.run.v2.Revisions.GetRevision", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Revision", - "client": { - "shortName": "RevisionsClient", - "fullName": "google.cloud.run.v2.RevisionsClient" - }, - "method": { - "shortName": "GetRevision", - "fullName": "google.cloud.run.v2.Revisions.GetRevision", - "service": { - "shortName": "Revisions", - "fullName": "google.cloud.run.v2.Revisions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Revisions_ListRevisions_async", - "title": "Builds listRevisions Sample", - "origin": "API_DEFINITION", - "description": " Lists Revisions from a given Service, or from a given location. Results are sorted by creation time, descending.", - "canonical": true, - "file": "revisions.list_revisions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListRevisions", - "fullName": "google.cloud.run.v2.Revisions.ListRevisions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListRevisionsResponse", - "client": { - "shortName": "RevisionsClient", - "fullName": "google.cloud.run.v2.RevisionsClient" - }, - "method": { - "shortName": "ListRevisions", - "fullName": "google.cloud.run.v2.Revisions.ListRevisions", - "service": { - "shortName": "Revisions", - "fullName": "google.cloud.run.v2.Revisions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Revisions_DeleteRevision_async", - "title": "Builds deleteRevision Sample", - "origin": "API_DEFINITION", - "description": " Deletes a Revision.", - "canonical": true, - "file": "revisions.delete_revision.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteRevision", - "fullName": "google.cloud.run.v2.Revisions.DeleteRevision", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "RevisionsClient", - "fullName": "google.cloud.run.v2.RevisionsClient" - }, - "method": { - "shortName": "DeleteRevision", - "fullName": "google.cloud.run.v2.Revisions.DeleteRevision", - "service": { - "shortName": "Revisions", - "fullName": "google.cloud.run.v2.Revisions" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_CreateService_async", - "title": "Builds createService Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Service in a given project and location.", - "canonical": true, - "file": "services.create_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateService", - "fullName": "google.cloud.run.v2.Services.CreateService", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "service", - "type": ".google.cloud.run.v2.Service" - }, - { - "name": "service_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "CreateService", - "fullName": "google.cloud.run.v2.Services.CreateService", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_GetService_async", - "title": "Builds getService Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a Service.", - "canonical": true, - "file": "services.get_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetService", - "fullName": "google.cloud.run.v2.Services.GetService", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Service", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "GetService", - "fullName": "google.cloud.run.v2.Services.GetService", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_ListServices_async", - "title": "Builds listServices Sample", - "origin": "API_DEFINITION", - "description": " Lists Services. Results are sorted by creation time, descending.", - "canonical": true, - "file": "services.list_services.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListServices", - "fullName": "google.cloud.run.v2.Services.ListServices", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListServicesResponse", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "ListServices", - "fullName": "google.cloud.run.v2.Services.ListServices", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_UpdateService_async", - "title": "Builds updateService Sample", - "origin": "API_DEFINITION", - "description": " Updates a Service.", - "canonical": true, - "file": "services.update_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateService", - "fullName": "google.cloud.run.v2.Services.UpdateService", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "service", - "type": ".google.cloud.run.v2.Service" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "UpdateService", - "fullName": "google.cloud.run.v2.Services.UpdateService", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_DeleteService_async", - "title": "Builds deleteService Sample", - "origin": "API_DEFINITION", - "description": " Deletes a Service. This will cause the Service to stop serving traffic and will delete all revisions.", - "canonical": true, - "file": "services.delete_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteService", - "fullName": "google.cloud.run.v2.Services.DeleteService", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "DeleteService", - "fullName": "google.cloud.run.v2.Services.DeleteService", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_GetIamPolicy_async", - "title": "Builds getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include any inherited policies.", - "canonical": true, - "file": "services.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.Services.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.Services.GetIamPolicy", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_SetIamPolicy_async", - "title": "Builds setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.", - "canonical": true, - "file": "services.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.Services.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.Services.SetIamPolicy", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Services_TestIamPermissions_async", - "title": "Builds testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.", - "canonical": true, - "file": "services.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.Services.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "ServicesClient", - "fullName": "google.cloud.run.v2.ServicesClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.Services.TestIamPermissions", - "service": { - "shortName": "Services", - "fullName": "google.cloud.run.v2.Services" - } - } - } - }, - { - "regionTag": "run_v2_generated_Tasks_GetTask_async", - "title": "Builds getTask Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a Task.", - "canonical": true, - "file": "tasks.get_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTask", - "fullName": "google.cloud.run.v2.Tasks.GetTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.Task", - "client": { - "shortName": "TasksClient", - "fullName": "google.cloud.run.v2.TasksClient" - }, - "method": { - "shortName": "GetTask", - "fullName": "google.cloud.run.v2.Tasks.GetTask", - "service": { - "shortName": "Tasks", - "fullName": "google.cloud.run.v2.Tasks" - } - } - } - }, - { - "regionTag": "run_v2_generated_Tasks_ListTasks_async", - "title": "Builds listTasks Sample", - "origin": "API_DEFINITION", - "description": " Lists Tasks from an Execution of a Job.", - "canonical": true, - "file": "tasks.list_tasks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTasks", - "fullName": "google.cloud.run.v2.Tasks.ListTasks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListTasksResponse", - "client": { - "shortName": "TasksClient", - "fullName": "google.cloud.run.v2.TasksClient" - }, - "method": { - "shortName": "ListTasks", - "fullName": "google.cloud.run.v2.Tasks.ListTasks", - "service": { - "shortName": "Tasks", - "fullName": "google.cloud.run.v2.Tasks" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_CreateWorkerPool_async", - "title": "Builds createWorkerPool Sample", - "origin": "API_DEFINITION", - "description": " Creates a new WorkerPool in a given project and location.", - "canonical": true, - "file": "worker_pools.create_worker_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.CreateWorkerPool", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "worker_pool", - "type": ".google.cloud.run.v2.WorkerPool" - }, - { - "name": "worker_pool_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "CreateWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.CreateWorkerPool", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_GetWorkerPool_async", - "title": "Builds getWorkerPool Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a WorkerPool.", - "canonical": true, - "file": "worker_pools.get_worker_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.GetWorkerPool", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.run.v2.WorkerPool", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "GetWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.GetWorkerPool", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_ListWorkerPools_async", - "title": "Builds listWorkerPools Sample", - "origin": "API_DEFINITION", - "description": " Lists WorkerPools. Results are sorted by creation time, descending.", - "canonical": true, - "file": "worker_pools.list_worker_pools.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListWorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools.ListWorkerPools", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "show_deleted", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.run.v2.ListWorkerPoolsResponse", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "ListWorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools.ListWorkerPools", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_UpdateWorkerPool_async", - "title": "Builds updateWorkerPool Sample", - "origin": "API_DEFINITION", - "description": " Updates a WorkerPool.", - "canonical": true, - "file": "worker_pools.update_worker_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.UpdateWorkerPool", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "worker_pool", - "type": ".google.cloud.run.v2.WorkerPool" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - }, - { - "name": "force_new_revision", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "UpdateWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.UpdateWorkerPool", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_DeleteWorkerPool_async", - "title": "Builds deleteWorkerPool Sample", - "origin": "API_DEFINITION", - "description": " Deletes a WorkerPool.", - "canonical": true, - "file": "worker_pools.delete_worker_pool.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.DeleteWorkerPool", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "DeleteWorkerPool", - "fullName": "google.cloud.run.v2.WorkerPools.DeleteWorkerPool", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_GetIamPolicy_async", - "title": "Builds getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the IAM Access Control policy currently in effect for the given Cloud Run WorkerPool. This result does not include any inherited policies.", - "canonical": true, - "file": "worker_pools.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.WorkerPools.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.run.v2.WorkerPools.GetIamPolicy", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_SetIamPolicy_async", - "title": "Builds setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the IAM Access control policy for the specified WorkerPool. Overwrites any existing policy.", - "canonical": true, - "file": "worker_pools.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.WorkerPools.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.run.v2.WorkerPools.SetIamPolicy", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - }, - { - "regionTag": "run_v2_generated_WorkerPools_TestIamPermissions_async", - "title": "Builds testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that a caller has on the specified Project. There are no permissions required for making this API call.", - "canonical": true, - "file": "worker_pools.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.WorkerPools.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "WorkerPoolsClient", - "fullName": "google.cloud.run.v2.WorkerPoolsClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.run.v2.WorkerPools.TestIamPermissions", - "service": { - "shortName": "WorkerPools", - "fullName": "google.cloud.run.v2.WorkerPools" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js deleted file mode 100644 index c87bd60b7f7..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.get_task.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_Tasks_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. The full name of the Task. - * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - */ - // const name = 'abc123' - - // Imports the Run library - const {TasksClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new TasksClient(); - - async function callGetTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getTask(request); - console.log(response); - } - - callGetTask(); - // [END run_v2_generated_Tasks_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-run/samples/generated/v2/tasks.list_tasks.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.list_tasks.js deleted file mode 100644 index 08ad5515de0..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/tasks.list_tasks.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_Tasks_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. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - */ - // const parent = 'abc123' - /** - * Maximum number of Tasks to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListTasks. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {TasksClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new TasksClient(); - - async function callListTasks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listTasksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTasks(); - // [END run_v2_generated_Tasks_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-run/samples/generated/v2/worker_pools.create_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js deleted file mode 100644 index f8685dd8aad..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.create_worker_pool.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, workerPool, workerPoolId) { - // [START run_v2_generated_WorkerPools_CreateWorkerPool_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 location and project in which this worker pool should be - * created. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. Only lowercase characters, digits, - * and hyphens. - */ - // const parent = 'abc123' - /** - * Required. The WorkerPool instance to create. - */ - // const workerPool = {} - /** - * Required. The unique identifier for the WorkerPool. It must begin with - * letter, and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the worker pool becomes - * `{parent}/workerPools/{worker_pool_id}`. - */ - // const workerPoolId = 'abc123' - /** - * Optional. Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - */ - // const validateOnly = true - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callCreateWorkerPool() { - // Construct request - const request = { - parent, - workerPool, - workerPoolId, - }; - - // Run request - const [operation] = await runClient.createWorkerPool(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateWorkerPool(); - // [END run_v2_generated_WorkerPools_CreateWorkerPool_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-run/samples/generated/v2/worker_pools.delete_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js deleted file mode 100644 index ed78edb9df4..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.delete_worker_pool.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START run_v2_generated_WorkerPools_DeleteWorkerPool_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 full name of the WorkerPool. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - * `{project}` can be project id or number. - */ - // const name = 'abc123' - /** - * Optional. Indicates that the request should be validated without actually - * deleting any resources. - */ - // const validateOnly = true - /** - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - */ - // const etag = 'abc123' - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callDeleteWorkerPool() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await runClient.deleteWorkerPool(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteWorkerPool(); - // [END run_v2_generated_WorkerPools_DeleteWorkerPool_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-run/samples/generated/v2/worker_pools.get_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js deleted file mode 100644 index 12ac3d07e05..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource) { - // [START run_v2_generated_WorkerPools_GetIamPolicy_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 resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await runClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END run_v2_generated_WorkerPools_GetIamPolicy_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-run/samples/generated/v2/worker_pools.get_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js deleted file mode 100644 index 53f15c17f05..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.get_worker_pool.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 run_v2_generated_WorkerPools_GetWorkerPool_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 full name of the WorkerPool. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - * `{project}` can be project id or number. - */ - // const name = 'abc123' - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callGetWorkerPool() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await runClient.getWorkerPool(request); - console.log(response); - } - - callGetWorkerPool(); - // [END run_v2_generated_WorkerPools_GetWorkerPool_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-run/samples/generated/v2/worker_pools.list_worker_pools.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js deleted file mode 100644 index d96211dd232..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.list_worker_pools.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START run_v2_generated_WorkerPools_ListWorkerPools_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 location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. - */ - // const parent = 'abc123' - /** - * Maximum number of WorkerPools to return in this call. - */ - // const pageSize = 1234 - /** - * A page token received from a previous call to ListWorkerPools. - * All other parameters must match. - */ - // const pageToken = 'abc123' - /** - * If true, returns deleted (but unexpired) resources along with active ones. - */ - // const showDeleted = true - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callListWorkerPools() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = runClient.listWorkerPoolsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListWorkerPools(); - // [END run_v2_generated_WorkerPools_ListWorkerPools_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-run/samples/generated/v2/worker_pools.set_iam_policy.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js deleted file mode 100644 index 1e4c1332759..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, policy) { - // [START run_v2_generated_WorkerPools_SetIamPolicy_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 resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await runClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END run_v2_generated_WorkerPools_SetIamPolicy_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-run/samples/generated/v2/worker_pools.test_iam_permissions.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js deleted file mode 100644 index ea171ddf125..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resource, permissions) { - // [START run_v2_generated_WorkerPools_TestIamPermissions_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 resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = ['abc','def'] - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await runClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END run_v2_generated_WorkerPools_TestIamPermissions_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-run/samples/generated/v2/worker_pools.update_worker_pool.js b/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js deleted file mode 100644 index 43bcb8e1cfe..00000000000 --- a/owl-bot-staging/google-cloud-run/samples/generated/v2/worker_pools.update_worker_pool.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workerPool) { - // [START run_v2_generated_WorkerPools_UpdateWorkerPool_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. - */ - /** - * Optional. The list of fields to be updated. - */ - // const updateMask = {} - /** - * Required. The WorkerPool to be updated. - */ - // const workerPool = {} - /** - * Optional. Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - */ - // const validateOnly = true - /** - * Optional. If set to true, and if the WorkerPool does not exist, it will - * create a new one. The caller must have 'run.workerpools.create' permissions - * if this is set to true and the WorkerPool does not exist. - */ - // const allowMissing = true - /** - * Optional. If set to true, a new revision will be created from the template - * even if the system doesn't detect any changes from the previously deployed - * revision. - * This may be useful for cases where the underlying resources need to be - * recreated or reinitialized. For example if the image is specified by label, - * but the underlying image digest has changed) or if the container performs - * deployment initialization work that needs to be performed again. - */ - // const forceNewRevision = true - - // Imports the Run library - const {WorkerPoolsClient} = require('@google-cloud/run').v2; - - // Instantiates a client - const runClient = new WorkerPoolsClient(); - - async function callUpdateWorkerPool() { - // Construct request - const request = { - workerPool, - }; - - // Run request - const [operation] = await runClient.updateWorkerPool(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateWorkerPool(); - // [END run_v2_generated_WorkerPools_UpdateWorkerPool_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-run/src/index.ts b/owl-bot-staging/google-cloud-run/src/index.ts deleted file mode 100644 index 3c28cf6bbfb..00000000000 --- a/owl-bot-staging/google-cloud-run/src/index.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 synthtool. ** -// ** https://github.com/googleapis/synthtool ** -// ** All changes to this file may be overwritten. ** - -import * as v2 from './v2'; - -const BuildsClient = v2.BuildsClient; -type BuildsClient = v2.BuildsClient; -const ExecutionsClient = v2.ExecutionsClient; -type ExecutionsClient = v2.ExecutionsClient; -const InstancesClient = v2.InstancesClient; -type InstancesClient = v2.InstancesClient; -const JobsClient = v2.JobsClient; -type JobsClient = v2.JobsClient; -const RevisionsClient = v2.RevisionsClient; -type RevisionsClient = v2.RevisionsClient; -const ServicesClient = v2.ServicesClient; -type ServicesClient = v2.ServicesClient; -const TasksClient = v2.TasksClient; -type TasksClient = v2.TasksClient; -const WorkerPoolsClient = v2.WorkerPoolsClient; -type WorkerPoolsClient = v2.WorkerPoolsClient; - -export {v2, BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; -export default {v2, BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-run/src/v2/builds_client.ts b/owl-bot-staging/google-cloud-run/src/v2/builds_client.ts deleted file mode 100644 index 9cbdf164888..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/builds_client.ts +++ /dev/null @@ -1,974 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/builds_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './builds_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Build Control Plane API - * @class - * @memberof v2 - */ -export class BuildsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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}; - buildsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BuildsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new BuildsClient({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 BuildsClient; - 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 = 'run.' + 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 = { - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - jobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Builds', 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.buildsStub) { - return this.buildsStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Builds. - this.buildsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Builds') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Builds, - 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 buildsStubMethods = - ['submitBuild']; - for (const methodName of buildsStubMethods) { - const callPromise = this.buildsStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.buildsStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Submits a build in a given project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location to build in. Location must be a region, - * e.g., 'us-central1' or 'global' if the global builder is to be used. - * Format: - * `projects/{project}/locations/{location}` - * @param {google.cloud.run.v2.StorageSource} request.storageSource - * Required. Source for the build. - * @param {string} request.imageUri - * Required. Artifact Registry URI to store the built image. - * @param {google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild} request.buildpackBuild - * Build the source using Buildpacks. - * @param {google.cloud.run.v2.SubmitBuildRequest.DockerBuild} request.dockerBuild - * Build the source using Docker. This means the source has a Dockerfile. - * @param {string} [request.serviceAccount] - * Optional. The service account to use for the build. If not set, the default - * Cloud Build service account for the project will be used. - * @param {string} [request.workerPool] - * Optional. Name of the Cloud Build Custom Worker Pool that should be used to - * build the function. The format of this field is - * `projects/{project}/locations/{region}/workerPools/{workerPool}` where - * `{project}` and `{region}` are the project id and region respectively where - * the worker pool is defined and `{workerPool}` is the short name of the - * worker pool. - * @param {string[]} [request.tags] - * Optional. Additional tags to annotate the build. - * @param {string} [request.machineType] - * Optional. The machine type from default pool to use for the build. If left - * blank, cloudbuild will use a sensible default. Currently only E2_HIGHCPU_8 - * is supported. If worker_pool is set, this field will be ignored. - * @param {google.api.LaunchStage} [request.releaseTrack] - * Optional. The release track of the client that initiated the build request. - * @param {string} [request.client] - * Optional. The client that initiated the build request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.run.v2.SubmitBuildResponse|SubmitBuildResponse}. - * 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/v2/builds.submit_build.js - * region_tag:run_v2_generated_Builds_SubmitBuild_async - */ - submitBuild( - request?: protos.google.cloud.run.v2.ISubmitBuildRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|undefined, {}|undefined - ]>; - submitBuild( - request: protos.google.cloud.run.v2.ISubmitBuildRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, - {}|null|undefined>): void; - submitBuild( - request: protos.google.cloud.run.v2.ISubmitBuildRequest, - callback: Callback< - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, - {}|null|undefined>): void; - submitBuild( - request?: protos.google.cloud.run.v2.ISubmitBuildRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('submitBuild request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('submitBuild response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.submitBuild(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.ISubmitBuildResponse, - protos.google.cloud.run.v2.ISubmitBuildRequest|undefined, - {}|undefined - ]) => { - this._log.info('submitBuild response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Gets information about a 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.buildsStub && !this._terminated) { - return this.buildsStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json deleted file mode 100644 index 91ddeab6580..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/builds_client_config.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Builds": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "SubmitBuild": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/builds_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/executions_client.ts b/owl-bot-staging/google-cloud-run/src/v2/executions_client.ts deleted file mode 100644 index 29b7e4871fb..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/executions_client.ts +++ /dev/null @@ -1,1722 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/executions_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './executions_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Execution Control Plane API. - * @class - * @memberof v2 - */ -export class ExecutionsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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; - executionsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ExecutionsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ExecutionsClient({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 ExecutionsClient; - 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 = 'run.' + 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 = { - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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 = { - listExecutions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'executions') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const deleteExecutionResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - const deleteExecutionMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - const cancelExecutionResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - const cancelExecutionMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteExecution: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteExecutionResponse.decode.bind(deleteExecutionResponse), - deleteExecutionMetadata.decode.bind(deleteExecutionMetadata)), - cancelExecution: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - cancelExecutionResponse.decode.bind(cancelExecutionResponse), - cancelExecutionMetadata.decode.bind(cancelExecutionMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Executions', 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.executionsStub) { - return this.executionsStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Executions. - this.executionsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Executions') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Executions, - 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 executionsStubMethods = - ['getExecution', 'listExecutions', 'deleteExecution', 'cancelExecution']; - for (const methodName of executionsStubMethods) { - const callPromise = this.executionsStub.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.executionsStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about an Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Execution. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.Execution|Execution}. - * 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/v2/executions.get_execution.js - * region_tag:run_v2_generated_Executions_GetExecution_async - */ - getExecution( - request?: protos.google.cloud.run.v2.IGetExecutionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|undefined, {}|undefined - ]>; - getExecution( - request: protos.google.cloud.run.v2.IGetExecutionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, - {}|null|undefined>): void; - getExecution( - request: protos.google.cloud.run.v2.IGetExecutionRequest, - callback: Callback< - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, - {}|null|undefined>): void; - getExecution( - request?: protos.google.cloud.run.v2.IGetExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getExecution request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getExecution response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getExecution(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.IExecution, - protos.google.cloud.run.v2.IGetExecutionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getExecution response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Deletes an Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Execution to delete. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/executions.delete_execution.js - * region_tag:run_v2_generated_Executions_DeleteExecution_async - */ - deleteExecution( - request?: protos.google.cloud.run.v2.IDeleteExecutionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteExecution( - request: protos.google.cloud.run.v2.IDeleteExecutionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteExecution( - request: protos.google.cloud.run.v2.IDeleteExecutionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteExecution( - request?: protos.google.cloud.run.v2.IDeleteExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteExecution response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteExecution request %j', request); - return this.innerApiCalls.deleteExecution(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteExecution response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteExecution()`. - * @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/v2/executions.delete_execution.js - * region_tag:run_v2_generated_Executions_DeleteExecution_async - */ - async checkDeleteExecutionProgress(name: string): Promise>{ - this._log.info('deleteExecution long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteExecution, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Cancels an Execution. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Execution to cancel. - * Format: - * `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`, - * where `{project}` can be project id or number. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * cancelling any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the resource. - * This may be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/executions.cancel_execution.js - * region_tag:run_v2_generated_Executions_CancelExecution_async - */ - cancelExecution( - request?: protos.google.cloud.run.v2.ICancelExecutionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - cancelExecution( - request: protos.google.cloud.run.v2.ICancelExecutionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelExecution( - request: protos.google.cloud.run.v2.ICancelExecutionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelExecution( - request?: protos.google.cloud.run.v2.ICancelExecutionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('cancelExecution response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('cancelExecution request %j', request); - return this.innerApiCalls.cancelExecution(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('cancelExecution response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `cancelExecution()`. - * @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/v2/executions.cancel_execution.js - * region_tag:run_v2_generated_Executions_CancelExecution_async - */ - async checkCancelExecutionProgress(name: string): Promise>{ - this._log.info('cancelExecution long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.cancelExecution, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Executions from a Job. Results are sorted by creation time, - * descending. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of Executions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.Execution|Execution}. - * 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 `listExecutionsAsync()` - * 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. - */ - listExecutions( - request?: protos.google.cloud.run.v2.IListExecutionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IExecution[], - protos.google.cloud.run.v2.IListExecutionsRequest|null, - protos.google.cloud.run.v2.IListExecutionsResponse - ]>; - listExecutions( - request: protos.google.cloud.run.v2.IListExecutionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListExecutionsRequest, - protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, - protos.google.cloud.run.v2.IExecution>): void; - listExecutions( - request: protos.google.cloud.run.v2.IListExecutionsRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListExecutionsRequest, - protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, - protos.google.cloud.run.v2.IExecution>): void; - listExecutions( - request?: protos.google.cloud.run.v2.IListExecutionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListExecutionsRequest, - protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, - protos.google.cloud.run.v2.IExecution>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListExecutionsRequest, - protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, - protos.google.cloud.run.v2.IExecution>): - Promise<[ - protos.google.cloud.run.v2.IExecution[], - protos.google.cloud.run.v2.IListExecutionsRequest|null, - protos.google.cloud.run.v2.IListExecutionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListExecutionsRequest, - protos.google.cloud.run.v2.IListExecutionsResponse|null|undefined, - protos.google.cloud.run.v2.IExecution>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listExecutions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listExecutions request %j', request); - return this.innerApiCalls - .listExecutions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.IExecution[], - protos.google.cloud.run.v2.IListExecutionsRequest|null, - protos.google.cloud.run.v2.IListExecutionsResponse - ]) => { - this._log.info('listExecutions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listExecutions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of Executions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Execution|Execution} 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 `listExecutionsAsync()` - * 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. - */ - listExecutionsStream( - request?: protos.google.cloud.run.v2.IListExecutionsRequest, - 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['listExecutions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listExecutions stream %j', request); - return this.descriptors.page.listExecutions.createStream( - this.innerApiCalls.listExecutions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listExecutions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Execution from which the Executions should be listed. - * To list all Executions across Jobs, use "-" instead of Job name. - * Format: `projects/{project}/locations/{location}/jobs/{job}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of Executions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListExecutions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Execution|Execution}. 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/v2/executions.list_executions.js - * region_tag:run_v2_generated_Executions_ListExecutions_async - */ - listExecutionsAsync( - request?: protos.google.cloud.run.v2.IListExecutionsRequest, - 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['listExecutions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listExecutions iterate %j', request); - return this.descriptors.page.listExecutions.asyncIterate( - this.innerApiCalls['listExecutions'] 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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.executionsStub && !this._terminated) { - return this.executionsStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json deleted file mode 100644 index 20bcbf69f35..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/executions_client_config.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Executions": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "GetExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListExecutions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelExecution": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/executions_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json b/owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json deleted file mode 100644 index 2276e2b6394..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/gapic_metadata.json +++ /dev/null @@ -1,559 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.run.v2", - "libraryPackage": "@google-cloud/run", - "services": { - "Builds": { - "clients": { - "grpc": { - "libraryClient": "BuildsClient", - "rpcs": { - "SubmitBuild": { - "methods": [ - "submitBuild" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BuildsClient", - "rpcs": { - "SubmitBuild": { - "methods": [ - "submitBuild" - ] - } - } - } - } - }, - "Executions": { - "clients": { - "grpc": { - "libraryClient": "ExecutionsClient", - "rpcs": { - "GetExecution": { - "methods": [ - "getExecution" - ] - }, - "DeleteExecution": { - "methods": [ - "deleteExecution" - ] - }, - "CancelExecution": { - "methods": [ - "cancelExecution" - ] - }, - "ListExecutions": { - "methods": [ - "listExecutions", - "listExecutionsStream", - "listExecutionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ExecutionsClient", - "rpcs": { - "GetExecution": { - "methods": [ - "getExecution" - ] - }, - "DeleteExecution": { - "methods": [ - "deleteExecution" - ] - }, - "CancelExecution": { - "methods": [ - "cancelExecution" - ] - }, - "ListExecutions": { - "methods": [ - "listExecutions", - "listExecutionsStream", - "listExecutionsAsync" - ] - } - } - } - } - }, - "Instances": { - "clients": { - "grpc": { - "libraryClient": "InstancesClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "StopInstance": { - "methods": [ - "stopInstance" - ] - }, - "StartInstance": { - "methods": [ - "startInstance" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "InstancesClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "StopInstance": { - "methods": [ - "stopInstance" - ] - }, - "StartInstance": { - "methods": [ - "startInstance" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - } - } - } - } - }, - "Jobs": { - "clients": { - "grpc": { - "libraryClient": "JobsClient", - "rpcs": { - "GetJob": { - "methods": [ - "getJob" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "RunJob": { - "methods": [ - "runJob" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "JobsClient", - "rpcs": { - "GetJob": { - "methods": [ - "getJob" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "RunJob": { - "methods": [ - "runJob" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - } - } - } - } - }, - "Revisions": { - "clients": { - "grpc": { - "libraryClient": "RevisionsClient", - "rpcs": { - "GetRevision": { - "methods": [ - "getRevision" - ] - }, - "DeleteRevision": { - "methods": [ - "deleteRevision" - ] - }, - "ListRevisions": { - "methods": [ - "listRevisions", - "listRevisionsStream", - "listRevisionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "RevisionsClient", - "rpcs": { - "GetRevision": { - "methods": [ - "getRevision" - ] - }, - "DeleteRevision": { - "methods": [ - "deleteRevision" - ] - }, - "ListRevisions": { - "methods": [ - "listRevisions", - "listRevisionsStream", - "listRevisionsAsync" - ] - } - } - } - } - }, - "Services": { - "clients": { - "grpc": { - "libraryClient": "ServicesClient", - "rpcs": { - "GetService": { - "methods": [ - "getService" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateService": { - "methods": [ - "createService" - ] - }, - "UpdateService": { - "methods": [ - "updateService" - ] - }, - "DeleteService": { - "methods": [ - "deleteService" - ] - }, - "ListServices": { - "methods": [ - "listServices", - "listServicesStream", - "listServicesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ServicesClient", - "rpcs": { - "GetService": { - "methods": [ - "getService" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateService": { - "methods": [ - "createService" - ] - }, - "UpdateService": { - "methods": [ - "updateService" - ] - }, - "DeleteService": { - "methods": [ - "deleteService" - ] - }, - "ListServices": { - "methods": [ - "listServices", - "listServicesStream", - "listServicesAsync" - ] - } - } - } - } - }, - "Tasks": { - "clients": { - "grpc": { - "libraryClient": "TasksClient", - "rpcs": { - "GetTask": { - "methods": [ - "getTask" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "TasksClient", - "rpcs": { - "GetTask": { - "methods": [ - "getTask" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - } - } - }, - "WorkerPools": { - "clients": { - "grpc": { - "libraryClient": "WorkerPoolsClient", - "rpcs": { - "GetWorkerPool": { - "methods": [ - "getWorkerPool" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateWorkerPool": { - "methods": [ - "createWorkerPool" - ] - }, - "UpdateWorkerPool": { - "methods": [ - "updateWorkerPool" - ] - }, - "DeleteWorkerPool": { - "methods": [ - "deleteWorkerPool" - ] - }, - "ListWorkerPools": { - "methods": [ - "listWorkerPools", - "listWorkerPoolsStream", - "listWorkerPoolsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "WorkerPoolsClient", - "rpcs": { - "GetWorkerPool": { - "methods": [ - "getWorkerPool" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateWorkerPool": { - "methods": [ - "createWorkerPool" - ] - }, - "UpdateWorkerPool": { - "methods": [ - "updateWorkerPool" - ] - }, - "DeleteWorkerPool": { - "methods": [ - "deleteWorkerPool" - ] - }, - "ListWorkerPools": { - "methods": [ - "listWorkerPools", - "listWorkerPoolsStream", - "listWorkerPoolsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/index.ts b/owl-bot-staging/google-cloud-run/src/v2/index.ts deleted file mode 100644 index 6cc79ce5e90..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {BuildsClient} from './builds_client'; -export {ExecutionsClient} from './executions_client'; -export {InstancesClient} from './instances_client'; -export {JobsClient} from './jobs_client'; -export {RevisionsClient} from './revisions_client'; -export {ServicesClient} from './services_client'; -export {TasksClient} from './tasks_client'; -export {WorkerPoolsClient} from './worker_pools_client'; diff --git a/owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts b/owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts deleted file mode 100644 index dff326d9416..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/jobs_client.ts +++ /dev/null @@ -1,2361 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/jobs_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './jobs_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Job Control Plane API. - * @class - * @memberof v2 - */ -export class JobsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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; - jobsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of JobsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new JobsClient({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 JobsClient; - 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 = 'run.' + 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 = { - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createJobResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const createJobMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const updateJobResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const updateJobMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const deleteJobResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const deleteJobMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Job') as gax.protobuf.Type; - const runJobResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - const runJobMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Execution') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createJobResponse.decode.bind(createJobResponse), - createJobMetadata.decode.bind(createJobMetadata)), - updateJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateJobResponse.decode.bind(updateJobResponse), - updateJobMetadata.decode.bind(updateJobMetadata)), - deleteJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteJobResponse.decode.bind(deleteJobResponse), - deleteJobMetadata.decode.bind(deleteJobMetadata)), - runJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - runJobResponse.decode.bind(runJobResponse), - runJobMetadata.decode.bind(runJobMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Jobs', 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.jobsStub) { - return this.jobsStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Jobs. - this.jobsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Jobs') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Jobs, - 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 jobsStubMethods = - ['createJob', 'getJob', 'listJobs', 'updateJob', 'deleteJob', 'runJob', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; - for (const methodName of jobsStubMethods) { - const callPromise = this.jobsStub.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.jobsStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.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/v2/jobs.get_job.js - * region_tag:run_v2_generated_Jobs_GetJob_async - */ - getJob( - request?: protos.google.cloud.run.v2.IGetJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|undefined, {}|undefined - ]>; - getJob( - request: protos.google.cloud.run.v2.IGetJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request: protos.google.cloud.run.v2.IGetJobRequest, - callback: Callback< - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request?: protos.google.cloud.run.v2.IGetJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('getJob request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getJob response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getJob(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.IJob, - protos.google.cloud.run.v2.IGetJobRequest|undefined, - {}|undefined - ]) => { - this._log.info('getJob response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets the IAM Access Control policy currently in effect for the given Job. - * This result does not include any inherited policies. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/jobs.get_iam_policy.js - * region_tag:run_v2_generated_Jobs_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Sets the IAM Access control policy for the specified Job. Overwrites - * any existing policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/jobs.set_iam_policy.js - * region_tag:run_v2_generated_Jobs_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Returns permissions that a caller has on the specified Project. - * - * There are no permissions required for making this API call. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/jobs.test_iam_permissions.js - * region_tag:run_v2_generated_Jobs_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project in which this Job should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * @param {google.cloud.run.v2.Job} request.job - * Required. The Job instance to create. - * @param {string} request.jobId - * Required. The unique identifier for the Job. The name of the job becomes - * {parent}/jobs/{job_id}. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.create_job.js - * region_tag:run_v2_generated_Jobs_CreateJob_async - */ - createJob( - request?: protos.google.cloud.run.v2.ICreateJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createJob( - request: protos.google.cloud.run.v2.ICreateJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createJob( - request: protos.google.cloud.run.v2.ICreateJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createJob( - request?: protos.google.cloud.run.v2.ICreateJobRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createJob response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createJob request %j', request); - return this.innerApiCalls.createJob(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createJob response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createJob()`. - * @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/v2/jobs.create_job.js - * region_tag:run_v2_generated_Jobs_CreateJob_async - */ - async checkCreateJobProgress(name: string): Promise>{ - this._log.info('createJob long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.run.v2.Job} request.job - * Required. The Job to be updated. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * @param {boolean} [request.allowMissing] - * Optional. If set to true, and if the Job does not exist, it will create a - * new one. Caller must have both create and update permissions for this call - * if this is set to true. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.update_job.js - * region_tag:run_v2_generated_Jobs_UpdateJob_async - */ - updateJob( - request?: protos.google.cloud.run.v2.IUpdateJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateJob( - request: protos.google.cloud.run.v2.IUpdateJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateJob( - request: protos.google.cloud.run.v2.IUpdateJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateJob( - request?: protos.google.cloud.run.v2.IUpdateJobRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.job?.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateJob response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateJob request %j', request); - return this.innerApiCalls.updateJob(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateJob response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateJob()`. - * @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/v2/jobs.update_job.js - * region_tag:run_v2_generated_Jobs_UpdateJob_async - */ - async checkUpdateJobProgress(name: string): Promise>{ - this._log.info('updateJob long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.delete_job.js - * region_tag:run_v2_generated_Jobs_DeleteJob_async - */ - deleteJob( - request?: protos.google.cloud.run.v2.IDeleteJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteJob( - request: protos.google.cloud.run.v2.IDeleteJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request: protos.google.cloud.run.v2.IDeleteJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request?: protos.google.cloud.run.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteJob response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteJob request %j', request); - return this.innerApiCalls.deleteJob(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteJob response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * 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/v2/jobs.delete_job.js - * region_tag:run_v2_generated_Jobs_DeleteJob_async - */ - async checkDeleteJobProgress(name: string): Promise>{ - this._log.info('deleteJob long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Triggers creation of a new Execution of this Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Job. - * Format: projects/{project}/locations/{location}/jobs/{job}, where {project} - * can be project id or number. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * @param {google.cloud.run.v2.RunJobRequest.Overrides} request.overrides - * Overrides specification for a given execution of a job. If provided, - * overrides will be applied to update the execution or task spec. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/jobs.run_job.js - * region_tag:run_v2_generated_Jobs_RunJob_async - */ - runJob( - request?: protos.google.cloud.run.v2.IRunJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - runJob( - request: protos.google.cloud.run.v2.IRunJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runJob( - request: protos.google.cloud.run.v2.IRunJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runJob( - request?: protos.google.cloud.run.v2.IRunJobRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('runJob response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('runJob request %j', request); - return this.innerApiCalls.runJob(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('runJob response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `runJob()`. - * @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/v2/jobs.run_job.js - * region_tag:run_v2_generated_Jobs_RunJob_async - */ - async checkRunJobProgress(name: string): Promise>{ - this._log.info('runJob long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.runJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Jobs. Results are sorted by creation time, descending. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * @param {number} request.pageSize - * Maximum number of Jobs to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListJobs. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.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.run.v2.IListJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IJob[], - protos.google.cloud.run.v2.IListJobsRequest|null, - protos.google.cloud.run.v2.IListJobsResponse - ]>; - listJobs( - request: protos.google.cloud.run.v2.IListJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListJobsRequest, - protos.google.cloud.run.v2.IListJobsResponse|null|undefined, - protos.google.cloud.run.v2.IJob>): void; - listJobs( - request: protos.google.cloud.run.v2.IListJobsRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListJobsRequest, - protos.google.cloud.run.v2.IListJobsResponse|null|undefined, - protos.google.cloud.run.v2.IJob>): void; - listJobs( - request?: protos.google.cloud.run.v2.IListJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListJobsRequest, - protos.google.cloud.run.v2.IListJobsResponse|null|undefined, - protos.google.cloud.run.v2.IJob>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListJobsRequest, - protos.google.cloud.run.v2.IListJobsResponse|null|undefined, - protos.google.cloud.run.v2.IJob>): - Promise<[ - protos.google.cloud.run.v2.IJob[], - protos.google.cloud.run.v2.IListJobsRequest|null, - protos.google.cloud.run.v2.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 || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListJobsRequest, - protos.google.cloud.run.v2.IListJobsResponse|null|undefined, - protos.google.cloud.run.v2.IJob>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listJobs values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listJobs request %j', request); - return this.innerApiCalls - .listJobs(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.IJob[], - protos.google.cloud.run.v2.IListJobsRequest|null, - protos.google.cloud.run.v2.IListJobsResponse - ]) => { - this._log.info('listJobs values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listJobs`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * @param {number} request.pageSize - * Maximum number of Jobs to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListJobs. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.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.run.v2.IListJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listJobs stream %j', request); - 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 - * Required. The location and project to list resources on. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. - * @param {number} request.pageSize - * Maximum number of Jobs to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListJobs. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.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/v2/jobs.list_jobs.js - * region_tag:run_v2_generated_Jobs_ListJobs_async - */ - listJobsAsync( - request?: protos.google.cloud.run.v2.IListJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listJobs iterate %j', request); - return this.descriptors.page.listJobs.asyncIterate( - this.innerApiCalls['listJobs'] 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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.jobsStub && !this._terminated) { - return this.jobsStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json deleted file mode 100644 index 0751746db74..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/jobs_client_config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Jobs": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListJobs": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RunJob": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/jobs_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts b/owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts deleted file mode 100644 index c2d97a21619..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/revisions_client.ts +++ /dev/null @@ -1,1716 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/revisions_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './revisions_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Revision Control Plane API. - * @class - * @memberof v2 - */ -export class RevisionsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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; - revisionsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of RevisionsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new RevisionsClient({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 RevisionsClient; - 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 = 'run.' + 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 = { - cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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 = { - listRevisions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'revisions') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const deleteRevisionResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Revision') as gax.protobuf.Type; - const deleteRevisionMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Revision') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteRevision: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteRevisionResponse.decode.bind(deleteRevisionResponse), - deleteRevisionMetadata.decode.bind(deleteRevisionMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Revisions', 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.revisionsStub) { - return this.revisionsStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Revisions. - this.revisionsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Revisions') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Revisions, - 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 revisionsStubMethods = - ['getRevision', 'listRevisions', 'deleteRevision']; - for (const methodName of revisionsStubMethods) { - const callPromise = this.revisionsStub.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.revisionsStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about a Revision. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Revision. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.Revision|Revision}. - * 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/v2/revisions.get_revision.js - * region_tag:run_v2_generated_Revisions_GetRevision_async - */ - getRevision( - request?: protos.google.cloud.run.v2.IGetRevisionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|undefined, {}|undefined - ]>; - getRevision( - request: protos.google.cloud.run.v2.IGetRevisionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, - {}|null|undefined>): void; - getRevision( - request: protos.google.cloud.run.v2.IGetRevisionRequest, - callback: Callback< - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, - {}|null|undefined>): void; - getRevision( - request?: protos.google.cloud.run.v2.IGetRevisionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('getRevision request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getRevision response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getRevision(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.IRevision, - protos.google.cloud.run.v2.IGetRevisionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getRevision response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Deletes a Revision. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Revision to delete. - * Format: - * projects/{project}/locations/{location}/services/{service}/revisions/{revision} - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the - * resource. This may be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/revisions.delete_revision.js - * region_tag:run_v2_generated_Revisions_DeleteRevision_async - */ - deleteRevision( - request?: protos.google.cloud.run.v2.IDeleteRevisionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteRevision( - request: protos.google.cloud.run.v2.IDeleteRevisionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteRevision( - request: protos.google.cloud.run.v2.IDeleteRevisionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteRevision( - request?: protos.google.cloud.run.v2.IDeleteRevisionRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteRevision response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteRevision request %j', request); - return this.innerApiCalls.deleteRevision(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteRevision response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteRevision()`. - * @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/v2/revisions.delete_revision.js - * region_tag:run_v2_generated_Revisions_DeleteRevision_async - */ - async checkDeleteRevisionProgress(name: string): Promise>{ - this._log.info('deleteRevision long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteRevision, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Revisions from a given Service, or from a given location. Results - * are sorted by creation time, descending. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * @param {number} request.pageSize - * Maximum number of revisions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.Revision|Revision}. - * 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 `listRevisionsAsync()` - * 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. - */ - listRevisions( - request?: protos.google.cloud.run.v2.IListRevisionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IRevision[], - protos.google.cloud.run.v2.IListRevisionsRequest|null, - protos.google.cloud.run.v2.IListRevisionsResponse - ]>; - listRevisions( - request: protos.google.cloud.run.v2.IListRevisionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListRevisionsRequest, - protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, - protos.google.cloud.run.v2.IRevision>): void; - listRevisions( - request: protos.google.cloud.run.v2.IListRevisionsRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListRevisionsRequest, - protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, - protos.google.cloud.run.v2.IRevision>): void; - listRevisions( - request?: protos.google.cloud.run.v2.IListRevisionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListRevisionsRequest, - protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, - protos.google.cloud.run.v2.IRevision>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListRevisionsRequest, - protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, - protos.google.cloud.run.v2.IRevision>): - Promise<[ - protos.google.cloud.run.v2.IRevision[], - protos.google.cloud.run.v2.IListRevisionsRequest|null, - protos.google.cloud.run.v2.IListRevisionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListRevisionsRequest, - protos.google.cloud.run.v2.IListRevisionsResponse|null|undefined, - protos.google.cloud.run.v2.IRevision>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listRevisions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listRevisions request %j', request); - return this.innerApiCalls - .listRevisions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.IRevision[], - protos.google.cloud.run.v2.IListRevisionsRequest|null, - protos.google.cloud.run.v2.IListRevisionsResponse - ]) => { - this._log.info('listRevisions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listRevisions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * @param {number} request.pageSize - * Maximum number of revisions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Revision|Revision} 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 `listRevisionsAsync()` - * 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. - */ - listRevisionsStream( - request?: protos.google.cloud.run.v2.IListRevisionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listRevisions stream %j', request); - return this.descriptors.page.listRevisions.createStream( - this.innerApiCalls.listRevisions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listRevisions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Service from which the Revisions should be listed. - * To list all Revisions across Services, use "-" instead of Service name. - * Format: - * projects/{project}/locations/{location}/services/{service} - * @param {number} request.pageSize - * Maximum number of revisions to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListRevisions. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Revision|Revision}. 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/v2/revisions.list_revisions.js - * region_tag:run_v2_generated_Revisions_ListRevisions_async - */ - listRevisionsAsync( - request?: protos.google.cloud.run.v2.IListRevisionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listRevisions iterate %j', request); - return this.descriptors.page.listRevisions.asyncIterate( - this.innerApiCalls['listRevisions'] 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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified cryptoKey resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} key_ring - * @param {string} crypto_key - * @returns {string} Resource name string. - */ - cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { - return this.pathTemplates.cryptoKeyPathTemplate.render({ - project: project, - location: location, - key_ring: keyRing, - crypto_key: cryptoKey, - }); - } - - /** - * Parse the project from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; - } - - /** - * Parse the location from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; - } - - /** - * Parse the key_ring from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the key_ring. - */ - matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; - } - - /** - * Parse the crypto_key from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the crypto_key. - */ - matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.revisionsStub && !this._terminated) { - return this.revisionsStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json deleted file mode 100644 index f5a18a2ed2b..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/revisions_client_config.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Revisions": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "GetRevision": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListRevisions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteRevision": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/revisions_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/services_client.ts b/owl-bot-staging/google-cloud-run/src/v2/services_client.ts deleted file mode 100644 index 3fabf84fd3c..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/services_client.ts +++ /dev/null @@ -1,2232 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/services_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './services_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Service Control Plane API - * @class - * @memberof v2 - */ -export class ServicesClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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; - servicesStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ServicesClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ServicesClient({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 ServicesClient; - 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 = 'run.' + 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 = { - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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 = { - listServices: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'services') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createServiceResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - const createServiceMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - const updateServiceResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - const updateServiceMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - const deleteServiceResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - const deleteServiceMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.Service') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createService: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createServiceResponse.decode.bind(createServiceResponse), - createServiceMetadata.decode.bind(createServiceMetadata)), - updateService: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateServiceResponse.decode.bind(updateServiceResponse), - updateServiceMetadata.decode.bind(updateServiceMetadata)), - deleteService: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteServiceResponse.decode.bind(deleteServiceResponse), - deleteServiceMetadata.decode.bind(deleteServiceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Services', 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.servicesStub) { - return this.servicesStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Services. - this.servicesStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Services') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Services, - 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 servicesStubMethods = - ['createService', 'getService', 'listServices', 'updateService', 'deleteService', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; - for (const methodName of servicesStubMethods) { - const callPromise = this.servicesStub.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.servicesStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about a Service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.Service|Service}. - * 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/v2/services.get_service.js - * region_tag:run_v2_generated_Services_GetService_async - */ - getService( - request?: protos.google.cloud.run.v2.IGetServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|undefined, {}|undefined - ]>; - getService( - request: protos.google.cloud.run.v2.IGetServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, - {}|null|undefined>): void; - getService( - request: protos.google.cloud.run.v2.IGetServiceRequest, - callback: Callback< - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, - {}|null|undefined>): void; - getService( - request?: protos.google.cloud.run.v2.IGetServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('getService request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getService response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getService(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.IService, - protos.google.cloud.run.v2.IGetServiceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getService response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets the IAM Access Control policy currently in effect for the given - * Cloud Run Service. This result does not include any inherited policies. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/services.get_iam_policy.js - * region_tag:run_v2_generated_Services_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Sets the IAM Access control policy for the specified Service. Overwrites - * any existing policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/services.set_iam_policy.js - * region_tag:run_v2_generated_Services_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Returns permissions that a caller has on the specified Project. - * - * There are no permissions required for making this API call. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/services.test_iam_permissions.js - * region_tag:run_v2_generated_Services_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a new Service in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project in which this service should be created. - * Format: projects/{project}/locations/{location}, where {project} can be - * project id or number. Only lowercase characters, digits, and hyphens. - * @param {google.cloud.run.v2.Service} request.service - * Required. The Service instance to create. - * @param {string} request.serviceId - * Required. The unique identifier for the Service. It must begin with letter, - * and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the service becomes {parent}/services/{service_id}. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/services.create_service.js - * region_tag:run_v2_generated_Services_CreateService_async - */ - createService( - request?: protos.google.cloud.run.v2.ICreateServiceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createService( - request: protos.google.cloud.run.v2.ICreateServiceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createService( - request: protos.google.cloud.run.v2.ICreateServiceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createService( - request?: protos.google.cloud.run.v2.ICreateServiceRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createService response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createService request %j', request); - return this.innerApiCalls.createService(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createService response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createService()`. - * @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/v2/services.create_service.js - * region_tag:run_v2_generated_Services_CreateService_async - */ - async checkCreateServiceProgress(name: string): Promise>{ - this._log.info('createService long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createService, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a Service. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The list of fields to be updated. - * @param {google.cloud.run.v2.Service} request.service - * Required. The Service to be updated. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * @param {boolean} [request.allowMissing] - * Optional. If set to true, and if the Service does not exist, it will create - * a new one. The caller must have 'run.services.create' permissions if this - * is set to true and the Service does not exist. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/services.update_service.js - * region_tag:run_v2_generated_Services_UpdateService_async - */ - updateService( - request?: protos.google.cloud.run.v2.IUpdateServiceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateService( - request: protos.google.cloud.run.v2.IUpdateServiceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateService( - request: protos.google.cloud.run.v2.IUpdateServiceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateService( - request?: protos.google.cloud.run.v2.IUpdateServiceRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.service?.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateService response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateService request %j', request); - return this.innerApiCalls.updateService(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateService response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateService()`. - * @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/v2/services.update_service.js - * region_tag:run_v2_generated_Services_UpdateService_async - */ - async checkUpdateServiceProgress(name: string): Promise>{ - this._log.info('updateService long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateService, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Service. - * This will cause the Service to stop serving traffic and will delete all - * revisions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Service. - * Format: projects/{project}/locations/{location}/services/{service}, where - * {project} can be project id or number. - * @param {boolean} request.validateOnly - * Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/services.delete_service.js - * region_tag:run_v2_generated_Services_DeleteService_async - */ - deleteService( - request?: protos.google.cloud.run.v2.IDeleteServiceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteService( - request: protos.google.cloud.run.v2.IDeleteServiceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteService( - request: protos.google.cloud.run.v2.IDeleteServiceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteService( - request?: protos.google.cloud.run.v2.IDeleteServiceRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteService response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteService request %j', request); - return this.innerApiCalls.deleteService(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteService response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteService()`. - * @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/v2/services.delete_service.js - * region_tag:run_v2_generated_Services_DeleteService_async - */ - async checkDeleteServiceProgress(name: string): Promise>{ - this._log.info('deleteService long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteService, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists Services. Results are sorted by creation time, descending. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - * @param {number} request.pageSize - * Maximum number of Services to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListServices. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.Service|Service}. - * 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 `listServicesAsync()` - * 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. - */ - listServices( - request?: protos.google.cloud.run.v2.IListServicesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IService[], - protos.google.cloud.run.v2.IListServicesRequest|null, - protos.google.cloud.run.v2.IListServicesResponse - ]>; - listServices( - request: protos.google.cloud.run.v2.IListServicesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListServicesRequest, - protos.google.cloud.run.v2.IListServicesResponse|null|undefined, - protos.google.cloud.run.v2.IService>): void; - listServices( - request: protos.google.cloud.run.v2.IListServicesRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListServicesRequest, - protos.google.cloud.run.v2.IListServicesResponse|null|undefined, - protos.google.cloud.run.v2.IService>): void; - listServices( - request?: protos.google.cloud.run.v2.IListServicesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListServicesRequest, - protos.google.cloud.run.v2.IListServicesResponse|null|undefined, - protos.google.cloud.run.v2.IService>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListServicesRequest, - protos.google.cloud.run.v2.IListServicesResponse|null|undefined, - protos.google.cloud.run.v2.IService>): - Promise<[ - protos.google.cloud.run.v2.IService[], - protos.google.cloud.run.v2.IListServicesRequest|null, - protos.google.cloud.run.v2.IListServicesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListServicesRequest, - protos.google.cloud.run.v2.IListServicesResponse|null|undefined, - protos.google.cloud.run.v2.IService>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listServices values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listServices request %j', request); - return this.innerApiCalls - .listServices(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.IService[], - protos.google.cloud.run.v2.IListServicesRequest|null, - protos.google.cloud.run.v2.IListServicesResponse - ]) => { - this._log.info('listServices values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listServices`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - * @param {number} request.pageSize - * Maximum number of Services to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListServices. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Service|Service} 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 `listServicesAsync()` - * 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. - */ - listServicesStream( - request?: protos.google.cloud.run.v2.IListServicesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listServices']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listServices stream %j', request); - return this.descriptors.page.listServices.createStream( - this.innerApiCalls.listServices as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listServices`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: projects/{project}/locations/{location}, where {project} - * can be project id or number. - * @param {number} request.pageSize - * Maximum number of Services to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListServices. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.Service|Service}. 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/v2/services.list_services.js - * region_tag:run_v2_generated_Services_ListServices_async - */ - listServicesAsync( - request?: protos.google.cloud.run.v2.IListServicesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listServices']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listServices iterate %j', request); - return this.descriptors.page.listServices.asyncIterate( - this.innerApiCalls['listServices'] 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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.servicesStub && !this._terminated) { - return this.servicesStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/services_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/services_client_config.json deleted file mode 100644 index d9a33646b69..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/services_client_config.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Services": { - "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": { - "CreateService": { - "timeout_millis": 15000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetService": { - "timeout_millis": 10000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListServices": { - "timeout_millis": 10000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateService": { - "timeout_millis": 15000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteService": { - "timeout_millis": 10000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/services_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts b/owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts deleted file mode 100644 index 38b33a4e5dc..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/tasks_client.ts +++ /dev/null @@ -1,1293 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/tasks_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './tasks_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run Task Control Plane API. - * @class - * @memberof v2 - */ -export class TasksClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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}; - tasksStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of TasksClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TasksClient({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 TasksClient; - 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 = 'run.' + 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 = { - cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' - ), - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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 = { - listTasks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.Tasks', 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.tasksStub) { - return this.tasksStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.Tasks. - this.tasksStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.Tasks') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.Tasks, - 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 tasksStubMethods = - ['getTask', 'listTasks']; - for (const methodName of tasksStubMethods) { - const callPromise = this.tasksStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.tasksStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about a Task. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the Task. - * Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.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/v2/tasks.get_task.js - * region_tag:run_v2_generated_Tasks_GetTask_async - */ - getTask( - request?: protos.google.cloud.run.v2.IGetTaskRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|undefined, {}|undefined - ]>; - getTask( - request: protos.google.cloud.run.v2.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request: protos.google.cloud.run.v2.IGetTaskRequest, - callback: Callback< - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request?: protos.google.cloud.run.v2.IGetTaskRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.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().catch(err => {throw err}); - this._log.info('getTask request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getTask response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getTask(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.ITask, - protos.google.cloud.run.v2.IGetTaskRequest|undefined, - {}|undefined - ]) => { - this._log.info('getTask response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - - /** - * Lists Tasks from an Execution of a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * @param {number} request.pageSize - * Maximum number of Tasks to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListTasks. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.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.run.v2.IListTasksRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.ITask[], - protos.google.cloud.run.v2.IListTasksRequest|null, - protos.google.cloud.run.v2.IListTasksResponse - ]>; - listTasks( - request: protos.google.cloud.run.v2.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListTasksRequest, - protos.google.cloud.run.v2.IListTasksResponse|null|undefined, - protos.google.cloud.run.v2.ITask>): void; - listTasks( - request: protos.google.cloud.run.v2.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListTasksRequest, - protos.google.cloud.run.v2.IListTasksResponse|null|undefined, - protos.google.cloud.run.v2.ITask>): void; - listTasks( - request?: protos.google.cloud.run.v2.IListTasksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListTasksRequest, - protos.google.cloud.run.v2.IListTasksResponse|null|undefined, - protos.google.cloud.run.v2.ITask>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListTasksRequest, - protos.google.cloud.run.v2.IListTasksResponse|null|undefined, - protos.google.cloud.run.v2.ITask>): - Promise<[ - protos.google.cloud.run.v2.ITask[], - protos.google.cloud.run.v2.IListTasksRequest|null, - protos.google.cloud.run.v2.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().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListTasksRequest, - protos.google.cloud.run.v2.IListTasksResponse|null|undefined, - protos.google.cloud.run.v2.ITask>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listTasks values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listTasks request %j', request); - return this.innerApiCalls - .listTasks(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.ITask[], - protos.google.cloud.run.v2.IListTasksRequest|null, - protos.google.cloud.run.v2.IListTasksResponse - ]) => { - this._log.info('listTasks values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listTasks`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * @param {number} request.pageSize - * Maximum number of Tasks to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListTasks. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.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.run.v2.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().catch(err => {throw err}); - this._log.info('listTasks stream %j', request); - 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. The Execution from which the Tasks should be listed. - * To list all Tasks across Executions of a Job, use "-" instead of Execution - * name. To list all Tasks across Jobs, use "-" instead of Job name. Format: - * projects/{project}/locations/{location}/jobs/{job}/executions/{execution} - * @param {number} request.pageSize - * Maximum number of Tasks to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListTasks. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.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/v2/tasks.list_tasks.js - * region_tag:run_v2_generated_Tasks_ListTasks_async - */ - listTasksAsync( - request?: protos.google.cloud.run.v2.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().catch(err => {throw err}); - this._log.info('listTasks iterate %j', request); - 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); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified cryptoKey resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} key_ring - * @param {string} crypto_key - * @returns {string} Resource name string. - */ - cryptoKeyPath(project:string,location:string,keyRing:string,cryptoKey:string) { - return this.pathTemplates.cryptoKeyPathTemplate.render({ - project: project, - location: location, - key_ring: keyRing, - crypto_key: cryptoKey, - }); - } - - /** - * Parse the project from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).project; - } - - /** - * Parse the location from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).location; - } - - /** - * Parse the key_ring from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the key_ring. - */ - matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key_ring; - } - - /** - * Parse the crypto_key from CryptoKey resource. - * - * @param {string} cryptoKeyName - * A fully-qualified path representing CryptoKey resource. - * @returns {string} A string representing the crypto_key. - */ - matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { - return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).crypto_key; - } - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.tasksStub && !this._terminated) { - return this.tasksStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json deleted file mode 100644 index c9fe28e061c..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/tasks_client_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.Tasks": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "GetTask": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTasks": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/tasks_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts deleted file mode 100644 index 842874cf75c..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client.ts +++ /dev/null @@ -1,2243 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v2/worker_pools_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './worker_pools_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Run WorkerPool Control Plane API. - * @class - * @memberof v2 - */ -export class WorkerPoolsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('run'); - - 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; - workerPoolsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of WorkerPoolsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new WorkerPoolsClient({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 WorkerPoolsClient; - 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 = 'run.' + 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 = { - executionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - 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}' - ), - revisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}' - ), - workerPoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workerPools/{worker_pool}' - ), - }; - - // 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 = { - listWorkerPools: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workerPools') - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=projects/*/locations/*}/operations',},{selector: 'google.longrunning.Operations.WaitOperation',post: '/v2/{name=projects/*/locations/*/operations/*}:wait',body: '*',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createWorkerPoolResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - const createWorkerPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - const updateWorkerPoolResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - const updateWorkerPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - const deleteWorkerPoolResponse = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - const deleteWorkerPoolMetadata = protoFilesRoot.lookup( - '.google.cloud.run.v2.WorkerPool') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createWorkerPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createWorkerPoolResponse.decode.bind(createWorkerPoolResponse), - createWorkerPoolMetadata.decode.bind(createWorkerPoolMetadata)), - updateWorkerPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateWorkerPoolResponse.decode.bind(updateWorkerPoolResponse), - updateWorkerPoolMetadata.decode.bind(updateWorkerPoolMetadata)), - deleteWorkerPool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteWorkerPoolResponse.decode.bind(deleteWorkerPoolResponse), - deleteWorkerPoolMetadata.decode.bind(deleteWorkerPoolMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.run.v2.WorkerPools', 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.workerPoolsStub) { - return this.workerPoolsStub; - } - - // Put together the "service stub" for - // google.cloud.run.v2.WorkerPools. - this.workerPoolsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.run.v2.WorkerPools') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.run.v2.WorkerPools, - 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 workerPoolsStubMethods = - ['createWorkerPool', 'getWorkerPool', 'listWorkerPools', 'updateWorkerPool', 'deleteWorkerPool', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; - for (const methodName of workerPoolsStubMethods) { - const callPromise = this.workerPoolsStub.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.workerPoolsStub; - } - - /** - * 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 'run.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 'run.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 -- - // ------------------- -/** - * Gets information about a WorkerPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the WorkerPool. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - * `{project}` can be project id or number. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.run.v2.WorkerPool|WorkerPool}. - * 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/v2/worker_pools.get_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_GetWorkerPool_async - */ - getWorkerPool( - request?: protos.google.cloud.run.v2.IGetWorkerPoolRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|undefined, {}|undefined - ]>; - getWorkerPool( - request: protos.google.cloud.run.v2.IGetWorkerPoolRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, - {}|null|undefined>): void; - getWorkerPool( - request: protos.google.cloud.run.v2.IGetWorkerPoolRequest, - callback: Callback< - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, - {}|null|undefined>): void; - getWorkerPool( - request?: protos.google.cloud.run.v2.IGetWorkerPoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - this._log.info('getWorkerPool request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getWorkerPool response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getWorkerPool(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.run.v2.IWorkerPool, - protos.google.cloud.run.v2.IGetWorkerPoolRequest|undefined, - {}|undefined - ]) => { - this._log.info('getWorkerPool response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Gets the IAM Access Control policy currently in effect for the given - * Cloud Run WorkerPool. This result does not include any inherited policies. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/worker_pools.get_iam_policy.js - * region_tag:run_v2_generated_WorkerPools_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Sets the IAM Access control policy for the specified WorkerPool. Overwrites - * any existing policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/worker_pools.set_iam_policy.js - * region_tag:run_v2_generated_WorkerPools_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('setIamPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('setIamPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.setIamPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('setIamPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Returns permissions that a caller has on the specified Project. - * - * There are no permissions required for making this API call. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v2/worker_pools.test_iam_permissions.js - * region_tag:run_v2_generated_WorkerPools_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource': request.resource ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('testIamPermissions request %j', request); - const wrappedCallback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('testIamPermissions response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.testIamPermissions(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, - {}|undefined - ]) => { - this._log.info('testIamPermissions response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a new WorkerPool in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project in which this worker pool should be - * created. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. Only lowercase characters, digits, - * and hyphens. - * @param {google.cloud.run.v2.WorkerPool} request.workerPool - * Required. The WorkerPool instance to create. - * @param {string} request.workerPoolId - * Required. The unique identifier for the WorkerPool. It must begin with - * letter, and cannot end with hyphen; must contain fewer than 50 characters. - * The name of the worker pool becomes - * `{parent}/workerPools/{worker_pool_id}`. - * @param {boolean} [request.validateOnly] - * Optional. Indicates that the request should be validated and default values - * populated, without persisting the request or creating any resources. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/worker_pools.create_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_CreateWorkerPool_async - */ - createWorkerPool( - request?: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createWorkerPool( - request: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createWorkerPool( - request: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createWorkerPool( - request?: protos.google.cloud.run.v2.ICreateWorkerPoolRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createWorkerPool response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createWorkerPool request %j', request); - return this.innerApiCalls.createWorkerPool(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createWorkerPool response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createWorkerPool()`. - * @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/v2/worker_pools.create_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_CreateWorkerPool_async - */ - async checkCreateWorkerPoolProgress(name: string): Promise>{ - this._log.info('createWorkerPool long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createWorkerPool, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a WorkerPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The list of fields to be updated. - * @param {google.cloud.run.v2.WorkerPool} request.workerPool - * Required. The WorkerPool to be updated. - * @param {boolean} [request.validateOnly] - * Optional. Indicates that the request should be validated and default values - * populated, without persisting the request or updating any resources. - * @param {boolean} [request.allowMissing] - * Optional. If set to true, and if the WorkerPool does not exist, it will - * create a new one. The caller must have 'run.workerpools.create' permissions - * if this is set to true and the WorkerPool does not exist. - * @param {boolean} [request.forceNewRevision] - * Optional. If set to true, a new revision will be created from the template - * even if the system doesn't detect any changes from the previously deployed - * revision. - * - * This may be useful for cases where the underlying resources need to be - * recreated or reinitialized. For example if the image is specified by label, - * but the underlying image digest has changed) or if the container performs - * deployment initialization work that needs to be performed again. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/worker_pools.update_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_UpdateWorkerPool_async - */ - updateWorkerPool( - request?: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateWorkerPool( - request: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateWorkerPool( - request: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateWorkerPool( - request?: protos.google.cloud.run.v2.IUpdateWorkerPoolRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.workerPool?.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateWorkerPool response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateWorkerPool request %j', request); - return this.innerApiCalls.updateWorkerPool(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateWorkerPool response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateWorkerPool()`. - * @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/v2/worker_pools.update_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_UpdateWorkerPool_async - */ - async checkUpdateWorkerPoolProgress(name: string): Promise>{ - this._log.info('updateWorkerPool long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateWorkerPool, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a WorkerPool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The full name of the WorkerPool. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where - * `{project}` can be project id or number. - * @param {boolean} [request.validateOnly] - * Optional. Indicates that the request should be validated without actually - * deleting any resources. - * @param {string} request.etag - * A system-generated fingerprint for this version of the - * resource. May be used to detect modification conflict during updates. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v2/worker_pools.delete_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_DeleteWorkerPool_async - */ - deleteWorkerPool( - request?: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteWorkerPool( - request: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteWorkerPool( - request: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteWorkerPool( - request?: protos.google.cloud.run.v2.IDeleteWorkerPoolRequest, - 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)(?:/.*)?')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteWorkerPool response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteWorkerPool request %j', request); - return this.innerApiCalls.deleteWorkerPool(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteWorkerPool response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteWorkerPool()`. - * @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/v2/worker_pools.delete_worker_pool.js - * region_tag:run_v2_generated_WorkerPools_DeleteWorkerPool_async - */ - async checkDeleteWorkerPoolProgress(name: string): Promise>{ - this._log.info('deleteWorkerPool long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteWorkerPool, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists WorkerPools. Results are sorted by creation time, descending. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of WorkerPools to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListWorkerPools. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.run.v2.WorkerPool|WorkerPool}. - * 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 `listWorkerPoolsAsync()` - * 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. - */ - listWorkerPools( - request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.run.v2.IWorkerPool[], - protos.google.cloud.run.v2.IListWorkerPoolsRequest|null, - protos.google.cloud.run.v2.IListWorkerPoolsResponse - ]>; - listWorkerPools( - request: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListWorkerPoolsRequest, - protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, - protos.google.cloud.run.v2.IWorkerPool>): void; - listWorkerPools( - request: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - callback: PaginationCallback< - protos.google.cloud.run.v2.IListWorkerPoolsRequest, - protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, - protos.google.cloud.run.v2.IWorkerPool>): void; - listWorkerPools( - request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.run.v2.IListWorkerPoolsRequest, - protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, - protos.google.cloud.run.v2.IWorkerPool>, - callback?: PaginationCallback< - protos.google.cloud.run.v2.IListWorkerPoolsRequest, - protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, - protos.google.cloud.run.v2.IWorkerPool>): - Promise<[ - protos.google.cloud.run.v2.IWorkerPool[], - protos.google.cloud.run.v2.IListWorkerPoolsRequest|null, - protos.google.cloud.run.v2.IListWorkerPoolsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.run.v2.IListWorkerPoolsRequest, - protos.google.cloud.run.v2.IListWorkerPoolsResponse|null|undefined, - protos.google.cloud.run.v2.IWorkerPool>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listWorkerPools values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listWorkerPools request %j', request); - return this.innerApiCalls - .listWorkerPools(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.run.v2.IWorkerPool[], - protos.google.cloud.run.v2.IListWorkerPoolsRequest|null, - protos.google.cloud.run.v2.IListWorkerPoolsResponse - ]) => { - this._log.info('listWorkerPools values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listWorkerPools`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of WorkerPools to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListWorkerPools. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.WorkerPool|WorkerPool} 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 `listWorkerPoolsAsync()` - * 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. - */ - listWorkerPoolsStream( - request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listWorkerPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listWorkerPools stream %j', request); - return this.descriptors.page.listWorkerPools.createStream( - this.innerApiCalls.listWorkerPools as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listWorkerPools`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location and project to list resources on. - * Location must be a valid Google Cloud region, and cannot be the "-" - * wildcard. Format: `projects/{project}/locations/{location}`, where - * `{project}` can be project id or number. - * @param {number} request.pageSize - * Maximum number of WorkerPools to return in this call. - * @param {string} request.pageToken - * A page token received from a previous call to ListWorkerPools. - * All other parameters must match. - * @param {boolean} request.showDeleted - * If true, returns deleted (but unexpired) resources along with active ones. - * @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.run.v2.WorkerPool|WorkerPool}. 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/v2/worker_pools.list_worker_pools.js - * region_tag:run_v2_generated_WorkerPools_ListWorkerPools_async - */ - listWorkerPoolsAsync( - request?: protos.google.cloud.run.v2.IListWorkerPoolsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.parent; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('projects/[^/]+/locations/(?[^/]+)')); - if (match) { - const parameterValue = match.groups?.['location'] ?? fieldValue; - Object.assign(routingParameter, { location: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - const defaultCallSettings = this._defaults['listWorkerPools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listWorkerPools iterate %j', request); - return this.descriptors.page.listWorkerPools.asyncIterate( - this.innerApiCalls['listWorkerPools'] 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, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified execution resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @returns {string} Resource name string. - */ - executionPath(project:string,location:string,job:string,execution:string) { - return this.pathTemplates.executionPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - }); - } - - /** - * Parse the project from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the project. - */ - matchProjectFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).project; - } - - /** - * Parse the location from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the location. - */ - matchLocationFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).location; - } - - /** - * Parse the job from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the job. - */ - matchJobFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).job; - } - - /** - * Parse the execution from Execution resource. - * - * @param {string} executionName - * A fully-qualified path representing Execution resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromExecutionName(executionName: string) { - return this.pathTemplates.executionPathTemplate.match(executionName).execution; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified 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 revision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @param {string} revision - * @returns {string} Resource name string. - */ - revisionPath(project:string,location:string,service:string,revision:string) { - return this.pathTemplates.revisionPathTemplate.render({ - project: project, - location: location, - service: service, - revision: revision, - }); - } - - /** - * Parse the project from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).project; - } - - /** - * Parse the location from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).location; - } - - /** - * Parse the service from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the service. - */ - matchServiceFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).service; - } - - /** - * Parse the revision from Revision resource. - * - * @param {string} revisionName - * A fully-qualified path representing Revision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromRevisionName(revisionName: string) { - return this.pathTemplates.revisionPathTemplate.match(revisionName).revision; - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} service - * @returns {string} Resource name string. - */ - servicePath(project:string,location:string,service:string) { - return this.pathTemplates.servicePathTemplate.render({ - project: project, - location: location, - service: service, - }); - } - - /** - * Parse the project from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the project. - */ - matchProjectFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the location from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the location. - */ - matchLocationFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).location; - } - - /** - * Parse the service from Service resource. - * - * @param {string} serviceName - * A fully-qualified path representing Service resource. - * @returns {string} A string representing the service. - */ - matchServiceFromServiceName(serviceName: string) { - return this.pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} execution - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,execution:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - execution: execution, - 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 execution from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the execution. - */ - matchExecutionFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).execution; - } - - /** - * 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 workerPool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} worker_pool - * @returns {string} Resource name string. - */ - workerPoolPath(project:string,location:string,workerPool:string) { - return this.pathTemplates.workerPoolPathTemplate.render({ - project: project, - location: location, - worker_pool: workerPool, - }); - } - - /** - * Parse the project from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).project; - } - - /** - * Parse the location from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).location; - } - - /** - * Parse the worker_pool from WorkerPool resource. - * - * @param {string} workerPoolName - * A fully-qualified path representing WorkerPool resource. - * @returns {string} A string representing the worker_pool. - */ - matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { - return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName).worker_pool; - } - - /** - * 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.workerPoolsStub && !this._terminated) { - return this.workerPoolsStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json deleted file mode 100644 index ac049ec5316..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_client_config.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "interfaces": { - "google.cloud.run.v2.WorkerPools": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateWorkerPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetWorkerPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListWorkerPools": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateWorkerPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteWorkerPool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetIamPolicy": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json b/owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json deleted file mode 100644 index 0d5d6ea6137..00000000000 --- a/owl-bot-staging/google-cloud-run/src/v2/worker_pools_proto_list.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - "../../protos/google/cloud/run/v2/build.proto", - "../../protos/google/cloud/run/v2/condition.proto", - "../../protos/google/cloud/run/v2/container_status.proto", - "../../protos/google/cloud/run/v2/execution.proto", - "../../protos/google/cloud/run/v2/execution_template.proto", - "../../protos/google/cloud/run/v2/instance.proto", - "../../protos/google/cloud/run/v2/instance_split.proto", - "../../protos/google/cloud/run/v2/job.proto", - "../../protos/google/cloud/run/v2/k8s.min.proto", - "../../protos/google/cloud/run/v2/revision.proto", - "../../protos/google/cloud/run/v2/revision_template.proto", - "../../protos/google/cloud/run/v2/service.proto", - "../../protos/google/cloud/run/v2/status.proto", - "../../protos/google/cloud/run/v2/task.proto", - "../../protos/google/cloud/run/v2/task_template.proto", - "../../protos/google/cloud/run/v2/traffic_target.proto", - "../../protos/google/cloud/run/v2/vendor_settings.proto", - "../../protos/google/cloud/run/v2/worker_pool.proto", - "../../protos/google/cloud/run/v2/worker_pool_revision_template.proto" -] diff --git a/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js deleted file mode 100644 index b75bcd5378f..00000000000 --- a/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const run = require('@google-cloud/run'); - -function main() { - const buildsClient = new run.BuildsClient(); - const executionsClient = new run.ExecutionsClient(); - const instancesClient = new run.InstancesClient(); - const jobsClient = new run.JobsClient(); - const revisionsClient = new run.RevisionsClient(); - const servicesClient = new run.ServicesClient(); - const tasksClient = new run.TasksClient(); - const workerPoolsClient = new run.WorkerPoolsClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index bdf1cc11f53..00000000000 --- a/owl-bot-staging/google-cloud-run/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient} from '@google-cloud/run'; - -// check that the client class type name can be used -function doStuffWithBuildsClient(client: BuildsClient) { - client.close(); -} -function doStuffWithExecutionsClient(client: ExecutionsClient) { - client.close(); -} -function doStuffWithInstancesClient(client: InstancesClient) { - client.close(); -} -function doStuffWithJobsClient(client: JobsClient) { - client.close(); -} -function doStuffWithRevisionsClient(client: RevisionsClient) { - client.close(); -} -function doStuffWithServicesClient(client: ServicesClient) { - client.close(); -} -function doStuffWithTasksClient(client: TasksClient) { - client.close(); -} -function doStuffWithWorkerPoolsClient(client: WorkerPoolsClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const buildsClient = new BuildsClient(); - doStuffWithBuildsClient(buildsClient); - // check that the client instance can be created - const executionsClient = new ExecutionsClient(); - doStuffWithExecutionsClient(executionsClient); - // check that the client instance can be created - const instancesClient = new InstancesClient(); - doStuffWithInstancesClient(instancesClient); - // check that the client instance can be created - const jobsClient = new JobsClient(); - doStuffWithJobsClient(jobsClient); - // check that the client instance can be created - const revisionsClient = new RevisionsClient(); - doStuffWithRevisionsClient(revisionsClient); - // check that the client instance can be created - const servicesClient = new ServicesClient(); - doStuffWithServicesClient(servicesClient); - // check that the client instance can be created - const tasksClient = new TasksClient(); - doStuffWithTasksClient(tasksClient); - // check that the client instance can be created - const workerPoolsClient = new WorkerPoolsClient(); - doStuffWithWorkerPoolsClient(workerPoolsClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-run/system-test/install.ts b/owl-bot-staging/google-cloud-run/system-test/install.ts deleted file mode 100644 index 394f3362d20..00000000000 --- a/owl-bot-staging/google-cloud-run/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {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-run/test/gapic_builds_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_builds_v2.ts deleted file mode 100644 index a0a18108510..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_builds_v2.ts +++ /dev/null @@ -1,865 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as buildsModule from '../src'; - -import {protobuf, 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 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('v2.BuildsClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new buildsModule.v2.BuildsClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new buildsModule.v2.BuildsClient(); - 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 = buildsModule.v2.BuildsClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = buildsModule.v2.BuildsClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new buildsModule.v2.BuildsClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new buildsModule.v2.BuildsClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 buildsModule.v2.BuildsClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 buildsModule.v2.BuildsClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 buildsModule.v2.BuildsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = buildsModule.v2.BuildsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new buildsModule.v2.BuildsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new buildsModule.v2.BuildsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.buildsStub, undefined); - await client.initialize(); - assert(client.buildsStub); - }); - - it('has close method for the initialized client', done => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.buildsStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.buildsStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new buildsModule.v2.BuildsClient({ - 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 buildsModule.v2.BuildsClient({ - 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('submitBuild', () => { - it('invokes submitBuild without error', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildResponse() - ); - client.innerApiCalls.submitBuild = stubSimpleCall(expectedResponse); - const [response] = await client.submitBuild(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitBuild without error using callback', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildResponse() - ); - client.innerApiCalls.submitBuild = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.submitBuild( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.ISubmitBuildResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitBuild with error', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.submitBuild = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.submitBuild(request), expectedError); - const actualRequest = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitBuild as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitBuild with closed client', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.SubmitBuildRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.SubmitBuildRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.submitBuild(request), expectedError); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('Path templates', () => { - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new buildsModule.v2.BuildsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts deleted file mode 100644 index 69f44a4308b..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_executions_v2.ts +++ /dev/null @@ -1,1784 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as executionsModule 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('v2.ExecutionsClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new executionsModule.v2.ExecutionsClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new executionsModule.v2.ExecutionsClient(); - 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 = executionsModule.v2.ExecutionsClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = executionsModule.v2.ExecutionsClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new executionsModule.v2.ExecutionsClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new executionsModule.v2.ExecutionsClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 executionsModule.v2.ExecutionsClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 executionsModule.v2.ExecutionsClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 executionsModule.v2.ExecutionsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = executionsModule.v2.ExecutionsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new executionsModule.v2.ExecutionsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new executionsModule.v2.ExecutionsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.executionsStub, undefined); - await client.initialize(); - assert(client.executionsStub); - }); - - it('has close method for the initialized client', done => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.executionsStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.executionsStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new executionsModule.v2.ExecutionsClient({ - 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 executionsModule.v2.ExecutionsClient({ - 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('getExecution', () => { - it('invokes getExecution without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Execution() - ); - client.innerApiCalls.getExecution = stubSimpleCall(expectedResponse); - const [response] = await client.getExecution(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExecution without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Execution() - ); - client.innerApiCalls.getExecution = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getExecution( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IExecution|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExecution with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getExecution with closed client', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getExecution(request), expectedError); - }); - }); - - describe('deleteExecution', () => { - it('invokes deleteExecution without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteExecution = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteExecution(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExecution without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteExecution = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteExecution( - 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.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExecution with call error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteExecution with LRO error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteExecution(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteExecutionProgress without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteExecutionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteExecutionProgress with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteExecutionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('cancelExecution', () => { - it('invokes cancelExecution without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CancelExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.cancelExecution = stubLongRunningCall(expectedResponse); - const [operation] = await client.cancelExecution(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelExecution without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CancelExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.cancelExecution = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelExecution( - 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.cancelExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelExecution with call error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CancelExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelExecution = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.cancelExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelExecution with LRO error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CancelExecutionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.CancelExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelExecution = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.cancelExecution(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCancelExecutionProgress without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCancelExecutionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCancelExecutionProgress with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCancelExecutionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listExecutions', () => { - it('invokes listExecutions without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - ]; - client.innerApiCalls.listExecutions = stubSimpleCall(expectedResponse); - const [response] = await client.listExecutions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExecutions without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - ]; - client.innerApiCalls.listExecutions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listExecutions( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IExecution[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExecutions with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listExecutions(request), expectedError); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listExecutionsStream without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - ]; - client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listExecutionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Execution[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Execution) => { - 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.listExecutions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); - assert( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listExecutionsStream with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listExecutionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Execution[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Execution) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listExecutions, request)); - assert( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExecutions without error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - generateSampleMessage(new protos.google.cloud.run.v2.Execution()), - ]; - client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.IExecution[] = []; - const iterable = client.listExecutionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listExecutions with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListExecutionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listExecutionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.run.v2.IExecution[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listExecutions.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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - 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 executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new executionsModule.v2.ExecutionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts deleted file mode 100644 index 014c64087bf..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_jobs_v2.ts +++ /dev/null @@ -1,2393 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as jobsModule 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('v2.JobsClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new jobsModule.v2.JobsClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new jobsModule.v2.JobsClient(); - 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 = jobsModule.v2.JobsClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = jobsModule.v2.JobsClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new jobsModule.v2.JobsClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new jobsModule.v2.JobsClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 jobsModule.v2.JobsClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 jobsModule.v2.JobsClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 jobsModule.v2.JobsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = jobsModule.v2.JobsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new jobsModule.v2.JobsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new jobsModule.v2.JobsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.jobsStub, undefined); - await client.initialize(); - assert(client.jobsStub); - }); - - it('has close method for the initialized client', done => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.jobsStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.jobsStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new jobsModule.v2.JobsClient({ - 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 jobsModule.v2.JobsClient({ - 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('getJob', () => { - it('invokes getJob without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Job() - ); - client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJob( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getJob(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('createJob', () => { - it('invokes createJob without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateJobRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.createJob(request); - const [response] = await operation.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 without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateJobRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createJob( - 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.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 call error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateJobRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createJob = stubLongRunningCall(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 LRO error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateJobRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createJob(request); - await assert.rejects(operation.promise(), 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 checkCreateJobProgress without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateJobProgress with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateJob', () => { - it('invokes updateJob without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateJobRequest() - ); - request.job = {}; - // path template: projects/*/locations/{location=*}/** - request.job.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateJob(request); - const [response] = await operation.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 without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateJobRequest() - ); - request.job = {}; - // path template: projects/*/locations/{location=*}/** - request.job.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateJob( - 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.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 call error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateJobRequest() - ); - request.job = {}; - // path template: projects/*/locations/{location=*}/** - request.job.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateJob = stubLongRunningCall(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 LRO error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateJobRequest() - ); - request.job = {}; - // path template: projects/*/locations/{location=*}/** - request.job.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateJob(request); - await assert.rejects(operation.promise(), 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 checkUpdateJobProgress without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateJobProgress with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteJob', () => { - it('invokes deleteJob without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('runJob', () => { - it('invokes runJob without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.RunJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.runJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.runJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runJob without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.RunJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.runJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runJob( - 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.runJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runJob with call error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.RunJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.runJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.runJob(request), expectedError); - const actualRequest = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runJob with LRO error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.RunJobRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.runJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.runJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.runJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRunJobProgress without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRunJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRunJobProgress with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRunJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listJobs', () => { - it('invokes listJobs without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listJobs( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - ]; - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Job[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - 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.run.v2.Job[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - generateSampleMessage(new protos.google.cloud.run.v2.Job()), - ]; - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListJobsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - 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.run.v2.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('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new jobsModule.v2.JobsClient({ - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new jobsModule.v2.JobsClient({ - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new jobsModule.v2.JobsClient({ - 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 jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new jobsModule.v2.JobsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts deleted file mode 100644 index 19e6f48c13f..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_revisions_v2.ts +++ /dev/null @@ -1,1669 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as revisionsModule 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('v2.RevisionsClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new revisionsModule.v2.RevisionsClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new revisionsModule.v2.RevisionsClient(); - 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 = revisionsModule.v2.RevisionsClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = revisionsModule.v2.RevisionsClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new revisionsModule.v2.RevisionsClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new revisionsModule.v2.RevisionsClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 revisionsModule.v2.RevisionsClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 revisionsModule.v2.RevisionsClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 revisionsModule.v2.RevisionsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = revisionsModule.v2.RevisionsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new revisionsModule.v2.RevisionsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new revisionsModule.v2.RevisionsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.revisionsStub, undefined); - await client.initialize(); - assert(client.revisionsStub); - }); - - it('has close method for the initialized client', done => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.revisionsStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.revisionsStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new revisionsModule.v2.RevisionsClient({ - 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 revisionsModule.v2.RevisionsClient({ - 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('getRevision', () => { - it('invokes getRevision without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Revision() - ); - client.innerApiCalls.getRevision = stubSimpleCall(expectedResponse); - const [response] = await client.getRevision(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRevision without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Revision() - ); - client.innerApiCalls.getRevision = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getRevision( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IRevision|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRevision with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.getRevision = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getRevision(request), expectedError); - const actualRequest = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRevision with closed client', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getRevision(request), expectedError); - }); - }); - - describe('deleteRevision', () => { - it('invokes deleteRevision without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteRevision = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteRevision(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRevision without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteRevision = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteRevision( - 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.deleteRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRevision with call error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteRevision = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteRevision(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRevision with LRO error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteRevisionRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteRevision = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteRevision(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteRevisionProgress without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteRevisionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteRevisionProgress with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteRevisionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listRevisions', () => { - it('invokes listRevisions without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - ]; - client.innerApiCalls.listRevisions = stubSimpleCall(expectedResponse); - const [response] = await client.listRevisions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRevisions without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - ]; - client.innerApiCalls.listRevisions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listRevisions( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IRevision[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRevisions with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.listRevisions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listRevisions(request), expectedError); - const actualRequest = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRevisionsStream without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - ]; - client.descriptors.page.listRevisions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Revision[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Revision) => { - 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.listRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRevisions, request)); - assert( - (client.descriptors.page.listRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listRevisionsStream with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listRevisions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Revision[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Revision) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRevisions, request)); - assert( - (client.descriptors.page.listRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRevisions without error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - generateSampleMessage(new protos.google.cloud.run.v2.Revision()), - ]; - client.descriptors.page.listRevisions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.IRevision[] = []; - const iterable = client.listRevisionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRevisions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRevisions with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListRevisionsRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.parent = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listRevisionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.run.v2.IRevision[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRevisions.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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - 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 revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('cryptoKey', async () => { - const fakePath = "/rendered/path/cryptoKey"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - key_ring: "keyRingValue", - crypto_key: "cryptoKeyValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.cryptoKeyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.cryptoKeyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('cryptoKeyPath', () => { - const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCryptoKeyName', () => { - const result = client.matchProjectFromCryptoKeyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCryptoKeyName', () => { - const result = client.matchLocationFromCryptoKeyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchKeyRingFromCryptoKeyName', () => { - const result = client.matchKeyRingFromCryptoKeyName(fakePath); - assert.strictEqual(result, "keyRingValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCryptoKeyFromCryptoKeyName', () => { - const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); - assert.strictEqual(result, "cryptoKeyValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new revisionsModule.v2.RevisionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts deleted file mode 100644 index 5a5ff605ed7..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_services_v2.ts +++ /dev/null @@ -1,2243 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as servicesModule 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('v2.ServicesClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new servicesModule.v2.ServicesClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new servicesModule.v2.ServicesClient(); - 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 = servicesModule.v2.ServicesClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = servicesModule.v2.ServicesClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new servicesModule.v2.ServicesClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new servicesModule.v2.ServicesClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 servicesModule.v2.ServicesClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 servicesModule.v2.ServicesClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 servicesModule.v2.ServicesClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = servicesModule.v2.ServicesClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new servicesModule.v2.ServicesClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new servicesModule.v2.ServicesClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.servicesStub, undefined); - await client.initialize(); - assert(client.servicesStub); - }); - - it('has close method for the initialized client', done => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.servicesStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.servicesStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new servicesModule.v2.ServicesClient({ - 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 servicesModule.v2.ServicesClient({ - 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('getService', () => { - it('invokes getService without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Service() - ); - client.innerApiCalls.getService = stubSimpleCall(expectedResponse); - const [response] = await client.getService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getService without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Service() - ); - client.innerApiCalls.getService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getService( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IService|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getService with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.getService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getService(request), expectedError); - const actualRequest = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getService with closed client', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getService(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('createService', () => { - it('invokes createService without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateServiceRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createService = stubLongRunningCall(expectedResponse); - const [operation] = await client.createService(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createService without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateServiceRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createService = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createService( - 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.createService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createService with call error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateServiceRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createService = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createService(request), expectedError); - const actualRequest = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createService with LRO error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateServiceRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createService = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createService(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateServiceProgress without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateServiceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateServiceProgress with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateServiceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateService', () => { - it('invokes updateService without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateServiceRequest() - ); - request.service = {}; - // path template: projects/*/locations/{location=*}/** - request.service.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateService = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateService(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateService without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateServiceRequest() - ); - request.service = {}; - // path template: projects/*/locations/{location=*}/** - request.service.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateService = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateService( - 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.updateService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateService with call error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateServiceRequest() - ); - request.service = {}; - // path template: projects/*/locations/{location=*}/** - request.service.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateService = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateService(request), expectedError); - const actualRequest = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateService with LRO error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateServiceRequest() - ); - request.service = {}; - // path template: projects/*/locations/{location=*}/** - request.service.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateService = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateService(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateServiceProgress without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateServiceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateServiceProgress with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateServiceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteService', () => { - it('invokes deleteService without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteService = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteService(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteService without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteService = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteService( - 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.deleteService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteService with call error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteService = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteService(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteService with LRO error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteServiceRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteService = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteService(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteServiceProgress without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteServiceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteServiceProgress with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteServiceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listServices', () => { - it('invokes listServices without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - ]; - client.innerApiCalls.listServices = stubSimpleCall(expectedResponse); - const [response] = await client.listServices(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listServices without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - ]; - client.innerApiCalls.listServices = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listServices( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IService[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listServices with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.listServices = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listServices(request), expectedError); - const actualRequest = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listServices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listServicesStream without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - ]; - client.descriptors.page.listServices.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listServicesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Service[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Service) => { - 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.listServices.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listServices, request)); - assert( - (client.descriptors.page.listServices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listServicesStream with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listServices.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listServicesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Service[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.Service) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listServices.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listServices, request)); - assert( - (client.descriptors.page.listServices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listServices without error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - generateSampleMessage(new protos.google.cloud.run.v2.Service()), - ]; - client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.IService[] = []; - const iterable = client.listServicesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listServices.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listServices.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listServices with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListServicesRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listServicesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.run.v2.IService[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listServices.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listServices.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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - 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 servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new servicesModule.v2.ServicesClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts deleted file mode 100644 index 02f293fcb32..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_tasks_v2.ts +++ /dev/null @@ -1,1259 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as tasksModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, 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 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('v2.TasksClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new tasksModule.v2.TasksClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new tasksModule.v2.TasksClient(); - 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 = tasksModule.v2.TasksClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = tasksModule.v2.TasksClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new tasksModule.v2.TasksClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new tasksModule.v2.TasksClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 tasksModule.v2.TasksClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 tasksModule.v2.TasksClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 tasksModule.v2.TasksClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = tasksModule.v2.TasksClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new tasksModule.v2.TasksClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new tasksModule.v2.TasksClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.tasksStub, undefined); - await client.initialize(); - assert(client.tasksStub); - }); - - it('has close method for the initialized client', done => { - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.tasksStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.tasksStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new tasksModule.v2.TasksClient({ - 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 tasksModule.v2.TasksClient({ - 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('getTask', () => { - it('invokes getTask without error', async () => { - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.Task() - ); - client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTask( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getTask(request), expectedError); - }); - }); - - describe('listTasks', () => { - it('invokes listTasks without error', async () => { - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTasks( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - ]; - client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.Task[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.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.run.v2.Task[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - generateSampleMessage(new protos.google.cloud.run.v2.Task()), - ]; - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.run.v2.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.run.v2.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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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('Path templates', () => { - - describe('cryptoKey', async () => { - const fakePath = "/rendered/path/cryptoKey"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - key_ring: "keyRingValue", - crypto_key: "cryptoKeyValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.cryptoKeyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.cryptoKeyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('cryptoKeyPath', () => { - const result = client.cryptoKeyPath("projectValue", "locationValue", "keyRingValue", "cryptoKeyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCryptoKeyName', () => { - const result = client.matchProjectFromCryptoKeyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCryptoKeyName', () => { - const result = client.matchLocationFromCryptoKeyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchKeyRingFromCryptoKeyName', () => { - const result = client.matchKeyRingFromCryptoKeyName(fakePath); - assert.strictEqual(result, "keyRingValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCryptoKeyFromCryptoKeyName', () => { - const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); - assert.strictEqual(result, "cryptoKeyValue"); - assert((client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new tasksModule.v2.TasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts b/owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts deleted file mode 100644 index f74aef7c940..00000000000 --- a/owl-bot-staging/google-cloud-run/test/gapic_worker_pools_v2.ts +++ /dev/null @@ -1,2243 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as workerpoolsModule 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('v2.WorkerPoolsClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient(); - 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 = workerpoolsModule.v2.WorkerPoolsClient.servicePath; - assert.strictEqual(servicePath, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = workerpoolsModule.v2.WorkerPoolsClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'run.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 workerpoolsModule.v2.WorkerPoolsClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 workerpoolsModule.v2.WorkerPoolsClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'run.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 workerpoolsModule.v2.WorkerPoolsClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = workerpoolsModule.v2.WorkerPoolsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.workerPoolsStub, undefined); - await client.initialize(); - assert(client.workerPoolsStub); - }); - - it('has close method for the initialized client', done => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.workerPoolsStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.workerPoolsStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - 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 workerpoolsModule.v2.WorkerPoolsClient({ - 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('getWorkerPool', () => { - it('invokes getWorkerPool without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.WorkerPool() - ); - client.innerApiCalls.getWorkerPool = stubSimpleCall(expectedResponse); - const [response] = await client.getWorkerPool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getWorkerPool without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.run.v2.WorkerPool() - ); - client.innerApiCalls.getWorkerPool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getWorkerPool( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IWorkerPool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getWorkerPool with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.getWorkerPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getWorkerPool(request), expectedError); - const actualRequest = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getWorkerPool with closed client', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.GetWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getWorkerPool(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('createWorkerPool', () => { - it('invokes createWorkerPool without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createWorkerPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.createWorkerPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createWorkerPool without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createWorkerPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createWorkerPool( - 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.createWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createWorkerPool with call error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createWorkerPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createWorkerPool(request), expectedError); - const actualRequest = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createWorkerPool with LRO error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.CreateWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.createWorkerPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createWorkerPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateWorkerPoolProgress without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateWorkerPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateWorkerPoolProgress with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateWorkerPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateWorkerPool', () => { - it('invokes updateWorkerPool without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() - ); - request.workerPool = {}; - // path template: projects/*/locations/{location=*}/** - request.workerPool.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateWorkerPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateWorkerPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateWorkerPool without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() - ); - request.workerPool = {}; - // path template: projects/*/locations/{location=*}/** - request.workerPool.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateWorkerPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateWorkerPool( - 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.updateWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateWorkerPool with call error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() - ); - request.workerPool = {}; - // path template: projects/*/locations/{location=*}/** - request.workerPool.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateWorkerPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateWorkerPool(request), expectedError); - const actualRequest = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateWorkerPool with LRO error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.UpdateWorkerPoolRequest() - ); - request.workerPool = {}; - // path template: projects/*/locations/{location=*}/** - request.workerPool.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.updateWorkerPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateWorkerPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateWorkerPoolProgress without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateWorkerPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateWorkerPoolProgress with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateWorkerPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteWorkerPool', () => { - it('invokes deleteWorkerPool without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteWorkerPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteWorkerPool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteWorkerPool without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteWorkerPool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteWorkerPool( - 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.deleteWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteWorkerPool with call error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkerPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteWorkerPool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteWorkerPool with LRO error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.DeleteWorkerPoolRequest() - ); - // path template: projects/*/locations/{location=*}/** - request.name = 'projects/value/locations/value/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkerPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteWorkerPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteWorkerPoolProgress without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteWorkerPoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteWorkerPoolProgress with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteWorkerPoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listWorkerPools', () => { - it('invokes listWorkerPools without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - ]; - client.innerApiCalls.listWorkerPools = stubSimpleCall(expectedResponse); - const [response] = await client.listWorkerPools(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listWorkerPools without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value';const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - ]; - client.innerApiCalls.listWorkerPools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listWorkerPools( - request, - (err?: Error|null, result?: protos.google.cloud.run.v2.IWorkerPool[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listWorkerPools with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.listWorkerPools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listWorkerPools(request), expectedError); - const actualRequest = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listWorkerPoolsStream without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - ]; - client.descriptors.page.listWorkerPools.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listWorkerPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.WorkerPool[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.WorkerPool) => { - 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.listWorkerPools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkerPools, request)); - assert( - (client.descriptors.page.listWorkerPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listWorkerPoolsStream with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkerPools.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listWorkerPoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.run.v2.WorkerPool[] = []; - stream.on('data', (response: protos.google.cloud.run.v2.WorkerPool) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listWorkerPools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkerPools, request)); - assert( - (client.descriptors.page.listWorkerPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listWorkerPools without error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - generateSampleMessage(new protos.google.cloud.run.v2.WorkerPool()), - ]; - client.descriptors.page.listWorkerPools.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.run.v2.IWorkerPool[] = []; - const iterable = client.listWorkerPoolsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listWorkerPools with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.run.v2.ListWorkerPoolsRequest() - ); - // path template: projects/*/locations/{location=*} - request.parent = 'projects/value/locations/value'; - const expectedHeaderRequestParams = 'location=value'; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkerPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listWorkerPoolsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.run.v2.IWorkerPool[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listWorkerPools.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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - 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 workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('execution', async () => { - const fakePath = "/rendered/path/execution"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.executionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.executionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('executionPath', () => { - const result = client.executionPath("projectValue", "locationValue", "jobValue", "executionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.executionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromExecutionName', () => { - const result = client.matchProjectFromExecutionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromExecutionName', () => { - const result = client.matchLocationFromExecutionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromExecutionName', () => { - const result = client.matchJobFromExecutionName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchExecutionFromExecutionName', () => { - const result = client.matchExecutionFromExecutionName(fakePath); - assert.strictEqual(result, "executionValue"); - assert((client.pathTemplates.executionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', async () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('job', async () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('revision', async () => { - const fakePath = "/rendered/path/revision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - revision: "revisionValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.revisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.revisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('revisionPath', () => { - const result = client.revisionPath("projectValue", "locationValue", "serviceValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.revisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRevisionName', () => { - const result = client.matchProjectFromRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRevisionName', () => { - const result = client.matchLocationFromRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromRevisionName', () => { - const result = client.matchServiceFromRevisionName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromRevisionName', () => { - const result = client.matchRevisionFromRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.revisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('service', async () => { - const fakePath = "/rendered/path/service"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - service: "serviceValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.servicePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.servicePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('servicePath', () => { - const result = client.servicePath("projectValue", "locationValue", "serviceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.servicePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromServiceName', () => { - const result = client.matchProjectFromServiceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromServiceName', () => { - const result = client.matchLocationFromServiceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchServiceFromServiceName', () => { - const result = client.matchServiceFromServiceName(fakePath); - assert.strictEqual(result, "serviceValue"); - assert((client.pathTemplates.servicePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', async () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - execution: "executionValue", - task: "taskValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await 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", "executionValue", "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('matchExecutionFromTaskName', () => { - const result = client.matchExecutionFromTaskName(fakePath); - assert.strictEqual(result, "executionValue"); - 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('workerPool', async () => { - const fakePath = "/rendered/path/workerPool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - worker_pool: "workerPoolValue", - }; - const client = new workerpoolsModule.v2.WorkerPoolsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.workerPoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workerPoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workerPoolPath', () => { - const result = client.workerPoolPath("projectValue", "locationValue", "workerPoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workerPoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkerPoolName', () => { - const result = client.matchProjectFromWorkerPoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkerPoolName', () => { - const result = client.matchLocationFromWorkerPoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkerPoolFromWorkerPoolName', () => { - const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); - assert.strictEqual(result, "workerPoolValue"); - assert((client.pathTemplates.workerPoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-run/tsconfig.json b/owl-bot-staging/google-cloud-run/tsconfig.json deleted file mode 100644 index ca73e7bfc82..00000000000 --- a/owl-bot-staging/google-cloud-run/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2023", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts", - "src/**/*.json", - "samples/**/*.json", - "protos/protos.json" - ] -} diff --git a/owl-bot-staging/google-cloud-run/webpack.config.js b/owl-bot-staging/google-cloud-run/webpack.config.js deleted file mode 100644 index 20bb2f2a589..00000000000 --- a/owl-bot-staging/google-cloud-run/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: 'Builds', - filename: './builds.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-run/README.md b/packages/google-cloud-run/README.md index 384f8db772e..5e764dd1d71 100644 --- a/packages/google-cloud-run/README.md +++ b/packages/google-cloud-run/README.md @@ -63,6 +63,12 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | delete execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js) | | get execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js) | | list executions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js) | +| create instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.create_instance.js) | +| delete instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.delete_instance.js) | +| get instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.get_instance.js) | +| list instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.list_instances.js) | +| start instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.start_instance.js) | +| stop instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/instances.stop_instance.js) | | create job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.create_job.js) | | delete job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.delete_job.js) | | get iam policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/jobs.get_iam_policy.js) | diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/container_status.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/container_status.proto similarity index 100% rename from owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/container_status.proto rename to packages/google-cloud-run/protos/google/cloud/run/v2/container_status.proto diff --git a/owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/instance.proto similarity index 100% rename from owl-bot-staging/google-cloud-run/protos/google/cloud/run/v2/instance.proto rename to packages/google-cloud-run/protos/google/cloud/run/v2/instance.proto diff --git a/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto b/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto index 83b9af76787..0fe03f27aac 100644 --- a/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto +++ b/packages/google-cloud-run/protos/google/cloud/run/v2/k8s.min.proto @@ -97,6 +97,9 @@ message Container { // fails. Probe startup_probe = 11; + // Readiness probe to be used for health checks. + Probe readiness_probe = 14; + // Names of the containers that must start before this container. repeated string depends_on = 12; diff --git a/packages/google-cloud-run/protos/protos.d.ts b/packages/google-cloud-run/protos/protos.d.ts index 3689d39331d..0f969068560 100644 --- a/packages/google-cloud-run/protos/protos.d.ts +++ b/packages/google-cloud-run/protos/protos.d.ts @@ -889,6 +889,109 @@ export namespace google { } } + /** Properties of a ContainerStatus. */ + interface IContainerStatus { + + /** ContainerStatus name */ + name?: (string|null); + + /** ContainerStatus imageDigest */ + imageDigest?: (string|null); + } + + /** Represents a ContainerStatus. */ + class ContainerStatus implements IContainerStatus { + + /** + * Constructs a new ContainerStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IContainerStatus); + + /** ContainerStatus name. */ + public name: string; + + /** ContainerStatus imageDigest. */ + public imageDigest: string; + + /** + * Creates a new ContainerStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ContainerStatus instance + */ + public static create(properties?: google.cloud.run.v2.IContainerStatus): google.cloud.run.v2.ContainerStatus; + + /** + * Encodes the specified ContainerStatus message. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @param message ContainerStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IContainerStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContainerStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @param message ContainerStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IContainerStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ContainerStatus; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ContainerStatus; + + /** + * Verifies a ContainerStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContainerStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContainerStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ContainerStatus; + + /** + * Creates a plain object from a ContainerStatus message. Also converts values to other types if specified. + * @param message ContainerStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ContainerStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContainerStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContainerStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents an Executions */ class Executions extends $protobuf.rpc.Service { @@ -1982,6 +2085,9 @@ export namespace google { /** Container startupProbe */ startupProbe?: (google.cloud.run.v2.IProbe|null); + /** Container readinessProbe */ + readinessProbe?: (google.cloud.run.v2.IProbe|null); + /** Container dependsOn */ dependsOn?: (string[]|null); @@ -2037,6 +2143,9 @@ export namespace google { /** Container startupProbe. */ public startupProbe?: (google.cloud.run.v2.IProbe|null); + /** Container readinessProbe. */ + public readinessProbe?: (google.cloud.run.v2.IProbe|null); + /** Container dependsOn. */ public dependsOn: string[]; @@ -5543,6 +5652,1226 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Represents an Instances */ + class Instances extends $protobuf.rpc.Service { + + /** + * Constructs a new Instances 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 Instances 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): Instances; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.run.v2.ICreateInstanceRequest, callback: google.cloud.run.v2.Instances.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.run.v2.ICreateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.run.v2.IDeleteInstanceRequest, callback: google.cloud.run.v2.Instances.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.run.v2.IDeleteInstanceRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.run.v2.IGetInstanceRequest, callback: google.cloud.run.v2.Instances.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.run.v2.IGetInstanceRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.run.v2.IListInstancesRequest, callback: google.cloud.run.v2.Instances.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.run.v2.IListInstancesRequest): Promise; + + /** + * Calls StopInstance. + * @param request StopInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public stopInstance(request: google.cloud.run.v2.IStopInstanceRequest, callback: google.cloud.run.v2.Instances.StopInstanceCallback): void; + + /** + * Calls StopInstance. + * @param request StopInstanceRequest message or plain object + * @returns Promise + */ + public stopInstance(request: google.cloud.run.v2.IStopInstanceRequest): Promise; + + /** + * Calls StartInstance. + * @param request StartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startInstance(request: google.cloud.run.v2.IStartInstanceRequest, callback: google.cloud.run.v2.Instances.StartInstanceCallback): void; + + /** + * Calls StartInstance. + * @param request StartInstanceRequest message or plain object + * @returns Promise + */ + public startInstance(request: google.cloud.run.v2.IStartInstanceRequest): Promise; + } + + namespace Instances { + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.run.v2.Instance) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.run.v2.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|stopInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type StopInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|startInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type StartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.run.v2.IInstance|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.run.v2.IInstance|null); + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.ICreateInstanceRequest): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IGetInstanceRequest): google.cloud.run.v2.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + + /** DeleteInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteInstanceRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** DeleteInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteInstanceRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IDeleteInstanceRequest): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest showDeleted */ + showDeleted?: (boolean|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest showDeleted. */ + public showDeleted: boolean; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.run.v2.IListInstancesRequest): google.cloud.run.v2.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.run.v2.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.run.v2.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.run.v2.IListInstancesResponse): google.cloud.run.v2.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopInstanceRequest. */ + interface IStopInstanceRequest { + + /** StopInstanceRequest name */ + name?: (string|null); + + /** StopInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** StopInstanceRequest etag */ + etag?: (string|null); + } + + /** Represents a StopInstanceRequest. */ + class StopInstanceRequest implements IStopInstanceRequest { + + /** + * Constructs a new StopInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IStopInstanceRequest); + + /** StopInstanceRequest name. */ + public name: string; + + /** StopInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** StopInstanceRequest etag. */ + public etag: string; + + /** + * Creates a new StopInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IStopInstanceRequest): google.cloud.run.v2.StopInstanceRequest; + + /** + * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @param message StopInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @param message StopInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StopInstanceRequest; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StopInstanceRequest; + + /** + * Verifies a StopInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StopInstanceRequest; + + /** + * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. + * @param message StopInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.StopInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartInstanceRequest. */ + interface IStartInstanceRequest { + + /** StartInstanceRequest name */ + name?: (string|null); + + /** StartInstanceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** StartInstanceRequest etag */ + etag?: (string|null); + } + + /** Represents a StartInstanceRequest. */ + class StartInstanceRequest implements IStartInstanceRequest { + + /** + * Constructs a new StartInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IStartInstanceRequest); + + /** StartInstanceRequest name. */ + public name: string; + + /** StartInstanceRequest validateOnly. */ + public validateOnly: boolean; + + /** StartInstanceRequest etag. */ + public etag: string; + + /** + * Creates a new StartInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartInstanceRequest instance + */ + public static create(properties?: google.cloud.run.v2.IStartInstanceRequest): google.cloud.run.v2.StartInstanceRequest; + + /** + * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @param message StartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @param message StartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.StartInstanceRequest; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.StartInstanceRequest; + + /** + * Verifies a StartInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.StartInstanceRequest; + + /** + * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. + * @param message StartInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.StartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance description */ + description?: (string|null); + + /** Instance uid */ + uid?: (string|null); + + /** Instance generation */ + generation?: (number|Long|string|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Instance creator */ + creator?: (string|null); + + /** Instance lastModifier */ + lastModifier?: (string|null); + + /** Instance client */ + client?: (string|null); + + /** Instance clientVersion */ + clientVersion?: (string|null); + + /** Instance launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** Instance binaryAuthorization */ + binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** Instance vpcAccess */ + vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** Instance serviceAccount */ + serviceAccount?: (string|null); + + /** Instance containers */ + containers?: (google.cloud.run.v2.IContainer[]|null); + + /** Instance volumes */ + volumes?: (google.cloud.run.v2.IVolume[]|null); + + /** Instance encryptionKey */ + encryptionKey?: (string|null); + + /** Instance encryptionKeyRevocationAction */ + encryptionKeyRevocationAction?: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction|null); + + /** Instance encryptionKeyShutdownDuration */ + encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** Instance nodeSelector */ + nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** Instance gpuZonalRedundancyDisabled */ + gpuZonalRedundancyDisabled?: (boolean|null); + + /** Instance ingress */ + ingress?: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic|null); + + /** Instance invokerIamDisabled */ + invokerIamDisabled?: (boolean|null); + + /** Instance iapEnabled */ + iapEnabled?: (boolean|null); + + /** Instance observedGeneration */ + observedGeneration?: (number|Long|string|null); + + /** Instance logUri */ + logUri?: (string|null); + + /** Instance terminalCondition */ + terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** Instance conditions */ + conditions?: (google.cloud.run.v2.ICondition[]|null); + + /** Instance containerStatuses */ + containerStatuses?: (google.cloud.run.v2.IContainerStatus[]|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Instance urls */ + urls?: (string[]|null); + + /** Instance reconciling */ + reconciling?: (boolean|null); + + /** Instance etag */ + etag?: (string|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.run.v2.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance description. */ + public description: string; + + /** Instance uid. */ + public uid: string; + + /** Instance generation. */ + public generation: (number|Long|string); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance annotations. */ + public annotations: { [k: string]: string }; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Instance expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Instance creator. */ + public creator: string; + + /** Instance lastModifier. */ + public lastModifier: string; + + /** Instance client. */ + public client: string; + + /** Instance clientVersion. */ + public clientVersion: string; + + /** Instance launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** Instance binaryAuthorization. */ + public binaryAuthorization?: (google.cloud.run.v2.IBinaryAuthorization|null); + + /** Instance vpcAccess. */ + public vpcAccess?: (google.cloud.run.v2.IVpcAccess|null); + + /** Instance serviceAccount. */ + public serviceAccount: string; + + /** Instance containers. */ + public containers: google.cloud.run.v2.IContainer[]; + + /** Instance volumes. */ + public volumes: google.cloud.run.v2.IVolume[]; + + /** Instance encryptionKey. */ + public encryptionKey: string; + + /** Instance encryptionKeyRevocationAction. */ + public encryptionKeyRevocationAction: (google.cloud.run.v2.EncryptionKeyRevocationAction|keyof typeof google.cloud.run.v2.EncryptionKeyRevocationAction); + + /** Instance encryptionKeyShutdownDuration. */ + public encryptionKeyShutdownDuration?: (google.protobuf.IDuration|null); + + /** Instance nodeSelector. */ + public nodeSelector?: (google.cloud.run.v2.INodeSelector|null); + + /** Instance gpuZonalRedundancyDisabled. */ + public gpuZonalRedundancyDisabled?: (boolean|null); + + /** Instance ingress. */ + public ingress: (google.cloud.run.v2.IngressTraffic|keyof typeof google.cloud.run.v2.IngressTraffic); + + /** Instance invokerIamDisabled. */ + public invokerIamDisabled: boolean; + + /** Instance iapEnabled. */ + public iapEnabled: boolean; + + /** Instance observedGeneration. */ + public observedGeneration: (number|Long|string); + + /** Instance logUri. */ + public logUri: string; + + /** Instance terminalCondition. */ + public terminalCondition?: (google.cloud.run.v2.ICondition|null); + + /** Instance conditions. */ + public conditions: google.cloud.run.v2.ICondition[]; + + /** Instance containerStatuses. */ + public containerStatuses: google.cloud.run.v2.IContainerStatus[]; + + /** Instance satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Instance urls. */ + public urls: string[]; + + /** Instance reconciling. */ + public reconciling: boolean; + + /** Instance etag. */ + public etag: string; + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.run.v2.IInstance): google.cloud.run.v2.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.run.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.run.v2.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.run.v2.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.run.v2.Instance; + + /** + * Verifies an Instance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.run.v2.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.run.v2.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an InstanceSplit. */ interface IInstanceSplit { diff --git a/packages/google-cloud-run/protos/protos.js b/packages/google-cloud-run/protos/protos.js index b48c78d75de..c7edd21ba6b 100644 --- a/packages/google-cloud-run/protos/protos.js +++ b/packages/google-cloud-run/protos/protos.js @@ -2587,6 +2587,235 @@ return Condition; })(); + v2.ContainerStatus = (function() { + + /** + * Properties of a ContainerStatus. + * @memberof google.cloud.run.v2 + * @interface IContainerStatus + * @property {string|null} [name] ContainerStatus name + * @property {string|null} [imageDigest] ContainerStatus imageDigest + */ + + /** + * Constructs a new ContainerStatus. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ContainerStatus. + * @implements IContainerStatus + * @constructor + * @param {google.cloud.run.v2.IContainerStatus=} [properties] Properties to set + */ + function ContainerStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContainerStatus name. + * @member {string} name + * @memberof google.cloud.run.v2.ContainerStatus + * @instance + */ + ContainerStatus.prototype.name = ""; + + /** + * ContainerStatus imageDigest. + * @member {string} imageDigest + * @memberof google.cloud.run.v2.ContainerStatus + * @instance + */ + ContainerStatus.prototype.imageDigest = ""; + + /** + * Creates a new ContainerStatus instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.IContainerStatus=} [properties] Properties to set + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus instance + */ + ContainerStatus.create = function create(properties) { + return new ContainerStatus(properties); + }; + + /** + * Encodes the specified ContainerStatus message. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.IContainerStatus} message ContainerStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.imageDigest != null && Object.hasOwnProperty.call(message, "imageDigest")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageDigest); + return writer; + }; + + /** + * Encodes the specified ContainerStatus message, length delimited. Does not implicitly {@link google.cloud.run.v2.ContainerStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.IContainerStatus} message ContainerStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ContainerStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.imageDigest = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContainerStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContainerStatus message. + * @function verify + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContainerStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.imageDigest != null && message.hasOwnProperty("imageDigest")) + if (!$util.isString(message.imageDigest)) + return "imageDigest: string expected"; + return null; + }; + + /** + * Creates a ContainerStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ContainerStatus} ContainerStatus + */ + ContainerStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ContainerStatus) + return object; + var message = new $root.google.cloud.run.v2.ContainerStatus(); + if (object.name != null) + message.name = String(object.name); + if (object.imageDigest != null) + message.imageDigest = String(object.imageDigest); + return message; + }; + + /** + * Creates a plain object from a ContainerStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {google.cloud.run.v2.ContainerStatus} message ContainerStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContainerStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.imageDigest = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.imageDigest != null && message.hasOwnProperty("imageDigest")) + object.imageDigest = message.imageDigest; + return object; + }; + + /** + * Converts this ContainerStatus to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ContainerStatus + * @instance + * @returns {Object.} JSON object + */ + ContainerStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContainerStatus + * @function getTypeUrl + * @memberof google.cloud.run.v2.ContainerStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContainerStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ContainerStatus"; + }; + + return ContainerStatus; + })(); + v2.Executions = (function() { /** @@ -5563,6 +5792,7 @@ * @property {string|null} [workingDir] Container workingDir * @property {google.cloud.run.v2.IProbe|null} [livenessProbe] Container livenessProbe * @property {google.cloud.run.v2.IProbe|null} [startupProbe] Container startupProbe + * @property {google.cloud.run.v2.IProbe|null} [readinessProbe] Container readinessProbe * @property {Array.|null} [dependsOn] Container dependsOn * @property {string|null} [baseImageUri] Container baseImageUri * @property {google.cloud.run.v2.IBuildInfo|null} [buildInfo] Container buildInfo @@ -5685,6 +5915,14 @@ */ Container.prototype.startupProbe = null; + /** + * Container readinessProbe. + * @member {google.cloud.run.v2.IProbe|null|undefined} readinessProbe + * @memberof google.cloud.run.v2.Container + * @instance + */ + Container.prototype.readinessProbe = null; + /** * Container dependsOn. * @member {Array.} dependsOn @@ -5765,6 +6003,8 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.dependsOn[i]); if (message.baseImageUri != null && Object.hasOwnProperty.call(message, "baseImageUri")) writer.uint32(/* id 13, wireType 2 =*/106).string(message.baseImageUri); + if (message.readinessProbe != null && Object.hasOwnProperty.call(message, "readinessProbe")) + $root.google.cloud.run.v2.Probe.encode(message.readinessProbe, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.buildInfo != null && Object.hasOwnProperty.call(message, "buildInfo")) $root.google.cloud.run.v2.BuildInfo.encode(message.buildInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); if (message.sourceCode != null && Object.hasOwnProperty.call(message, "sourceCode")) @@ -5863,6 +6103,10 @@ message.startupProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); break; } + case 14: { + message.readinessProbe = $root.google.cloud.run.v2.Probe.decode(reader, reader.uint32()); + break; + } case 12: { if (!(message.dependsOn && message.dependsOn.length)) message.dependsOn = []; @@ -5982,6 +6226,11 @@ if (error) return "startupProbe." + error; } + if (message.readinessProbe != null && message.hasOwnProperty("readinessProbe")) { + var error = $root.google.cloud.run.v2.Probe.verify(message.readinessProbe); + if (error) + return "readinessProbe." + error; + } if (message.dependsOn != null && message.hasOwnProperty("dependsOn")) { if (!Array.isArray(message.dependsOn)) return "dependsOn: array expected"; @@ -6082,6 +6331,11 @@ throw TypeError(".google.cloud.run.v2.Container.startupProbe: object expected"); message.startupProbe = $root.google.cloud.run.v2.Probe.fromObject(object.startupProbe); } + if (object.readinessProbe != null) { + if (typeof object.readinessProbe !== "object") + throw TypeError(".google.cloud.run.v2.Container.readinessProbe: object expected"); + message.readinessProbe = $root.google.cloud.run.v2.Probe.fromObject(object.readinessProbe); + } if (object.dependsOn) { if (!Array.isArray(object.dependsOn)) throw TypeError(".google.cloud.run.v2.Container.dependsOn: array expected"); @@ -6128,6 +6382,7 @@ object.livenessProbe = null; object.startupProbe = null; object.baseImageUri = ""; + object.readinessProbe = null; object.buildInfo = null; object.sourceCode = null; } @@ -6175,6 +6430,8 @@ } if (message.baseImageUri != null && message.hasOwnProperty("baseImageUri")) object.baseImageUri = message.baseImageUri; + if (message.readinessProbe != null && message.hasOwnProperty("readinessProbe")) + object.readinessProbe = $root.google.cloud.run.v2.Probe.toObject(message.readinessProbe, options); if (message.buildInfo != null && message.hasOwnProperty("buildInfo")) object.buildInfo = $root.google.cloud.run.v2.BuildInfo.toObject(message.buildInfo, options); if (message.sourceCode != null && message.hasOwnProperty("sourceCode")) @@ -14575,6 +14832,3406 @@ return ExecutionTemplate; })(); + v2.Instances = (function() { + + /** + * Constructs a new Instances service. + * @memberof google.cloud.run.v2 + * @classdesc Represents an Instances + * @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 Instances(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Instances.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Instances; + + /** + * Creates new Instances service using the specified rpc implementation. + * @function create + * @memberof google.cloud.run.v2.Instances + * @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 {Instances} RPC service. Useful where requests and/or responses are streamed. + */ + Instances.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|createInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.run.v2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|deleteInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.run.v2.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|getInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.run.v2.GetInstanceRequest, $root.google.cloud.run.v2.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|listInstances}. + * @memberof google.cloud.run.v2.Instances + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.run.v2.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.run.v2.Instances.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.run.v2.ListInstancesRequest, $root.google.cloud.run.v2.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|stopInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef StopInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StopInstance. + * @function stopInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStopInstanceRequest} request StopInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.StopInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.stopInstance = function stopInstance(request, callback) { + return this.rpcCall(stopInstance, $root.google.cloud.run.v2.StopInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StopInstance" }); + + /** + * Calls StopInstance. + * @function stopInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStopInstanceRequest} request StopInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.run.v2.Instances|startInstance}. + * @memberof google.cloud.run.v2.Instances + * @typedef StartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StartInstance. + * @function startInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStartInstanceRequest} request StartInstanceRequest message or plain object + * @param {google.cloud.run.v2.Instances.StartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.startInstance = function startInstance(request, callback) { + return this.rpcCall(startInstance, $root.google.cloud.run.v2.StartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartInstance" }); + + /** + * Calls StartInstance. + * @function startInstance + * @memberof google.cloud.run.v2.Instances + * @instance + * @param {google.cloud.run.v2.IStartInstanceRequest} request StartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Instances; + })(); + + v2.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {google.cloud.run.v2.IInstance|null} [instance] CreateInstanceRequest instance + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {boolean|null} [validateOnly] CreateInstanceRequest validateOnly + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.run.v2.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.run.v2.IInstance|null|undefined} instance + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.run.v2.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instance = $root.google.cloud.run.v2.Instance.decode(reader, reader.uint32()); + break; + } + case 3: { + message.instanceId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.run.v2.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.run.v2.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.run.v2.Instance.fromObject(object.instance); + } + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {google.cloud.run.v2.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instance = null; + object.instanceId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.run.v2.Instance.toObject(message.instance, options); + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v2.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.GetInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {google.cloud.run.v2.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v2.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {boolean|null} [validateOnly] DeleteInstanceRequest validateOnly + * @property {string|null} [etag] DeleteInstanceRequest etag + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * DeleteInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.validateOnly = false; + + /** + * DeleteInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.etag = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {google.cloud.run.v2.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v2.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.run.v2 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {boolean|null} [showDeleted] ListInstancesRequest showDeleted + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.run.v2.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.showDeleted = false; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.showDeleted); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListInstancesRequest) + return object; + var message = new $root.google.cloud.run.v2.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {google.cloud.run.v2.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.showDeleted = false; + } + 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.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v2.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.run.v2 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.run.v2 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.run.v2.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + 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]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.run.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.run.v2.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.run.v2.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.run.v2.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.run.v2.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.run.v2.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.ListInstancesResponse) + return object; + var message = new $root.google.cloud.run.v2.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.run.v2.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.run.v2.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.run.v2.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {google.cloud.run.v2.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.run.v2.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.run.v2.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v2.StopInstanceRequest = (function() { + + /** + * Properties of a StopInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IStopInstanceRequest + * @property {string|null} [name] StopInstanceRequest name + * @property {boolean|null} [validateOnly] StopInstanceRequest validateOnly + * @property {string|null} [etag] StopInstanceRequest etag + */ + + /** + * Constructs a new StopInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a StopInstanceRequest. + * @implements IStopInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IStopInstanceRequest=} [properties] Properties to set + */ + function StopInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.name = ""; + + /** + * StopInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.validateOnly = false; + + /** + * StopInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.etag = ""; + + /** + * Creates a new StopInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.IStopInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest instance + */ + StopInstanceRequest.create = function create(properties) { + return new StopInstanceRequest(properties); + }; + + /** + * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StopInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StopInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.StopInstanceRequest} StopInstanceRequest + */ + StopInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.StopInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.StopInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {google.cloud.run.v2.StopInstanceRequest} message StopInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this StopInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.StopInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + StopInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.StopInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.StopInstanceRequest"; + }; + + return StopInstanceRequest; + })(); + + v2.StartInstanceRequest = (function() { + + /** + * Properties of a StartInstanceRequest. + * @memberof google.cloud.run.v2 + * @interface IStartInstanceRequest + * @property {string|null} [name] StartInstanceRequest name + * @property {boolean|null} [validateOnly] StartInstanceRequest validateOnly + * @property {string|null} [etag] StartInstanceRequest etag + */ + + /** + * Constructs a new StartInstanceRequest. + * @memberof google.cloud.run.v2 + * @classdesc Represents a StartInstanceRequest. + * @implements IStartInstanceRequest + * @constructor + * @param {google.cloud.run.v2.IStartInstanceRequest=} [properties] Properties to set + */ + function StartInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.name = ""; + + /** + * StartInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.validateOnly = false; + + /** + * StartInstanceRequest etag. + * @member {string} etag + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.etag = ""; + + /** + * Creates a new StartInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.IStartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest instance + */ + StartInstanceRequest.create = function create(properties) { + return new StartInstanceRequest(properties); + }; + + /** + * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.run.v2.StartInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartInstanceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.StartInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartInstanceRequest message. + * @function verify + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.StartInstanceRequest} StartInstanceRequest + */ + StartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.StartInstanceRequest) + return object; + var message = new $root.google.cloud.run.v2.StartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {google.cloud.run.v2.StartInstanceRequest} message StartInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this StartInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.StartInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + StartInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.run.v2.StartInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.StartInstanceRequest"; + }; + + return StartInstanceRequest; + })(); + + v2.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.run.v2 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [description] Instance description + * @property {string|null} [uid] Instance uid + * @property {number|Long|null} [generation] Instance generation + * @property {Object.|null} [labels] Instance labels + * @property {Object.|null} [annotations] Instance annotations + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Instance deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Instance expireTime + * @property {string|null} [creator] Instance creator + * @property {string|null} [lastModifier] Instance lastModifier + * @property {string|null} [client] Instance client + * @property {string|null} [clientVersion] Instance clientVersion + * @property {google.api.LaunchStage|null} [launchStage] Instance launchStage + * @property {google.cloud.run.v2.IBinaryAuthorization|null} [binaryAuthorization] Instance binaryAuthorization + * @property {google.cloud.run.v2.IVpcAccess|null} [vpcAccess] Instance vpcAccess + * @property {string|null} [serviceAccount] Instance serviceAccount + * @property {Array.|null} [containers] Instance containers + * @property {Array.|null} [volumes] Instance volumes + * @property {string|null} [encryptionKey] Instance encryptionKey + * @property {google.cloud.run.v2.EncryptionKeyRevocationAction|null} [encryptionKeyRevocationAction] Instance encryptionKeyRevocationAction + * @property {google.protobuf.IDuration|null} [encryptionKeyShutdownDuration] Instance encryptionKeyShutdownDuration + * @property {google.cloud.run.v2.INodeSelector|null} [nodeSelector] Instance nodeSelector + * @property {boolean|null} [gpuZonalRedundancyDisabled] Instance gpuZonalRedundancyDisabled + * @property {google.cloud.run.v2.IngressTraffic|null} [ingress] Instance ingress + * @property {boolean|null} [invokerIamDisabled] Instance invokerIamDisabled + * @property {boolean|null} [iapEnabled] Instance iapEnabled + * @property {number|Long|null} [observedGeneration] Instance observedGeneration + * @property {string|null} [logUri] Instance logUri + * @property {google.cloud.run.v2.ICondition|null} [terminalCondition] Instance terminalCondition + * @property {Array.|null} [conditions] Instance conditions + * @property {Array.|null} [containerStatuses] Instance containerStatuses + * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs + * @property {Array.|null} [urls] Instance urls + * @property {boolean|null} [reconciling] Instance reconciling + * @property {string|null} [etag] Instance etag + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.run.v2 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.run.v2.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.annotations = {}; + this.containers = []; + this.volumes = []; + this.conditions = []; + this.containerStatuses = []; + this.urls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance description. + * @member {string} description + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.description = ""; + + /** + * Instance uid. + * @member {string} uid + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.uid = ""; + + /** + * Instance generation. + * @member {number|Long} generation + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance annotations. + * @member {Object.} annotations + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.annotations = $util.emptyObject; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.deleteTime = null; + + /** + * Instance expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.expireTime = null; + + /** + * Instance creator. + * @member {string} creator + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.creator = ""; + + /** + * Instance lastModifier. + * @member {string} lastModifier + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.lastModifier = ""; + + /** + * Instance client. + * @member {string} client + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.client = ""; + + /** + * Instance clientVersion. + * @member {string} clientVersion + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.clientVersion = ""; + + /** + * Instance launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.launchStage = 0; + + /** + * Instance binaryAuthorization. + * @member {google.cloud.run.v2.IBinaryAuthorization|null|undefined} binaryAuthorization + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.binaryAuthorization = null; + + /** + * Instance vpcAccess. + * @member {google.cloud.run.v2.IVpcAccess|null|undefined} vpcAccess + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.vpcAccess = null; + + /** + * Instance serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.serviceAccount = ""; + + /** + * Instance containers. + * @member {Array.} containers + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.containers = $util.emptyArray; + + /** + * Instance volumes. + * @member {Array.} volumes + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.volumes = $util.emptyArray; + + /** + * Instance encryptionKey. + * @member {string} encryptionKey + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.encryptionKey = ""; + + /** + * Instance encryptionKeyRevocationAction. + * @member {google.cloud.run.v2.EncryptionKeyRevocationAction} encryptionKeyRevocationAction + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.encryptionKeyRevocationAction = 0; + + /** + * Instance encryptionKeyShutdownDuration. + * @member {google.protobuf.IDuration|null|undefined} encryptionKeyShutdownDuration + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.encryptionKeyShutdownDuration = null; + + /** + * Instance nodeSelector. + * @member {google.cloud.run.v2.INodeSelector|null|undefined} nodeSelector + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.nodeSelector = null; + + /** + * Instance gpuZonalRedundancyDisabled. + * @member {boolean|null|undefined} gpuZonalRedundancyDisabled + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.gpuZonalRedundancyDisabled = null; + + /** + * Instance ingress. + * @member {google.cloud.run.v2.IngressTraffic} ingress + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.ingress = 0; + + /** + * Instance invokerIamDisabled. + * @member {boolean} invokerIamDisabled + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.invokerIamDisabled = false; + + /** + * Instance iapEnabled. + * @member {boolean} iapEnabled + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.iapEnabled = false; + + /** + * Instance observedGeneration. + * @member {number|Long} observedGeneration + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.observedGeneration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance logUri. + * @member {string} logUri + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.logUri = ""; + + /** + * Instance terminalCondition. + * @member {google.cloud.run.v2.ICondition|null|undefined} terminalCondition + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.terminalCondition = null; + + /** + * Instance conditions. + * @member {Array.} conditions + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.conditions = $util.emptyArray; + + /** + * Instance containerStatuses. + * @member {Array.} containerStatuses + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.containerStatuses = $util.emptyArray; + + /** + * Instance satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = false; + + /** + * Instance urls. + * @member {Array.} urls + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.urls = $util.emptyArray; + + /** + * Instance reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.reconciling = false; + + /** + * Instance etag. + * @member {string} etag + * @memberof google.cloud.run.v2.Instance + * @instance + */ + Instance.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Instance.prototype, "_gpuZonalRedundancyDisabled", { + get: $util.oneOfGetter($oneOfFields = ["gpuZonalRedundancyDisabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.IInstance=} [properties] Properties to set + * @returns {google.cloud.run.v2.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uid); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.generation); + 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.creator); + if (message.lastModifier != null && Object.hasOwnProperty.call(message, "lastModifier")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.lastModifier); + if (message.client != null && Object.hasOwnProperty.call(message, "client")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.client); + if (message.clientVersion != null && Object.hasOwnProperty.call(message, "clientVersion")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.clientVersion); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.launchStage); + if (message.binaryAuthorization != null && Object.hasOwnProperty.call(message, "binaryAuthorization")) + $root.google.cloud.run.v2.BinaryAuthorization.encode(message.binaryAuthorization, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.vpcAccess != null && Object.hasOwnProperty.call(message, "vpcAccess")) + $root.google.cloud.run.v2.VpcAccess.encode(message.vpcAccess, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.serviceAccount); + if (message.containers != null && message.containers.length) + for (var i = 0; i < message.containers.length; ++i) + $root.google.cloud.run.v2.Container.encode(message.containers[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.run.v2.Volume.encode(message.volumes[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.encryptionKey); + if (message.encryptionKeyRevocationAction != null && Object.hasOwnProperty.call(message, "encryptionKeyRevocationAction")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.encryptionKeyRevocationAction); + if (message.encryptionKeyShutdownDuration != null && Object.hasOwnProperty.call(message, "encryptionKeyShutdownDuration")) + $root.google.protobuf.Duration.encode(message.encryptionKeyShutdownDuration, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.nodeSelector != null && Object.hasOwnProperty.call(message, "nodeSelector")) + $root.google.cloud.run.v2.NodeSelector.encode(message.nodeSelector, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.gpuZonalRedundancyDisabled != null && Object.hasOwnProperty.call(message, "gpuZonalRedundancyDisabled")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.gpuZonalRedundancyDisabled); + if (message.ingress != null && Object.hasOwnProperty.call(message, "ingress")) + writer.uint32(/* id 28, wireType 0 =*/224).int32(message.ingress); + if (message.invokerIamDisabled != null && Object.hasOwnProperty.call(message, "invokerIamDisabled")) + writer.uint32(/* id 29, wireType 0 =*/232).bool(message.invokerIamDisabled); + if (message.iapEnabled != null && Object.hasOwnProperty.call(message, "iapEnabled")) + writer.uint32(/* id 30, wireType 0 =*/240).bool(message.iapEnabled); + if (message.observedGeneration != null && Object.hasOwnProperty.call(message, "observedGeneration")) + writer.uint32(/* id 40, wireType 0 =*/320).int64(message.observedGeneration); + if (message.logUri != null && Object.hasOwnProperty.call(message, "logUri")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.logUri); + if (message.terminalCondition != null && Object.hasOwnProperty.call(message, "terminalCondition")) + $root.google.cloud.run.v2.Condition.encode(message.terminalCondition, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.cloud.run.v2.Condition.encode(message.conditions[i], writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.containerStatuses != null && message.containerStatuses.length) + for (var i = 0; i < message.containerStatuses.length; ++i) + $root.google.cloud.run.v2.ContainerStatus.encode(message.containerStatuses[i], writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.urls != null && message.urls.length) + for (var i = 0; i < message.urls.length; ++i) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.urls[i]); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 46, wireType 0 =*/368).bool(message.satisfiesPzs); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 98, wireType 0 =*/784).bool(message.reconciling); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 99, wireType 2 =*/794).string(message.etag); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.run.v2.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.run.v2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.run.v2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.run.v2.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.uid = reader.string(); + break; + } + case 5: { + message.generation = reader.int64(); + 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: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.creator = reader.string(); + break; + } + case 13: { + message.lastModifier = reader.string(); + break; + } + case 14: { + message.client = reader.string(); + break; + } + case 15: { + message.clientVersion = reader.string(); + break; + } + case 16: { + message.launchStage = reader.int32(); + break; + } + case 17: { + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.decode(reader, reader.uint32()); + break; + } + case 18: { + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.decode(reader, reader.uint32()); + break; + } + case 19: { + message.serviceAccount = reader.string(); + break; + } + case 20: { + if (!(message.containers && message.containers.length)) + message.containers = []; + message.containers.push($root.google.cloud.run.v2.Container.decode(reader, reader.uint32())); + break; + } + case 21: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.run.v2.Volume.decode(reader, reader.uint32())); + break; + } + case 22: { + message.encryptionKey = reader.string(); + break; + } + case 24: { + message.encryptionKeyRevocationAction = reader.int32(); + break; + } + case 25: { + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 26: { + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.decode(reader, reader.uint32()); + break; + } + case 27: { + message.gpuZonalRedundancyDisabled = reader.bool(); + break; + } + case 28: { + message.ingress = reader.int32(); + break; + } + case 29: { + message.invokerIamDisabled = reader.bool(); + break; + } + case 30: { + message.iapEnabled = reader.bool(); + break; + } + case 40: { + message.observedGeneration = reader.int64(); + break; + } + case 41: { + message.logUri = reader.string(); + break; + } + case 42: { + message.terminalCondition = $root.google.cloud.run.v2.Condition.decode(reader, reader.uint32()); + break; + } + case 43: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.cloud.run.v2.Condition.decode(reader, reader.uint32())); + break; + } + case 44: { + if (!(message.containerStatuses && message.containerStatuses.length)) + message.containerStatuses = []; + message.containerStatuses.push($root.google.cloud.run.v2.ContainerStatus.decode(reader, reader.uint32())); + break; + } + case 46: { + message.satisfiesPzs = reader.bool(); + break; + } + case 45: { + if (!(message.urls && message.urls.length)) + message.urls = []; + message.urls.push(reader.string()); + break; + } + case 98: { + message.reconciling = reader.bool(); + break; + } + case 99: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.run.v2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.run.v2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.run.v2.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + if (!$util.isString(message.lastModifier)) + return "lastModifier: string expected"; + if (message.client != null && message.hasOwnProperty("client")) + if (!$util.isString(message.client)) + return "client: string expected"; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + if (!$util.isString(message.clientVersion)) + return "clientVersion: 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) { + var error = $root.google.cloud.run.v2.BinaryAuthorization.verify(message.binaryAuthorization); + if (error) + return "binaryAuthorization." + error; + } + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) { + var error = $root.google.cloud.run.v2.VpcAccess.verify(message.vpcAccess); + if (error) + return "vpcAccess." + error; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.containers != null && message.hasOwnProperty("containers")) { + if (!Array.isArray(message.containers)) + return "containers: array expected"; + for (var i = 0; i < message.containers.length; ++i) { + var error = $root.google.cloud.run.v2.Container.verify(message.containers[i]); + if (error) + return "containers." + error; + } + } + 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.run.v2.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + if (!$util.isString(message.encryptionKey)) + return "encryptionKey: string expected"; + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + switch (message.encryptionKeyRevocationAction) { + default: + return "encryptionKeyRevocationAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) { + var error = $root.google.protobuf.Duration.verify(message.encryptionKeyShutdownDuration); + if (error) + return "encryptionKeyShutdownDuration." + error; + } + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) { + var error = $root.google.cloud.run.v2.NodeSelector.verify(message.nodeSelector); + if (error) + return "nodeSelector." + error; + } + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + properties._gpuZonalRedundancyDisabled = 1; + if (typeof message.gpuZonalRedundancyDisabled !== "boolean") + return "gpuZonalRedundancyDisabled: boolean expected"; + } + if (message.ingress != null && message.hasOwnProperty("ingress")) + switch (message.ingress) { + default: + return "ingress: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) + if (typeof message.invokerIamDisabled !== "boolean") + return "invokerIamDisabled: boolean expected"; + if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) + if (typeof message.iapEnabled !== "boolean") + return "iapEnabled: boolean expected"; + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (!$util.isInteger(message.observedGeneration) && !(message.observedGeneration && $util.isInteger(message.observedGeneration.low) && $util.isInteger(message.observedGeneration.high))) + return "observedGeneration: integer|Long expected"; + if (message.logUri != null && message.hasOwnProperty("logUri")) + if (!$util.isString(message.logUri)) + return "logUri: string expected"; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) { + var error = $root.google.cloud.run.v2.Condition.verify(message.terminalCondition); + if (error) + return "terminalCondition." + error; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.cloud.run.v2.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.containerStatuses != null && message.hasOwnProperty("containerStatuses")) { + if (!Array.isArray(message.containerStatuses)) + return "containerStatuses: array expected"; + for (var i = 0; i < message.containerStatuses.length; ++i) { + var error = $root.google.cloud.run.v2.ContainerStatus.verify(message.containerStatuses[i]); + if (error) + return "containerStatuses." + error; + } + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.urls != null && message.hasOwnProperty("urls")) { + if (!Array.isArray(message.urls)) + return "urls: array expected"; + for (var i = 0; i < message.urls.length; ++i) + if (!$util.isString(message.urls[i])) + return "urls: string[] expected"; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.run.v2.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.run.v2.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.run.v2.Instance) + return object; + var message = new $root.google.cloud.run.v2.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.uid != null) + message.uid = String(object.uid); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.run.v2.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.run.v2.Instance.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.run.v2.Instance.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.lastModifier != null) + message.lastModifier = String(object.lastModifier); + if (object.client != null) + message.client = String(object.client); + if (object.clientVersion != null) + message.clientVersion = String(object.clientVersion); + 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.binaryAuthorization != null) { + if (typeof object.binaryAuthorization !== "object") + throw TypeError(".google.cloud.run.v2.Instance.binaryAuthorization: object expected"); + message.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.fromObject(object.binaryAuthorization); + } + if (object.vpcAccess != null) { + if (typeof object.vpcAccess !== "object") + throw TypeError(".google.cloud.run.v2.Instance.vpcAccess: object expected"); + message.vpcAccess = $root.google.cloud.run.v2.VpcAccess.fromObject(object.vpcAccess); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.containers) { + if (!Array.isArray(object.containers)) + throw TypeError(".google.cloud.run.v2.Instance.containers: array expected"); + message.containers = []; + for (var i = 0; i < object.containers.length; ++i) { + if (typeof object.containers[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.containers: object expected"); + message.containers[i] = $root.google.cloud.run.v2.Container.fromObject(object.containers[i]); + } + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.run.v2.Instance.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.volumes: object expected"); + message.volumes[i] = $root.google.cloud.run.v2.Volume.fromObject(object.volumes[i]); + } + } + if (object.encryptionKey != null) + message.encryptionKey = String(object.encryptionKey); + switch (object.encryptionKeyRevocationAction) { + default: + if (typeof object.encryptionKeyRevocationAction === "number") { + message.encryptionKeyRevocationAction = object.encryptionKeyRevocationAction; + break; + } + break; + case "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED": + case 0: + message.encryptionKeyRevocationAction = 0; + break; + case "PREVENT_NEW": + case 1: + message.encryptionKeyRevocationAction = 1; + break; + case "SHUTDOWN": + case 2: + message.encryptionKeyRevocationAction = 2; + break; + } + if (object.encryptionKeyShutdownDuration != null) { + if (typeof object.encryptionKeyShutdownDuration !== "object") + throw TypeError(".google.cloud.run.v2.Instance.encryptionKeyShutdownDuration: object expected"); + message.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.fromObject(object.encryptionKeyShutdownDuration); + } + if (object.nodeSelector != null) { + if (typeof object.nodeSelector !== "object") + throw TypeError(".google.cloud.run.v2.Instance.nodeSelector: object expected"); + message.nodeSelector = $root.google.cloud.run.v2.NodeSelector.fromObject(object.nodeSelector); + } + if (object.gpuZonalRedundancyDisabled != null) + message.gpuZonalRedundancyDisabled = Boolean(object.gpuZonalRedundancyDisabled); + switch (object.ingress) { + default: + if (typeof object.ingress === "number") { + message.ingress = object.ingress; + break; + } + break; + case "INGRESS_TRAFFIC_UNSPECIFIED": + case 0: + message.ingress = 0; + break; + case "INGRESS_TRAFFIC_ALL": + case 1: + message.ingress = 1; + break; + case "INGRESS_TRAFFIC_INTERNAL_ONLY": + case 2: + message.ingress = 2; + break; + case "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER": + case 3: + message.ingress = 3; + break; + case "INGRESS_TRAFFIC_NONE": + case 4: + message.ingress = 4; + break; + } + if (object.invokerIamDisabled != null) + message.invokerIamDisabled = Boolean(object.invokerIamDisabled); + if (object.iapEnabled != null) + message.iapEnabled = Boolean(object.iapEnabled); + if (object.observedGeneration != null) + if ($util.Long) + (message.observedGeneration = $util.Long.fromValue(object.observedGeneration)).unsigned = false; + else if (typeof object.observedGeneration === "string") + message.observedGeneration = parseInt(object.observedGeneration, 10); + else if (typeof object.observedGeneration === "number") + message.observedGeneration = object.observedGeneration; + else if (typeof object.observedGeneration === "object") + message.observedGeneration = new $util.LongBits(object.observedGeneration.low >>> 0, object.observedGeneration.high >>> 0).toNumber(); + if (object.logUri != null) + message.logUri = String(object.logUri); + if (object.terminalCondition != null) { + if (typeof object.terminalCondition !== "object") + throw TypeError(".google.cloud.run.v2.Instance.terminalCondition: object expected"); + message.terminalCondition = $root.google.cloud.run.v2.Condition.fromObject(object.terminalCondition); + } + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.run.v2.Instance.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.conditions: object expected"); + message.conditions[i] = $root.google.cloud.run.v2.Condition.fromObject(object.conditions[i]); + } + } + if (object.containerStatuses) { + if (!Array.isArray(object.containerStatuses)) + throw TypeError(".google.cloud.run.v2.Instance.containerStatuses: array expected"); + message.containerStatuses = []; + for (var i = 0; i < object.containerStatuses.length; ++i) { + if (typeof object.containerStatuses[i] !== "object") + throw TypeError(".google.cloud.run.v2.Instance.containerStatuses: object expected"); + message.containerStatuses[i] = $root.google.cloud.run.v2.ContainerStatus.fromObject(object.containerStatuses[i]); + } + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.urls) { + if (!Array.isArray(object.urls)) + throw TypeError(".google.cloud.run.v2.Instance.urls: array expected"); + message.urls = []; + for (var i = 0; i < object.urls.length; ++i) + message.urls[i] = String(object.urls[i]); + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.run.v2.Instance + * @static + * @param {google.cloud.run.v2.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.containers = []; + object.volumes = []; + object.conditions = []; + object.containerStatuses = []; + object.urls = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.creator = ""; + object.lastModifier = ""; + object.client = ""; + object.clientVersion = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.binaryAuthorization = null; + object.vpcAccess = null; + object.serviceAccount = ""; + object.encryptionKey = ""; + object.encryptionKeyRevocationAction = options.enums === String ? "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" : 0; + object.encryptionKeyShutdownDuration = null; + object.nodeSelector = null; + object.ingress = options.enums === String ? "INGRESS_TRAFFIC_UNSPECIFIED" : 0; + object.invokerIamDisabled = false; + object.iapEnabled = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.observedGeneration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.observedGeneration = options.longs === String ? "0" : 0; + object.logUri = ""; + object.terminalCondition = null; + object.satisfiesPzs = false; + object.reconciling = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.lastModifier != null && message.hasOwnProperty("lastModifier")) + object.lastModifier = message.lastModifier; + if (message.client != null && message.hasOwnProperty("client")) + object.client = message.client; + if (message.clientVersion != null && message.hasOwnProperty("clientVersion")) + object.clientVersion = message.clientVersion; + 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.binaryAuthorization != null && message.hasOwnProperty("binaryAuthorization")) + object.binaryAuthorization = $root.google.cloud.run.v2.BinaryAuthorization.toObject(message.binaryAuthorization, options); + if (message.vpcAccess != null && message.hasOwnProperty("vpcAccess")) + object.vpcAccess = $root.google.cloud.run.v2.VpcAccess.toObject(message.vpcAccess, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.containers && message.containers.length) { + object.containers = []; + for (var j = 0; j < message.containers.length; ++j) + object.containers[j] = $root.google.cloud.run.v2.Container.toObject(message.containers[j], options); + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.run.v2.Volume.toObject(message.volumes[j], options); + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = message.encryptionKey; + if (message.encryptionKeyRevocationAction != null && message.hasOwnProperty("encryptionKeyRevocationAction")) + object.encryptionKeyRevocationAction = options.enums === String ? $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] === undefined ? message.encryptionKeyRevocationAction : $root.google.cloud.run.v2.EncryptionKeyRevocationAction[message.encryptionKeyRevocationAction] : message.encryptionKeyRevocationAction; + if (message.encryptionKeyShutdownDuration != null && message.hasOwnProperty("encryptionKeyShutdownDuration")) + object.encryptionKeyShutdownDuration = $root.google.protobuf.Duration.toObject(message.encryptionKeyShutdownDuration, options); + if (message.nodeSelector != null && message.hasOwnProperty("nodeSelector")) + object.nodeSelector = $root.google.cloud.run.v2.NodeSelector.toObject(message.nodeSelector, options); + if (message.gpuZonalRedundancyDisabled != null && message.hasOwnProperty("gpuZonalRedundancyDisabled")) { + object.gpuZonalRedundancyDisabled = message.gpuZonalRedundancyDisabled; + if (options.oneofs) + object._gpuZonalRedundancyDisabled = "gpuZonalRedundancyDisabled"; + } + if (message.ingress != null && message.hasOwnProperty("ingress")) + object.ingress = options.enums === String ? $root.google.cloud.run.v2.IngressTraffic[message.ingress] === undefined ? message.ingress : $root.google.cloud.run.v2.IngressTraffic[message.ingress] : message.ingress; + if (message.invokerIamDisabled != null && message.hasOwnProperty("invokerIamDisabled")) + object.invokerIamDisabled = message.invokerIamDisabled; + if (message.iapEnabled != null && message.hasOwnProperty("iapEnabled")) + object.iapEnabled = message.iapEnabled; + if (message.observedGeneration != null && message.hasOwnProperty("observedGeneration")) + if (typeof message.observedGeneration === "number") + object.observedGeneration = options.longs === String ? String(message.observedGeneration) : message.observedGeneration; + else + object.observedGeneration = options.longs === String ? $util.Long.prototype.toString.call(message.observedGeneration) : options.longs === Number ? new $util.LongBits(message.observedGeneration.low >>> 0, message.observedGeneration.high >>> 0).toNumber() : message.observedGeneration; + if (message.logUri != null && message.hasOwnProperty("logUri")) + object.logUri = message.logUri; + if (message.terminalCondition != null && message.hasOwnProperty("terminalCondition")) + object.terminalCondition = $root.google.cloud.run.v2.Condition.toObject(message.terminalCondition, options); + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.cloud.run.v2.Condition.toObject(message.conditions[j], options); + } + if (message.containerStatuses && message.containerStatuses.length) { + object.containerStatuses = []; + for (var j = 0; j < message.containerStatuses.length; ++j) + object.containerStatuses[j] = $root.google.cloud.run.v2.ContainerStatus.toObject(message.containerStatuses[j], options); + } + if (message.urls && message.urls.length) { + object.urls = []; + for (var j = 0; j < message.urls.length; ++j) + object.urls[j] = message.urls[j]; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.run.v2.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.run.v2.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.run.v2.Instance"; + }; + + return Instance; + })(); + v2.InstanceSplit = (function() { /** diff --git a/packages/google-cloud-run/protos/protos.json b/packages/google-cloud-run/protos/protos.json index eb4062c6337..cdebe0a282b 100644 --- a/packages/google-cloud-run/protos/protos.json +++ b/packages/google-cloud-run/protos/protos.json @@ -351,6 +351,18 @@ } } }, + "ContainerStatus": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "imageDigest": { + "type": "string", + "id": 2 + } + } + }, "Executions": { "options": { "(google.api.default_host)": "run.googleapis.com", @@ -888,6 +900,10 @@ "type": "Probe", "id": 11 }, + "readinessProbe": { + "type": "Probe", + "id": 14 + }, "dependsOn": { "rule": "repeated", "type": "string", @@ -1677,6 +1693,617 @@ } } }, + "Instances": { + "options": { + "(google.api.default_host)": "run.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "instance", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent,instance", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/locations/*}/instances", + "body": "instance" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent,instance" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/locations/*/instances/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/locations/*/instances/*}", + "(google.api.routing).routing_parameters.field": "name", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}/**", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "name", + "path_template": "projects/*/locations/{location=*}/**" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/instances", + "(google.api.routing).routing_parameters.field": "parent", + "(google.api.routing).routing_parameters.path_template": "projects/*/locations/{location=*}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/locations/*}/instances" + } + }, + { + "(google.api.routing)": { + "routing_parameters": { + "field": "parent", + "path_template": "projects/*/locations/{location=*}" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "StopInstance": { + "requestType": "StopInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/instances/*}:stop", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/instances/*}:stop", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + }, + "StartInstance": { + "requestType": "StartInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/locations/*/instances/*}:start", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "Instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/locations/*/instances/*}:start", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "Instance" + } + } + ] + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Instance" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "run.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "showDeleted": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "StopInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StartInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "run.googleapis.com/Instance" + } + }, + "validateOnly": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "run.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance" + }, + "oneofs": { + "_gpuZonalRedundancyDisabled": { + "oneof": [ + "gpuZonalRedundancyDisabled" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 3 + }, + "uid": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "generation": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastModifier": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "client": { + "type": "string", + "id": 14 + }, + "clientVersion": { + "type": "string", + "id": 15 + }, + "launchStage": { + "type": "google.api.LaunchStage", + "id": 16 + }, + "binaryAuthorization": { + "type": "BinaryAuthorization", + "id": 17 + }, + "vpcAccess": { + "type": "VpcAccess", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 19 + }, + "containers": { + "rule": "repeated", + "type": "Container", + "id": 20, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 21 + }, + "encryptionKey": { + "type": "string", + "id": 22, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "encryptionKeyRevocationAction": { + "type": "EncryptionKeyRevocationAction", + "id": 24 + }, + "encryptionKeyShutdownDuration": { + "type": "google.protobuf.Duration", + "id": 25 + }, + "nodeSelector": { + "type": "NodeSelector", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gpuZonalRedundancyDisabled": { + "type": "bool", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ingress": { + "type": "IngressTraffic", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "invokerIamDisabled": { + "type": "bool", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "iapEnabled": { + "type": "bool", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "observedGeneration": { + "type": "int64", + "id": 40, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logUri": { + "type": "string", + "id": 41, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "terminalCondition": { + "type": "Condition", + "id": 42, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 43, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "containerStatuses": { + "rule": "repeated", + "type": "ContainerStatus", + "id": 44, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 46, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "urls": { + "rule": "repeated", + "type": "string", + "id": 45, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 98, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 99, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "InstanceSplit": { "fields": { "type": { diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.create_instance.js b/packages/google-cloud-run/samples/generated/v2/instances.create_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.create_instance.js rename to packages/google-cloud-run/samples/generated/v2/instances.create_instance.js diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.delete_instance.js b/packages/google-cloud-run/samples/generated/v2/instances.delete_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.delete_instance.js rename to packages/google-cloud-run/samples/generated/v2/instances.delete_instance.js diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.get_instance.js b/packages/google-cloud-run/samples/generated/v2/instances.get_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.get_instance.js rename to packages/google-cloud-run/samples/generated/v2/instances.get_instance.js diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.list_instances.js b/packages/google-cloud-run/samples/generated/v2/instances.list_instances.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.list_instances.js rename to packages/google-cloud-run/samples/generated/v2/instances.list_instances.js diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.start_instance.js b/packages/google-cloud-run/samples/generated/v2/instances.start_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.start_instance.js rename to packages/google-cloud-run/samples/generated/v2/instances.start_instance.js diff --git a/owl-bot-staging/google-cloud-run/samples/generated/v2/instances.stop_instance.js b/packages/google-cloud-run/samples/generated/v2/instances.stop_instance.js similarity index 100% rename from owl-bot-staging/google-cloud-run/samples/generated/v2/instances.stop_instance.js rename to packages/google-cloud-run/samples/generated/v2/instances.stop_instance.js diff --git a/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json b/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json index aea9941ab0d..4ff250fc8b5 100644 --- a/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json +++ b/packages/google-cloud-run/samples/generated/v2/snippet_metadata_google.cloud.run.v2.json @@ -279,6 +279,294 @@ } } }, + { + "regionTag": "run_v2_generated_Instances_CreateInstance_async", + "title": "Builds createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates an Instance.", + "canonical": true, + "file": "instances.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.run.v2.Instances.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.run.v2.Instance" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.run.v2.Instances.CreateInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_DeleteInstance_async", + "title": "Builds deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Instance", + "canonical": true, + "file": "instances.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.run.v2.Instances.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.run.v2.Instances.DeleteInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_GetInstance_async", + "title": "Builds getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets a Instance", + "canonical": true, + "file": "instances.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.run.v2.Instances.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.run.v2.Instance", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.run.v2.Instances.GetInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_ListInstances_async", + "title": "Builds listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Instances. Results are sorted by creation time, descending.", + "canonical": true, + "file": "instances.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.run.v2.Instances.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "show_deleted", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.run.v2.ListInstancesResponse", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.run.v2.Instances.ListInstances", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_StopInstance_async", + "title": "Builds stopInstance Sample", + "origin": "API_DEFINITION", + "description": " Stops an Instance.", + "canonical": true, + "file": "instances.stop_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopInstance", + "fullName": "google.cloud.run.v2.Instances.StopInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "StopInstance", + "fullName": "google.cloud.run.v2.Instances.StopInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, + { + "regionTag": "run_v2_generated_Instances_StartInstance_async", + "title": "Builds startInstance Sample", + "origin": "API_DEFINITION", + "description": " Starts an Instance.", + "canonical": true, + "file": "instances.start_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartInstance", + "fullName": "google.cloud.run.v2.Instances.StartInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InstancesClient", + "fullName": "google.cloud.run.v2.InstancesClient" + }, + "method": { + "shortName": "StartInstance", + "fullName": "google.cloud.run.v2.Instances.StartInstance", + "service": { + "shortName": "Instances", + "fullName": "google.cloud.run.v2.Instances" + } + } + } + }, { "regionTag": "run_v2_generated_Jobs_CreateJob_async", "title": "Builds createJob Sample", diff --git a/packages/google-cloud-run/src/index.ts b/packages/google-cloud-run/src/index.ts index 4f2780c7a14..3c28cf6bbfb 100644 --- a/packages/google-cloud-run/src/index.ts +++ b/packages/google-cloud-run/src/index.ts @@ -22,6 +22,8 @@ const BuildsClient = v2.BuildsClient; type BuildsClient = v2.BuildsClient; const ExecutionsClient = v2.ExecutionsClient; type ExecutionsClient = v2.ExecutionsClient; +const InstancesClient = v2.InstancesClient; +type InstancesClient = v2.InstancesClient; const JobsClient = v2.JobsClient; type JobsClient = v2.JobsClient; const RevisionsClient = v2.RevisionsClient; @@ -33,7 +35,7 @@ type TasksClient = v2.TasksClient; const WorkerPoolsClient = v2.WorkerPoolsClient; type WorkerPoolsClient = v2.WorkerPoolsClient; -export {v2, BuildsClient, ExecutionsClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; -export default {v2, BuildsClient, ExecutionsClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; +export {v2, BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; +export default {v2, BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-run/src/v2/builds_client.ts b/packages/google-cloud-run/src/v2/builds_client.ts index a7f21132f7e..9cbdf164888 100644 --- a/packages/google-cloud-run/src/v2/builds_client.ts +++ b/packages/google-cloud-run/src/v2/builds_client.ts @@ -186,6 +186,9 @@ export class BuildsClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -618,6 +621,55 @@ export class BuildsClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/builds_proto_list.json b/packages/google-cloud-run/src/v2/builds_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/builds_proto_list.json +++ b/packages/google-cloud-run/src/v2/builds_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/executions_client.ts b/packages/google-cloud-run/src/v2/executions_client.ts index 32b504b2c69..29b7e4871fb 100644 --- a/packages/google-cloud-run/src/v2/executions_client.ts +++ b/packages/google-cloud-run/src/v2/executions_client.ts @@ -187,6 +187,9 @@ export class ExecutionsClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -1306,6 +1309,55 @@ export class ExecutionsClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/executions_proto_list.json b/packages/google-cloud-run/src/v2/executions_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/executions_proto_list.json +++ b/packages/google-cloud-run/src/v2/executions_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/gapic_metadata.json b/packages/google-cloud-run/src/v2/gapic_metadata.json index b8997e7763e..2276e2b6394 100644 --- a/packages/google-cloud-run/src/v2/gapic_metadata.json +++ b/packages/google-cloud-run/src/v2/gapic_metadata.json @@ -87,6 +87,84 @@ } } }, + "Instances": { + "clients": { + "grpc": { + "libraryClient": "InstancesClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "StopInstance": { + "methods": [ + "stopInstance" + ] + }, + "StartInstance": { + "methods": [ + "startInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InstancesClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "StopInstance": { + "methods": [ + "stopInstance" + ] + }, + "StartInstance": { + "methods": [ + "startInstance" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + }, "Jobs": { "clients": { "grpc": { diff --git a/packages/google-cloud-run/src/v2/index.ts b/packages/google-cloud-run/src/v2/index.ts index 8e683c63caf..6cc79ce5e90 100644 --- a/packages/google-cloud-run/src/v2/index.ts +++ b/packages/google-cloud-run/src/v2/index.ts @@ -18,6 +18,7 @@ export {BuildsClient} from './builds_client'; export {ExecutionsClient} from './executions_client'; +export {InstancesClient} from './instances_client'; export {JobsClient} from './jobs_client'; export {RevisionsClient} from './revisions_client'; export {ServicesClient} from './services_client'; diff --git a/owl-bot-staging/google-cloud-run/src/v2/instances_client.ts b/packages/google-cloud-run/src/v2/instances_client.ts similarity index 100% rename from owl-bot-staging/google-cloud-run/src/v2/instances_client.ts rename to packages/google-cloud-run/src/v2/instances_client.ts diff --git a/owl-bot-staging/google-cloud-run/src/v2/instances_client_config.json b/packages/google-cloud-run/src/v2/instances_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-run/src/v2/instances_client_config.json rename to packages/google-cloud-run/src/v2/instances_client_config.json diff --git a/owl-bot-staging/google-cloud-run/src/v2/instances_proto_list.json b/packages/google-cloud-run/src/v2/instances_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-run/src/v2/instances_proto_list.json rename to packages/google-cloud-run/src/v2/instances_proto_list.json diff --git a/packages/google-cloud-run/src/v2/jobs_client.ts b/packages/google-cloud-run/src/v2/jobs_client.ts index 5531e004f78..dff326d9416 100644 --- a/packages/google-cloud-run/src/v2/jobs_client.ts +++ b/packages/google-cloud-run/src/v2/jobs_client.ts @@ -187,6 +187,9 @@ export class JobsClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -1945,6 +1948,55 @@ export class JobsClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/jobs_proto_list.json b/packages/google-cloud-run/src/v2/jobs_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/jobs_proto_list.json +++ b/packages/google-cloud-run/src/v2/jobs_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/revisions_client.ts b/packages/google-cloud-run/src/v2/revisions_client.ts index e56fee66c10..c2d97a21619 100644 --- a/packages/google-cloud-run/src/v2/revisions_client.ts +++ b/packages/google-cloud-run/src/v2/revisions_client.ts @@ -190,6 +190,9 @@ export class RevisionsClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -1300,6 +1303,55 @@ export class RevisionsClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/revisions_proto_list.json b/packages/google-cloud-run/src/v2/revisions_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/revisions_proto_list.json +++ b/packages/google-cloud-run/src/v2/revisions_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/services_client.ts b/packages/google-cloud-run/src/v2/services_client.ts index 765e36f4549..3fabf84fd3c 100644 --- a/packages/google-cloud-run/src/v2/services_client.ts +++ b/packages/google-cloud-run/src/v2/services_client.ts @@ -187,6 +187,9 @@ export class ServicesClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -1816,6 +1819,55 @@ export class ServicesClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/services_proto_list.json b/packages/google-cloud-run/src/v2/services_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/services_proto_list.json +++ b/packages/google-cloud-run/src/v2/services_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/tasks_client.ts b/packages/google-cloud-run/src/v2/tasks_client.ts index 664c529070d..38b33a4e5dc 100644 --- a/packages/google-cloud-run/src/v2/tasks_client.ts +++ b/packages/google-cloud-run/src/v2/tasks_client.ts @@ -189,6 +189,9 @@ export class TasksClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -878,6 +881,55 @@ export class TasksClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/tasks_proto_list.json b/packages/google-cloud-run/src/v2/tasks_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/tasks_proto_list.json +++ b/packages/google-cloud-run/src/v2/tasks_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/src/v2/worker_pools_client.ts b/packages/google-cloud-run/src/v2/worker_pools_client.ts index fd19709aef7..842874cf75c 100644 --- a/packages/google-cloud-run/src/v2/worker_pools_client.ts +++ b/packages/google-cloud-run/src/v2/worker_pools_client.ts @@ -187,6 +187,9 @@ export class WorkerPoolsClient { executionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}' ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), jobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/jobs/{job}' ), @@ -1827,6 +1830,55 @@ export class WorkerPoolsClient { return this.pathTemplates.executionPathTemplate.match(executionName).execution; } + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + /** * Return a fully-qualified job resource name string. * diff --git a/packages/google-cloud-run/src/v2/worker_pools_proto_list.json b/packages/google-cloud-run/src/v2/worker_pools_proto_list.json index e4f09a2cfe3..0d5d6ea6137 100644 --- a/packages/google-cloud-run/src/v2/worker_pools_proto_list.json +++ b/packages/google-cloud-run/src/v2/worker_pools_proto_list.json @@ -1,8 +1,10 @@ [ "../../protos/google/cloud/run/v2/build.proto", "../../protos/google/cloud/run/v2/condition.proto", + "../../protos/google/cloud/run/v2/container_status.proto", "../../protos/google/cloud/run/v2/execution.proto", "../../protos/google/cloud/run/v2/execution_template.proto", + "../../protos/google/cloud/run/v2/instance.proto", "../../protos/google/cloud/run/v2/instance_split.proto", "../../protos/google/cloud/run/v2/job.proto", "../../protos/google/cloud/run/v2/k8s.min.proto", diff --git a/packages/google-cloud-run/system-test/fixtures/sample/src/index.js b/packages/google-cloud-run/system-test/fixtures/sample/src/index.js index 18a87d0b3d9..b75bcd5378f 100644 --- a/packages/google-cloud-run/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-run/system-test/fixtures/sample/src/index.js @@ -23,6 +23,7 @@ const run = require('@google-cloud/run'); function main() { const buildsClient = new run.BuildsClient(); const executionsClient = new run.ExecutionsClient(); + const instancesClient = new run.InstancesClient(); const jobsClient = new run.JobsClient(); const revisionsClient = new run.RevisionsClient(); const servicesClient = new run.ServicesClient(); diff --git a/packages/google-cloud-run/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-run/system-test/fixtures/sample/src/index.ts index 7e87907d78b..bdf1cc11f53 100644 --- a/packages/google-cloud-run/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-run/system-test/fixtures/sample/src/index.ts @@ -16,7 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {BuildsClient, ExecutionsClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient} from '@google-cloud/run'; +import {BuildsClient, ExecutionsClient, InstancesClient, JobsClient, RevisionsClient, ServicesClient, TasksClient, WorkerPoolsClient} from '@google-cloud/run'; // check that the client class type name can be used function doStuffWithBuildsClient(client: BuildsClient) { @@ -25,6 +25,9 @@ function doStuffWithBuildsClient(client: BuildsClient) { function doStuffWithExecutionsClient(client: ExecutionsClient) { client.close(); } +function doStuffWithInstancesClient(client: InstancesClient) { + client.close(); +} function doStuffWithJobsClient(client: JobsClient) { client.close(); } @@ -49,6 +52,9 @@ function main() { const executionsClient = new ExecutionsClient(); doStuffWithExecutionsClient(executionsClient); // check that the client instance can be created + const instancesClient = new InstancesClient(); + doStuffWithInstancesClient(instancesClient); + // check that the client instance can be created const jobsClient = new JobsClient(); doStuffWithJobsClient(jobsClient); // check that the client instance can be created diff --git a/packages/google-cloud-run/test/gapic_builds_v2.ts b/packages/google-cloud-run/test/gapic_builds_v2.ts index d52cd1b6cbb..a0a18108510 100644 --- a/packages/google-cloud-run/test/gapic_builds_v2.ts +++ b/packages/google-cloud-run/test/gapic_builds_v2.ts @@ -562,6 +562,52 @@ describe('v2.BuildsClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new buildsModule.v2.BuildsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/packages/google-cloud-run/test/gapic_executions_v2.ts b/packages/google-cloud-run/test/gapic_executions_v2.ts index f4f44849a6f..69f44a4308b 100644 --- a/packages/google-cloud-run/test/gapic_executions_v2.ts +++ b/packages/google-cloud-run/test/gapic_executions_v2.ts @@ -1413,6 +1413,52 @@ describe('v2.ExecutionsClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new executionsModule.v2.ExecutionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/owl-bot-staging/google-cloud-run/test/gapic_instances_v2.ts b/packages/google-cloud-run/test/gapic_instances_v2.ts similarity index 100% rename from owl-bot-staging/google-cloud-run/test/gapic_instances_v2.ts rename to packages/google-cloud-run/test/gapic_instances_v2.ts diff --git a/packages/google-cloud-run/test/gapic_jobs_v2.ts b/packages/google-cloud-run/test/gapic_jobs_v2.ts index f3732088b84..014c64087bf 100644 --- a/packages/google-cloud-run/test/gapic_jobs_v2.ts +++ b/packages/google-cloud-run/test/gapic_jobs_v2.ts @@ -2022,6 +2022,52 @@ describe('v2.JobsClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new jobsModule.v2.JobsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/packages/google-cloud-run/test/gapic_revisions_v2.ts b/packages/google-cloud-run/test/gapic_revisions_v2.ts index 46f6cc643d7..19e6f48c13f 100644 --- a/packages/google-cloud-run/test/gapic_revisions_v2.ts +++ b/packages/google-cloud-run/test/gapic_revisions_v2.ts @@ -1298,6 +1298,52 @@ describe('v2.RevisionsClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new revisionsModule.v2.RevisionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/packages/google-cloud-run/test/gapic_services_v2.ts b/packages/google-cloud-run/test/gapic_services_v2.ts index 8436c6f91e6..5a5ff605ed7 100644 --- a/packages/google-cloud-run/test/gapic_services_v2.ts +++ b/packages/google-cloud-run/test/gapic_services_v2.ts @@ -1872,6 +1872,52 @@ describe('v2.ServicesClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new servicesModule.v2.ServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/packages/google-cloud-run/test/gapic_tasks_v2.ts b/packages/google-cloud-run/test/gapic_tasks_v2.ts index 88a211f091d..02f293fcb32 100644 --- a/packages/google-cloud-run/test/gapic_tasks_v2.ts +++ b/packages/google-cloud-run/test/gapic_tasks_v2.ts @@ -888,6 +888,52 @@ describe('v2.TasksClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new tasksModule.v2.TasksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = { diff --git a/packages/google-cloud-run/test/gapic_worker_pools_v2.ts b/packages/google-cloud-run/test/gapic_worker_pools_v2.ts index 20d7efec56a..f74aef7c940 100644 --- a/packages/google-cloud-run/test/gapic_worker_pools_v2.ts +++ b/packages/google-cloud-run/test/gapic_worker_pools_v2.ts @@ -1872,6 +1872,52 @@ describe('v2.WorkerPoolsClient', () => { }); }); + describe('instance', async () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new workerpoolsModule.v2.WorkerPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('job', async () => { const fakePath = "/rendered/path/job"; const expectedParameters = {